summaryrefslogtreecommitdiff
path: root/community/xl2tpd
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/xl2tpd
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/xl2tpd')
-rw-r--r--community/xl2tpd/PKGBUILD43
-rw-r--r--community/xl2tpd/as-needed.patch12
-rw-r--r--community/xl2tpd/ipparam.patch36
-rw-r--r--community/xl2tpd/options.l2tpd24
-rw-r--r--community/xl2tpd/xl2tpd.conf.client-example19
-rw-r--r--community/xl2tpd/xl2tpd.conf.server-example21
-rwxr-xr-xcommunity/xl2tpd/xl2tpd.rc39
7 files changed, 194 insertions, 0 deletions
diff --git a/community/xl2tpd/PKGBUILD b/community/xl2tpd/PKGBUILD
new file mode 100644
index 000000000..ab66948f0
--- /dev/null
+++ b/community/xl2tpd/PKGBUILD
@@ -0,0 +1,43 @@
+# $Id: PKGBUILD 44028 2011-04-01 16:50:43Z spupykin $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Contributor: Hengfu <rhfcaesar@gmail.com>
+
+pkgname=xl2tpd
+pkgver=1.2.8
+pkgrel=2
+pkgdesc="an open source implementation of the L2TP maintained by Xelerance Corporation"
+arch=('i686' 'x86_64')
+url="http://www.xelerance.com"
+license=('GPL')
+depends=('ppp')
+options=(emptydirs zipman docs)
+backup=(etc/ppp/options.l2tpd)
+source=(ftp://ftp.xelerance.com/$pkgname/$pkgname-$pkgver.tar.gz
+ xl2tpd.rc
+ xl2tpd.conf.client-example
+ xl2tpd.conf.server-example
+ options.l2tpd
+ as-needed.patch
+ ipparam.patch)
+md5sums=('8748ac5e2f5289963d9a908eede546b5'
+ '1439d13084fc09c2a19c97b24a834345'
+ '5f0ae07026e61a3dd15a76fd4144a6d5'
+ '16ed0886115d4dcc21072cfb847250bb'
+ 'ed57eb67335cdf246251285dad502cc7'
+ '867ec7085f61ae129748325a08561776'
+ '4d258a58cc109d5c4d96af8f81d481cf')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+# patch -p0 <$srcdir/as-needed.patch
+ patch -p1 <$srcdir/ipparam.patch
+
+ make KERNELSRC=/usr/src/linux-`uname -r` PREFIX=/usr
+ make KERNELSRC=/usr/src/linux-`uname -r` PREFIX=/usr DESTDIR=$pkgdir install
+
+ install -D -m0755 $srcdir/xl2tpd.rc $pkgdir/etc/rc.d/xl2tpd
+ install -D -m0644 $srcdir/xl2tpd.conf.client-example $pkgdir/etc/xl2tpd/xl2tpd.conf.client-example
+ install -D -m0644 $srcdir/xl2tpd.conf.server-example $pkgdir/etc/xl2tpd/xl2tpd.conf.server-example
+ install -D -m0644 $srcdir/options.l2tpd $pkgdir/etc/ppp/options.l2tpd
+}
diff --git a/community/xl2tpd/as-needed.patch b/community/xl2tpd/as-needed.patch
new file mode 100644
index 000000000..8976d298f
--- /dev/null
+++ b/community/xl2tpd/as-needed.patch
@@ -0,0 +1,12 @@
+--- ./Makefile_orig 2010-10-08 15:28:50.310000058 +0400
++++ ./Makefile 2010-10-08 15:29:57.666666723 +0400
+@@ -113,8 +113,7 @@
+
+ pfc:
+ $(CC) $(CFLAGS) -c contrib/pfc.c
+- $(CC) $(LDFLAGS) -lpcap $(LDLIBS) -o pfc pfc.o
+-
++ $(CC) $(LDFLAGS) -o pfc pfc.o -lpcap $(LDLIBS)
+ romfs:
+ $(ROMFSINST) /bin/$(EXEC)
+
diff --git a/community/xl2tpd/ipparam.patch b/community/xl2tpd/ipparam.patch
new file mode 100644
index 000000000..9c2fd8400
--- /dev/null
+++ b/community/xl2tpd/ipparam.patch
@@ -0,0 +1,36 @@
+diff -wbBur xl2tpd-1.2.8/control.c xl2tpd-1.2.8.my/control.c
+--- xl2tpd-1.2.8/control.c 2011-02-23 08:10:21.000000000 +0300
++++ xl2tpd-1.2.8.my/control.c 2011-03-25 21:29:29.896518014 +0300
+@@ -892,8 +892,8 @@
+ po = add_opt (po, c->lac->pppoptfile);
+ }
+ };
+- po = add_opt (po, "ipparam");
+- po = add_opt (po, IPADDY (t->peer.sin_addr));
++// po = add_opt (po, "ipparam");
++// po = add_opt (po, IPADDY (t->peer.sin_addr));
+ start_pppd (c, po);
+ opt_destroy (po);
+ if (c->lac)
+@@ -966,8 +966,8 @@
+ po = add_opt (po, "file");
+ po = add_opt (po, c->lns->pppoptfile);
+ }
+- po = add_opt (po, "ipparam");
+- po = add_opt (po, IPADDY (t->peer.sin_addr));
++// po = add_opt (po, "ipparam");
++// po = add_opt (po, IPADDY (t->peer.sin_addr));
+ start_pppd (c, po);
+ opt_destroy (po);
+ l2tp_log (LOG_NOTICE,
+@@ -1026,8 +1026,8 @@
+ po = add_opt (po, c->lac->pppoptfile);
+ }
+ };
+- po = add_opt (po, "ipparam");
+- po = add_opt (po, IPADDY (t->peer.sin_addr));
++// po = add_opt (po, "ipparam");
++// po = add_opt (po, IPADDY (t->peer.sin_addr));
+ start_pppd (c, po);
+
+ /* jz: just show some information */
diff --git a/community/xl2tpd/options.l2tpd b/community/xl2tpd/options.l2tpd
new file mode 100644
index 000000000..3030af4a7
--- /dev/null
+++ b/community/xl2tpd/options.l2tpd
@@ -0,0 +1,24 @@
+login
+lcp-echo-interval 10
+lcp-echo-failure 2
+noipx
+
+refuse-pap
+refuse-chap
+refuse-mschap
+
+require-mppe
+require-mschap-v2
+
+nodefaultroute
+proxyarp
+
+#bsdcomp
+#deflate
+#accomp
+#noccp
+#nopcomp
+#nopredictor1
+#novj
+#novjccomp
+#debug 7
diff --git a/community/xl2tpd/xl2tpd.conf.client-example b/community/xl2tpd/xl2tpd.conf.client-example
new file mode 100644
index 000000000..7420f940d
--- /dev/null
+++ b/community/xl2tpd/xl2tpd.conf.client-example
@@ -0,0 +1,19 @@
+[global]
+access control = no
+auth file = /etc/ppp/chap-secrets
+debug avp = no
+debug network = no
+debug packet = no
+debug state = no
+debug tunnel = no
+
+[lac <name>]
+lns = <host>
+redial = yes
+redial timeout = 5
+require chap = yes
+require authentication = no
+ppp debug = no
+pppoptfile = /etc/ppp/peers/<ppp-opts>
+require pap = no
+autodial = yes
diff --git a/community/xl2tpd/xl2tpd.conf.server-example b/community/xl2tpd/xl2tpd.conf.server-example
new file mode 100644
index 000000000..a967a3d5f
--- /dev/null
+++ b/community/xl2tpd/xl2tpd.conf.server-example
@@ -0,0 +1,21 @@
+[global]
+access control = yes
+auth file = /etc/ppp/chap-secrets
+debug avp = no
+debug network = no
+debug packet = no
+debug state = no
+debug tunnel = no
+
+[lns <name>]
+require chap = yes
+ppp debug = no
+pppoptfile = /etc/ppp/options.l2tpd
+require pap = no
+assign ip = yes
+hostname = <hostname>
+ip range = <range>
+local ip = <ip>
+challenge = no
+lac = <lacs>
+require authentication = no
diff --git a/community/xl2tpd/xl2tpd.rc b/community/xl2tpd/xl2tpd.rc
new file mode 100755
index 000000000..a06e0d41e
--- /dev/null
+++ b/community/xl2tpd/xl2tpd.rc
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# general config
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ [ -d /var/run/xl2tpd ] || mkdir -p /var/run/xl2tpd
+ stat_busy "Starting xl2tpd"
+ /usr/sbin/xl2tpd
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon xl2tpd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping xl2tpd"
+ [ -f /var/run/xl2tpd.pid ] && kill `cat /var/run/xl2tpd.pid`
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm -f /var/run/xl2tpd.pid
+ rm_daemon xl2tpd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+ ;;
+esac
+exit 0