summaryrefslogtreecommitdiff
path: root/community/ipset
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-05-12 00:02:41 +0000
committerroot <root@rshg054.dnsready.net>2012-05-12 00:02:41 +0000
commite1da03cf5ba92abee0e3afd9dc4cef438ebf96c7 (patch)
tree233b060ecee707d77b6c0d3d91de90eb4beed13e /community/ipset
parent2ced64d6aa5881fa575de1861c464c432deee26f (diff)
Sat May 12 00:02:41 UTC 2012
Diffstat (limited to 'community/ipset')
-rw-r--r--community/ipset/PKGBUILD33
-rw-r--r--community/ipset/ipset.conf3
-rw-r--r--community/ipset/ipset.rc39
-rw-r--r--community/ipset/ipset.service12
-rw-r--r--community/ipset/ipset.systemd8
5 files changed, 90 insertions, 5 deletions
diff --git a/community/ipset/PKGBUILD b/community/ipset/PKGBUILD
index ac95e6229..d0c6fa250 100644
--- a/community/ipset/PKGBUILD
+++ b/community/ipset/PKGBUILD
@@ -1,17 +1,26 @@
-# $Id: PKGBUILD 62118 2012-01-16 09:00:54Z seblu $
+# $Id: PKGBUILD 70535 2012-05-10 18:29:26Z seblu $
# Maintainer: Sébastien Luttringer <seblu@aur.archlinux.org>
pkgname=ipset
-pkgver=6.11
+pkgver=6.12
pkgrel=1
pkgdesc='Administration tool for IP sets'
arch=('i686' 'x86_64')
url='http://ipset.netfilter.org'
license=('GPL2')
depends=('libmnl')
-makedepends=('linux-headers')
-source=("http://ipset.netfilter.org/$pkgname-$pkgver.tar.bz2")
-md5sums=('bfcc92e30a0fcf10ae6e7c4affa03c84')
+backup=('etc/ipset.conf' "etc/conf.d/$pkgname")
+options=('!libtool')
+source=("http://ipset.netfilter.org/$pkgname-$pkgver.tar.bz2"
+ "$pkgname.conf"
+ "$pkgname.rc"
+ "$pkgname.systemd"
+ "$pkgname.service")
+md5sums=('ad59bc6da6778aa7c6515d0ed6147440'
+ '61963bda45c002fb37977e58bb5b829c'
+ '888bf1eadffcc076b9e97de02e2147c8'
+ 'c5f38e5f3027066c1491a563e734796e'
+ 'b9ff3bd7b959cb1b97b8c492b52b8377')
build() {
cd $pkgname-$pkgver
@@ -22,6 +31,20 @@ build() {
package() {
cd $pkgname-$pkgver
make DESTDIR="$pkgdir" install
+ # install doc
+ install -dm755 "$pkgdir/usr/share/doc/$pkgname"
+ install -m644 README UPGRADE ChangeLog "$pkgdir/usr/share/doc/$pkgname"
+ # install initscripts
+ cd ..
+ install -Dm 755 $pkgname.rc "$pkgdir/etc/rc.d/$pkgname"
+ install -Dm 644 $pkgname.conf "$pkgdir/etc/conf.d/$pkgname"
+ # install systemd service
+ install -Dm 755 $pkgname.systemd \
+ "$pkgdir/usr/lib/systemd/scripts/$pkgname"
+ install -Dm 644 $pkgname.service \
+ "$pkgdir/usr/lib/systemd/system/$pkgname.service"
+ # default config file
+ install -Dm 644 /dev/null "$pkgdir/etc/$pkgname.conf"
}
# vim:set ts=2 sw=2 ft=sh et:
diff --git a/community/ipset/ipset.conf b/community/ipset/ipset.conf
new file mode 100644
index 000000000..686931f4c
--- /dev/null
+++ b/community/ipset/ipset.conf
@@ -0,0 +1,3 @@
+# vim:set ts=2 sw=2 ft=sh et:
+
+IPSET_CONF='/etc/ipset.conf'
diff --git a/community/ipset/ipset.rc b/community/ipset/ipset.rc
new file mode 100644
index 000000000..1d5f7df8b
--- /dev/null
+++ b/community/ipset/ipset.rc
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/ipset
+
+case "$1" in
+ start)
+ stat_busy 'Loading IP Sets'
+ if [[ -f $IPSET_CONF ]] && ipset restore < "$IPSET_CONF"; then
+ add_daemon ipset
+ stat_done
+ else
+ stat_fail
+ fi
+ ;;
+ stop)
+ status 'Clearing IP Sets' ipset destroy
+ rm_daemon ipset
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ save)
+ stat_busy 'Saving IP Sets'
+ if ipset save > "$IPSET_CONF" 2>/dev/null; then
+ stat_done
+ else
+ stat_fail
+ fi
+ ;;
+ *)
+ echo "usage: ${0##*/} {start|stop|restart|save}"
+esac
+exit 0
+
+# vim:set ts=2 sw=2 ft=sh et:
diff --git a/community/ipset/ipset.service b/community/ipset/ipset.service
new file mode 100644
index 000000000..0e0dd4ff7
--- /dev/null
+++ b/community/ipset/ipset.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=IP Sets
+
+[Service]
+Type=oneshot
+ExecStart=/usr/lib/systemd/scripts/ipset start
+ExecStop=/usr/sbin/ipset destroy
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
+Before=iptables.service
diff --git a/community/ipset/ipset.systemd b/community/ipset/ipset.systemd
new file mode 100644
index 000000000..36df5124a
--- /dev/null
+++ b/community/ipset/ipset.systemd
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+. /etc/conf.d/ipset
+
+[[ -f $IPSET_CONF ]] || exit 1
+ipset restore < "$IPSET_CONF"
+
+# vim:set ts=2 sw=2 ft=sh et: