From: Nicolas Thill Date: Sun, 4 Jun 2006 13:23:07 +0000 (+0000) Subject: add rp-l2tp package (closes: #459). X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5530a20e60dd64b013382eaea57bc9f9e8a6ee1e;p=openwrt%2Fstaging%2F981213.git add rp-l2tp package (closes: #459). SVN-Revision: 3902 --- diff --git a/openwrt/package/Config.in b/openwrt/package/Config.in index b443bc2fcb..2a70d9cc86 100644 --- a/openwrt/package/Config.in +++ b/openwrt/package/Config.in @@ -148,6 +148,7 @@ source "package/raddump/Config.in" source "package/rarpd/Config.in" source "package/reaim/Config.in" source "package/robocfg/Config.in" +source "package/rp-l2tp/Config.in" source "package/rp-pppoe/Config.in" source "package/rrs/Config.in" source "package/rsync/Config.in" diff --git a/openwrt/package/Makefile b/openwrt/package/Makefile index e5b226932a..fff49ab33b 100644 --- a/openwrt/package/Makefile +++ b/openwrt/package/Makefile @@ -216,6 +216,7 @@ package-$(BR2_PACKAGE_RARPD) += rarpd package-$(BR2_COMPILE_READLINE) += readline package-$(BR2_PACKAGE_REAIM) += reaim package-$(BR2_PACKAGE_ROBOCFG) += robocfg +package-$(BR2_COMPILE_RP_L2TP) += rp-l2tp package-$(BR2_COMPILE_RP_PPPOE) += rp-pppoe package-$(BR2_PACKAGE_RRDCOLLECT) += rrdcollect package-$(BR2_COMPILE_RRDTOOL) += rrdtool diff --git a/openwrt/package/rp-l2tp/Config.in b/openwrt/package/rp-l2tp/Config.in new file mode 100644 index 0000000000..962f27397d --- /dev/null +++ b/openwrt/package/rp-l2tp/Config.in @@ -0,0 +1,34 @@ +#menu "rp-l2tp............................ Roaring Penguin PPPoE (PPP over Ethernet) implementation" + +config BR2_COMPILE_RP_L2TP + tristate + default n + depends BR2_PACKAGE_RP_L2TPD + +config BR2_PACKAGE_RP_L2TPD + prompt "rp-l2tpd.......................... an L2TP (Layer 2 Tunneling Protocol) daemon" + tristate + default m if CONFIG_DEVEL + select BR2_COMPILE_RP_L2TP + help + An L2TP (Layer 2 Tunneling Protocol) daemon. + + http://sourceforge.net/projects/rp-l2tp/ + +config BR2_PACKAGE_RP_L2TPD_MOD_CMD + prompt "rp-l2tpd-mod-cmd................ a simple command handler for the L2TP daemon" + tristate + default m if CONFIG_DEVEL + depends BR2_PACKAGE_RP_L2TPD + help + A simple command handler for the L2TP daemon. + +config BR2_PACKAGE_RP_L2TPD_MOD_PPP + prompt "rp-l2tpd-mod-ppp................ a PPP handler for the L2TP daeomon" + tristate + default m if CONFIG_DEVEL + depends BR2_PACKAGE_RP_L2TPD + help + A PPP handler for the L2TP daeomon. + +#endmenu diff --git a/openwrt/package/rp-l2tp/Makefile b/openwrt/package/rp-l2tp/Makefile new file mode 100644 index 0000000000..e8bf08857b --- /dev/null +++ b/openwrt/package/rp-l2tp/Makefile @@ -0,0 +1,82 @@ +# $Id$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=rp-l2tp +PKG_VERSION:=0.4 +PKG_RELEASE:=1 +PKG_MD5SUM:=0e45d11cb4fa6c56cce6b1d119733ed9 + +PKG_SOURCE_URL:=@SF/rp-l2tp +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install + +include $(TOPDIR)/package/rules.mk + +$(eval $(call PKG_template,RP_L2TPD,rp-l2tpd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) +$(eval $(call PKG_template,RP_L2TPD_MOD_CMD,rp-l2tpd-mod-cmd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) +$(eval $(call PKG_template,RP_L2TPD_MOD_PPP,rp-l2tpd-mod-ppp,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) + +$(PKG_BUILD_DIR)/.configured: + (cd $(PKG_BUILD_DIR); rm -rf config.cache; \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \ + LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --program-prefix="" \ + --program-suffix="" \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --datadir=/usr/share \ + --includedir=/usr/include \ + --infodir=/usr/share/info \ + --libdir=/usr/lib \ + --libexecdir=/usr/lib \ + --localstatedir=/var \ + --mandir=/usr/share/man \ + --sbindir=/usr/sbin \ + --sysconfdir=/etc \ + $(DISABLE_LARGEFILE) \ + $(DISABLE_NLS) \ + ) + touch $@ + +$(PKG_BUILD_DIR)/.built: + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install + touch $@ + +$(IPKG_RP_L2TPD): + install -d -m0755 $(IDIR_RP_L2TPD)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/l2tp.conf.example $(IDIR_RP_L2TPD)/etc/l2tp.conf + install -d -m0755 $(IDIR_RP_L2TPD)/etc/init.d + install -m0755 ./files/rp-l2tpd.init $(IDIR_RP_L2TPD)/etc/init.d/rp-l2tpd + install -d -m0755 $(IDIR_RP_L2TPD)/usr/lib/l2tp + install -d -m0755 $(IDIR_RP_L2TPD)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/l2tpd $(IDIR_RP_L2TPD)/usr/sbin/ + $(RSTRIP) $(IDIR_RP_L2TPD) + $(IPKG_BUILD) $(IDIR_RP_L2TPD) $(PACKAGE_DIR) + +$(IPKG_RP_L2TPD_MOD_CMD): + install -d -m0755 $(IDIR_RP_L2TPD_MOD_CMD)/usr/lib/l2tp + $(CP) $(PKG_INSTALL_DIR)/usr/lib/l2tp/cmd.so $(IDIR_RP_L2TPD_MOD_CMD)/usr/lib/l2tp/ + install -d -m0755 $(IDIR_RP_L2TPD_MOD_CMD)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/l2tp-control $(IDIR_RP_L2TPD_MOD_CMD)/usr/sbin/ + $(RSTRIP) $(IDIR_RP_L2TPD_MOD_CMD) + $(IPKG_BUILD) $(IDIR_RP_L2TPD_MOD_CMD) $(PACKAGE_DIR) + +$(IPKG_RP_L2TPD_MOD_PPP): + install -d -m0755 $(IDIR_RP_L2TPD_MOD_PPP)/usr/lib/l2tp + $(CP) $(PKG_INSTALL_DIR)/usr/lib/l2tp/sync-pppd.so $(IDIR_RP_L2TPD_MOD_PPP)/usr/lib/l2tp/ + $(RSTRIP) $(IDIR_RP_L2TPD_MOD_PPP) + $(IPKG_BUILD) $(IDIR_RP_L2TPD_MOD_PPP) $(PACKAGE_DIR) diff --git a/openwrt/package/rp-l2tp/files/rp-l2tpd.init b/openwrt/package/rp-l2tp/files/rp-l2tpd.init new file mode 100755 index 0000000000..4e03836bbe --- /dev/null +++ b/openwrt/package/rp-l2tp/files/rp-l2tpd.init @@ -0,0 +1,17 @@ +#!/bin/sh + +DEFAULT=/etc/default/rp-l2tpd +RUN_D=/var/run +[ -f $DEFAULT ] && . $DEFAULT + +case $1 in + start) + [ -d $RUN_D ] || mkdir -p $RUN_D + l2tpd $OPTIONS + ;; + *) + echo "usage: $0 (start)" + exit 1 +esac + +exit $? diff --git a/openwrt/package/rp-l2tp/ipkg/rp-l2tpd-mod-cmd.control b/openwrt/package/rp-l2tp/ipkg/rp-l2tpd-mod-cmd.control new file mode 100644 index 0000000000..d8ee698105 --- /dev/null +++ b/openwrt/package/rp-l2tp/ipkg/rp-l2tpd-mod-cmd.control @@ -0,0 +1,5 @@ +Package: rp-l2tpd-mod-cmd +Priority: optional +Section: net +Description: a simple command handler for the L2TP daemon +Depends: rp-l2tpd diff --git a/openwrt/package/rp-l2tp/ipkg/rp-l2tpd-mod-ppp.control b/openwrt/package/rp-l2tp/ipkg/rp-l2tpd-mod-ppp.control new file mode 100644 index 0000000000..4237dff0d8 --- /dev/null +++ b/openwrt/package/rp-l2tp/ipkg/rp-l2tpd-mod-ppp.control @@ -0,0 +1,5 @@ +Package: rp-l2tpd-mod-ppp +Priority: optional +Section: net +Description: a PPP handler for the L2TP daeomon +Depends: rp-l2tpd, ppp diff --git a/openwrt/package/rp-l2tp/ipkg/rp-l2tpd.conffiles b/openwrt/package/rp-l2tp/ipkg/rp-l2tpd.conffiles new file mode 100644 index 0000000000..6d441f4bfb --- /dev/null +++ b/openwrt/package/rp-l2tp/ipkg/rp-l2tpd.conffiles @@ -0,0 +1 @@ +/etc/l2tp.conf diff --git a/openwrt/package/rp-l2tp/ipkg/rp-l2tpd.control b/openwrt/package/rp-l2tp/ipkg/rp-l2tpd.control new file mode 100644 index 0000000000..f1ba72fb83 --- /dev/null +++ b/openwrt/package/rp-l2tp/ipkg/rp-l2tpd.control @@ -0,0 +1,4 @@ +Package: rp-l2tpd +Priority: optional +Section: net +Description: an L2TP (Layer 2 Tunneling Protocol) daemon diff --git a/openwrt/package/rp-l2tp/patches/01-cross.patch b/openwrt/package/rp-l2tp/patches/01-cross.patch new file mode 100644 index 0000000000..654402efd0 --- /dev/null +++ b/openwrt/package/rp-l2tp/patches/01-cross.patch @@ -0,0 +1,235 @@ +diff -ruN rp-l2tp-0.4-orig/Makefile.in rp-l2tp-0.4-4/Makefile.in +--- rp-l2tp-0.4-orig/Makefile.in 2004-07-01 17:17:11.000000000 +0200 ++++ rp-l2tp-0.4-4/Makefile.in 2005-03-09 16:26:49.000000000 +0100 +@@ -27,10 +27,10 @@ + sbindir=@sbindir@ + + OBJS=auth.o debug.o dgram.o main.o md5.o network.o options.o peer.o session.o tunnel.o utils.o +-EXTRA_LIBS=@LIBEVENT@/*.o -ldl ++EXTRA_LIBS=@LIBEVENT@/*.o -lc -ldl + + SRCS=$(OBJS:.o=.c) +-CFLAGS=-g -I.. -I@LIBEVENT@ -Wall -Wstrict-prototypes -ansi -pedantic -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" -DPREFIX=\"$(prefix)\" ++CFLAGS=@CFLAGS@ -I@LIBEVENT@ -Wall -Wstrict-prototypes -ansi -pedantic -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" -DPREFIX=\"$(prefix)\" + + TARGETS=l2tpd libl2tp.a handlers + +@@ -38,12 +38,12 @@ + + libl2tp.a: $(OBJS) + rm -f $@ +- ar -rc $@ $^ +- ranlib $@ || true ++ $(AR) -rc $@ $^ ++ @RANLIB@ $@ || true + + l2tpd: libl2tp.a libevent/libevent.a + $(MAKE) -C handlers +- @CC@ -o l2tpd -rdynamic $(OBJS) $(EXTRA_LIBS) ++ @CC@ $(CFLAGS) -o l2tpd -rdynamic $(OBJS) $(EXTRA_LIBS) + + libevent/libevent.a: + test -d libevent || ln -s ../libevent . +@@ -72,18 +72,20 @@ + rm -f *.o *.a *~ + rm -f l2tpd + $(MAKE) -C handlers clean ++ $(MAKE) -C libevent clean + + distclean: clean +- rm -f Makefile config.cache ++ rm -f Makefile config.cache config.log config.status .depend + $(MAKE) -C handlers distclean ++ $(MAKE) -C libevent distclean + + -include .depend + + install: all + -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir) +- $(install) -m 755 -s l2tpd $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir) ++ $(install) -m 755 l2tpd $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir) + -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/l2tp +- $(install) -m 644 l2tp.conf $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/l2tp/l2tp.conf.example ++ $(install) -m 644 l2tp.conf $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/l2tp.conf.example + -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man8 + -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man5 + $(install) -m 644 man/l2tpd.8 $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man8 +diff -ruN rp-l2tp-0.4-orig/handlers/Makefile.in rp-l2tp-0.4-4/handlers/Makefile.in +--- rp-l2tp-0.4-orig/handlers/Makefile.in 2002-09-30 21:45:00.000000000 +0200 ++++ rp-l2tp-0.4-4/handlers/Makefile.in 2005-03-09 16:26:49.000000000 +0100 +@@ -14,32 +14,34 @@ + + OBJS=pty.o sync-pppd.o dstring.o + SRCS=$(OBJS:.o=.c) +-CFLAGS=-g -O2 -I.. -I../libevent -I../../libevent -Wall ++CFLAGS=@CFLAGS@ -I.. -I../libevent -I../../libevent -Wall + + all: $(HANDLERS) l2tp-control + + l2tp-control: cmd-control.o +- gcc -o l2tp-control cmd-control.o ++ $(CC) $(CFLAGS) -o l2tp-control cmd-control.o + + cmd-control.o: cmd-control.c +- gcc -c -o $@ $^ ++ $(CC) $(CFLAGS) -c -o $@ $^ + + %.o: %.c +- gcc $(CFLAGS) -fPIC -c -o $@ $< ++ $(CC) $(CFLAGS) -fPIC -c -o $@ $< + + sync-pppd.so: pty.o sync-pppd.o +- gcc -shared -o $@ $^ ++ $(CC) $(CFLAGS) -shared -o $@ $^ + + cmd.so: cmd.o dstring.o +- gcc -shared -o $@ $^ ++ $(CC) $(CFLAGS) -shared -o $@ $^ + + clean: + rm -f *.so *.o *~ + rm -f l2tp-control + + install: all +- -mkdir -p $(RPM_INSTALL_ROOT)$(sbindir) +- -mkdir -p $(RPM_INSTALL_ROOT)$(prefix)/lib/l2tp/plugins +- $(install) -m 755 -s l2tp-control $(RPM_INSTALL_ROOT)$(sbindir) +- $(install) -m 755 $(HANDLERS) $(RPM_INSTALL_ROOT)$(prefix)/lib/l2tp/plugins ++ -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir) ++ -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(prefix)/lib/l2tp ++ $(install) -m 755 l2tp-control $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir) ++ $(install) -m 755 $(HANDLERS) $(RPM_INSTALL_ROOT)$(DESTDIR)$(prefix)/lib/l2tp ++ + distclean: clean ++ rm -f Makefile +diff -ruN rp-l2tp-0.4-orig/handlers/cmd-control.c rp-l2tp-0.4-4/handlers/cmd-control.c +--- rp-l2tp-0.4-orig/handlers/cmd-control.c 2002-09-30 21:45:00.000000000 +0200 ++++ rp-l2tp-0.4-4/handlers/cmd-control.c 2005-03-09 16:26:49.000000000 +0100 +@@ -52,7 +52,7 @@ + + memset(&addr, 0, sizeof(addr)); + addr.sun_family = AF_LOCAL; +- strncpy(addr.sun_path, "/var/run/l2tpctrl", sizeof(addr.sun_path) - 1); ++ strncpy(addr.sun_path, "/var/run/l2tp.sock", sizeof(addr.sun_path) - 1); + + fd = socket(AF_LOCAL, SOCK_STREAM, 0); + if (fd < 0) { +diff -ruN rp-l2tp-0.4-orig/handlers/cmd.c rp-l2tp-0.4-4/handlers/cmd.c +--- rp-l2tp-0.4-orig/handlers/cmd.c 2004-07-01 16:58:56.000000000 +0200 ++++ rp-l2tp-0.4-4/handlers/cmd.c 2005-03-09 16:26:49.000000000 +0100 +@@ -162,7 +162,7 @@ + + /* We have hit the end of our options. Open command socket */ + if (!sockname) { +- sockname = "/var/run/l2tpctrl"; ++ sockname = "/var/run/l2tp.sock"; + } + + (void) remove(sockname); +diff -ruN rp-l2tp-0.4-orig/libevent/Makefile.in rp-l2tp-0.4-4/libevent/Makefile.in +--- rp-l2tp-0.4-orig/libevent/Makefile.in 2002-09-30 21:45:00.000000000 +0200 ++++ rp-l2tp-0.4-4/libevent/Makefile.in 2005-03-09 16:26:49.000000000 +0100 +@@ -18,24 +18,27 @@ + + libevent.a: $(OBJS) + rm -f libevent.a +- ar -cq libevent.a $(OBJS) ++ $(AR) r libevent.a $(OBJS) + @RANLIB@ libevent.a + + event.o: event.c $(HDRS) +- gcc $(CFLAGS) -c -o event.o event.c ++ $(CC) $(CFLAGS) -c -o event.o event.c + + hash.o: hash.c $(HDRS) +- gcc $(CFLAGS) -c -o hash.o hash.c ++ $(CC) $(CFLAGS) -c -o hash.o hash.c + + event_sig.o: event_sig.c $(HDRS) +- gcc $(CFLAGS) -c -o event_sig.o event_sig.c ++ $(CC) $(CFLAGS) -c -o event_sig.o event_sig.c + + event_tcp.o: event_tcp.c $(HDRS) +- gcc $(CFLAGS) -c -o event_tcp.o event_tcp.c ++ $(CC) $(CFLAGS) -c -o event_tcp.o event_tcp.c + + clean: FORCE + rm -f *.a *.o *~ + ++distclean: clean ++ rm -f Makefile ++ + FORCE: + +-.phony: FORCE +\ No newline at end of file ++.phony: FORCE +diff -ruN rp-l2tp-0.4-orig/main.c rp-l2tp-0.4-4/main.c +--- rp-l2tp-0.4-orig/main.c 2002-09-30 21:45:00.000000000 +0200 ++++ rp-l2tp-0.4-4/main.c 2005-03-09 16:26:49.000000000 +0100 +@@ -68,7 +68,7 @@ + l2tp_peer_init(); + l2tp_debug_set_bitmask(debugmask); + +- if (l2tp_parse_config_file(es, "/etc/l2tp/l2tp.conf") < 0) { ++ if (l2tp_parse_config_file(es, "/etc/l2tp.conf") < 0) { + l2tp_die(); + } + +diff -ruN rp-l2tp-0.4-orig/man/l2tp.conf.5 rp-l2tp-0.4-4/man/l2tp.conf.5 +--- rp-l2tp-0.4-orig/man/l2tp.conf.5 2004-07-01 16:58:56.000000000 +0200 ++++ rp-l2tp-0.4-4/man/l2tp.conf.5 2005-03-09 16:26:49.000000000 +0100 +@@ -155,7 +155,7 @@ + in the global section. The only option available is: + .IP "\fBsocket-path\fP \fIpathname\fR" + Specifies the path name of the UNIX-domain socket for controlling the +-daemon. Defaults to \fI/var/run/l2tpctrl\fR. ++daemon. Defaults to \fI/var/run/l2tp.sock\fR. + .PP + Even if you do not supply any options to cmd, you \fImust\fR have + a \fBsection cmd\fR line to activate the handler. +diff -ruN rp-l2tp-0.4-orig/man/l2tpd.8 rp-l2tp-0.4-4/man/l2tpd.8 +--- rp-l2tp-0.4-orig/man/l2tpd.8 2002-09-30 21:45:00.000000000 +0200 ++++ rp-l2tp-0.4-4/man/l2tpd.8 2005-03-09 16:26:49.000000000 +0100 +@@ -47,17 +47,17 @@ + fairly lightweight and efficient. + + .SH L2TPD CONFIGURATION +-On startup, \fBl2tpd\fR reads the configuration file \fB/etc/l2tp/l2tp.conf\fR. ++On startup, \fBl2tpd\fR reads the configuration file \fB/etc/l2tp.conf\fR. + This configuration file sets operating parameters, describes peers and loads + and configures handlers. See \fBl2tp.conf\fR(5) for configuration + file details. + + .SH FILES + .TP +-.B /etc/l2tp/l2tp.conf ++.B /etc/l2tp.conf + Main configuration file. + .TP +-.B /var/run/l2tpctrl ++.B /var/run/l2tp.sock + Control socket for \fBcmd.so\fR handler. + + .SH AUTHORS +diff -ruN rp-l2tp-0.4-orig/utils.c rp-l2tp-0.4-4/utils.c +--- rp-l2tp-0.4-orig/utils.c 2002-09-30 21:45:00.000000000 +0200 ++++ rp-l2tp-0.4-4/utils.c 2005-03-09 16:26:49.000000000 +0100 +@@ -182,7 +182,7 @@ + * -1 on error, 0 if OK + * %DESCRIPTION: + * Dynamically-loads a handler and initializes it. If fname is not +-* an absolute path name, we load the handler from /usr/lib/l2tp/plugins ++* an absolute path name, we load the handler from /usr/lib/l2tp + ***********************************************************************/ + int + l2tp_load_handler(EventSelector *es, +@@ -196,7 +196,7 @@ + if (*fname == '/') { + handle = dlopen(fname, RTLD_NOW); + } else { +- snprintf(buf, sizeof(buf), "%s/lib/l2tp/plugins/%s", PREFIX, fname); ++ snprintf(buf, sizeof(buf), "%s/lib/l2tp/%s", PREFIX, fname); + buf[sizeof(buf)-1] = 0; + handle = dlopen(buf, RTLD_NOW); + }