diff options
Diffstat (limited to 'main/ipset')
-rw-r--r-- | main/ipset/APKBUILD | 43 | ||||
-rw-r--r-- | main/ipset/ipset.initd | 24 |
2 files changed, 67 insertions, 0 deletions
diff --git a/main/ipset/APKBUILD b/main/ipset/APKBUILD new file mode 100644 index 0000000000..e8b88ef82e --- /dev/null +++ b/main/ipset/APKBUILD @@ -0,0 +1,43 @@ +# Contributor: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> +# Maintainer: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> +pkgname=ipset +pkgver=6.11 +pkgrel=1 +pkgdesc="Manage Linux IP sets" +url=http://ipset.netfilter.org/ +arch=all +license=GPL-2 +depends_dev=libmnl-dev +makedepends="$depends_dev automake autoconf pkgconfig libtool linux-headers" +subpackages="$pkgname-dev $pkgname-doc" +source="${url}ipset-$pkgver.tar.bz2 ipset.initd" + +_builddir=$srcdir/ipset-$pkgver + +prepare() { + local i + cd "$_builddir" + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done +} + +build() { + cd "$_builddir" + ./configure --with-kmod=no --prefix=/usr && make +} + +package() { + cd "$_builddir" + make install DESTDIR=$pkgdir || return + rm $pkgdir/usr/lib/*.la + + mkdir -p "$pkgdir/etc/init.d" \ + "$pkgdir/etc/ipset.d" + install -m 755 "$startdir/ipset.initd" "$pkgdir/etc/init.d/ipset" +} + +md5sums="bfcc92e30a0fcf10ae6e7c4affa03c84 ipset-6.11.tar.bz2 +9f2e07dc13cafe456aa9d70fb631f175 ipset.initd" diff --git a/main/ipset/ipset.initd b/main/ipset/ipset.initd new file mode 100644 index 0000000000..6e3294c8e0 --- /dev/null +++ b/main/ipset/ipset.initd @@ -0,0 +1,24 @@ +#!/sbin/runscript +# Init script for ipset +# Copyright (C) 2012 Kaarle Ritvanen +# Licensed under the terms of the GPL2 + +depend() { + before iptables ip6tables +} + +start() { + if ls /etc/ipset.d/* &> /dev/null; then + ebegin "Loading firewall IP sets" + for f in /etc/ipset.d/*; do + /usr/sbin/ipset restore < $f + done + eend $? + fi +} + +stop() { + ebegin "Flushing firewall IP sets" + /usr/sbin/ipset destroy + eend $? +} |