1 # Contributor: Vadym Abramchuk <abramm@gmail.com>
2 pkgname=lisg-webauth-hg
7 url="http://bitbucket.org/sysoleg/lisg/"
10 depends=('perl-net-radius' 'perl-net-ipaddress' 'iptables' 'iproute2' 'ipset')
11 makedepends=('mercurial' 'kernel26-headers')
15 backup=(usr/local/ISG/etc/config.pl)
18 source=(http://dl.dropbox.com/u/12495607/web_auth_v7.patch lisg.install lisg.rules)
20 md5sums=('907e780902180810df7f18f61fd758ea'
21 '9e5a55e4d1465e5ed53b65b9ecf9f986'
22 '29782e38a66f1fdaabdf2a61ed9da98f')
24 _hgroot="http://bitbucket.org/sysoleg"
29 msg "Connecting to Mercurial server...."
31 if [ -d $_hgrepo ] ; then
33 hg pull -u || return 1
34 msg "The local files are updated."
36 hg clone $_hgroot $_hgrepo || return 1
39 msg "Mercurial checkout done or server timeout"
41 msg "Getting iptables source"
43 iptver=`iptables -V | sed -n s/iptables.v//p`
44 wget http://www.iptables.org/projects/iptables/files/iptables-${iptver}.tar.bz2
45 tar xvfj iptables-${iptver}.tar.bz2
48 msg "Configuring iptables..."
50 ./configure > /dev/null
53 msg "Starting make..."
55 rm -rf "$srcdir/$_hgrepo-build"
56 cp -r "$srcdir/$_hgrepo" "$srcdir/$_hgrepo-build"
57 cd "$srcdir/$_hgrepo-build"
59 patch -p1 < $srcdir/web_auth_v7.patch
62 ./configure --ipt-src=${iptsrc}
64 # make DESTDIR="$pkgdir/" install || return 1
65 make kinstall INSTALL_MOD_PATH=$pkgdir/
66 install -D -m 644 libipt_ISG.so $pkgdir/usr/lib/iptables/libipt_ISG.so
67 mkdir -p $pkgdir/usr/local
68 cp -r $srcdir/$_hgrepo-build/ISG $pkgdir/usr/local/
69 install -D -m 755 $srcdir/$_hgrepo-build/ISG/contrib/rc.ISGd $pkgdir/etc/rc.d/lisg
70 install -D -m 644 $srcdir/lisg.rules $pkgdir/etc/iptables/lisg.rules