1 # Maintainer: Florian Léger <florian6 dot leger at laposte dot net>
2 # Based on the wifidog-gateway package
3 pkgname=wifidog-gateway-svn
7 pkgdesc="A complete and embeddable captive portal solution for operating an open hotspot or network of hotspots while preventing abuse of their Internet connection."
9 url="http://dev.wifidog.org"
12 makedepends=(subversion)
14 optdepends=('iproute2: for bandwidth throttling')
15 install="$pkgname.install"
16 backup=("etc/${_PKGNAME}/${_PKGNAME}.conf")
18 conflicts=(wifidog-gateway)
19 provides=(wifidog-gateway)
20 md5sums=('2e355a6d063601a3bf21a733bdac3bcb')
22 _svntrunk=https://dev.wifidog.org/svn/trunk/${_PKGNAME}
28 if [ -d $_svnmod/.svn ]; then
29 (cd $_svnmod && svn up -r $pkgver)
31 svn co $_svntrunk -r $pkgver $_svnmod
34 msg "SVN checkout done or server timeout"
35 msg "Starting make..."
37 rm -rf "$srcdir/$_svnmod-build"
38 cp -r "$srcdir/$_svnmod" "$srcdir/$_svnmod-build"
39 cd "$srcdir/$_svnmod-build"
44 ./autogen.sh || return 1
45 ./configure --prefix=/usr \
46 --sysconfdir=/etc/${_PKGNAME} \
47 --mandir=/usr/share/man || return 1
52 cd "$srcdir/$_svnmod-build"
53 make DESTDIR="$pkgdir/" install || return 1
55 # Copy some extra files over to the package that 'make install' doesn't do
56 install -Dm755 "${srcdir}/rc.${_PKGNAME}" "${pkgdir}/etc/rc.d/${_PKGNAME}"
57 install -Dm644 "${srcdir}/$_svnmod-build/${_PKGNAME}.conf" "${pkgdir}/etc/${_PKGNAME}/${_PKGNAME}.conf"
58 install -Dm644 "${srcdir}/$_svnmod-build/wifidog-msg.html" "${pkgdir}/etc/${_PKGNAME}/wifidog-msg.html"
60 # Change the default conf to block port 25 by default. Opening port 25
61 # to a public network is fscking stupid and open to abuse so we'll default
62 # it here. Call it our small contribution to spam prevention.
63 sed -i 's/#FirewallRule\ block\ tcp\ port\ 25/FirewallRule\ block\ tcp\ port\ 25/g' "${pkgdir}/etc/${_PKGNAME}/${_PKGNAME}.conf"
65 # Change the default "LAN" interface in the config file
66 sed -i 's/^GatewayInterface\ br0$/GatewayInterface\ eth1/g' "${pkgdir}/etc/${_PKGNAME}/${_PKGNAME}.conf"