From e1da03cf5ba92abee0e3afd9dc4cef438ebf96c7 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 12 May 2012 00:02:41 +0000 Subject: Sat May 12 00:02:41 UTC 2012 --- community/ipset/PKGBUILD | 33 ++++++++++++++++++++++++++++----- community/ipset/ipset.conf | 3 +++ community/ipset/ipset.rc | 39 +++++++++++++++++++++++++++++++++++++++ community/ipset/ipset.service | 12 ++++++++++++ community/ipset/ipset.systemd | 8 ++++++++ 5 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 community/ipset/ipset.conf create mode 100644 community/ipset/ipset.rc create mode 100644 community/ipset/ipset.service create mode 100644 community/ipset/ipset.systemd (limited to 'community/ipset') 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 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: -- cgit v1.2.3-54-g00ecf