diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2016-12-07 01:12:31 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2016-12-07 01:12:31 +0100 |
commit | 3ea07b619d142914eea67714603e93a32768dd77 (patch) | |
tree | 6eacd604afd43cd2cc42cdbd09ec44da72ff9bd3 | |
parent | acadd90e7d866f88acdf92af0365171bfb2fee6e (diff) | |
download | aports-3ea07b619d142914eea67714603e93a32768dd77.tar.bz2 aports-3ea07b619d142914eea67714603e93a32768dd77.tar.xz |
community/fwsnort: fix abuild
-rw-r--r-- | community/fwsnort/APKBUILD | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/community/fwsnort/APKBUILD b/community/fwsnort/APKBUILD index 187aaa8fae..8862700c9f 100644 --- a/community/fwsnort/APKBUILD +++ b/community/fwsnort/APKBUILD @@ -10,26 +10,25 @@ license="GPL" depends="perl perl-netaddr-ip perl-iptables-parse iptables ip6tables net-tools wget" install="$pkgname.post-install" source="http://www.cipherdyne.org/$pkgname/download/$pkgname-nodeps-$pkgver.tar.gz - fwsnort.up - fwsnort.update - periodic.daily - " -builddir="$srcdir"/$pkgname-$pkgver + fwsnort.up + fwsnort.update + periodic.daily" +builddir="$srcdir/$pkgname-$pkgver" build() { cd "$builddir" - #Disable Root requirement to build - START=$(sed -n '/die "You need to be root (or equivalent UID 0"/=' ./install.pl) - END=$(expr $START + 1) - #Busybox sed does not support +1d - sed -e ''$START','$END'd' ./install.pl -i + # Disable Root requirement to build. + local start=$(sed -n '/die "You need to be root (or equivalent UID 0"/=' ./install.pl) + local end=$(expr $start + 1) + # Busybox sed does not support +1d. + sed -e ''$START','$END'd' ./install.pl -i - #prevent chmod 0500 halting the build - sed -e "s|0500|0755|" ./install.pl -i + # Prevent chmod 0500 halting the build. + sed "s|0500|0755|" ./install.pl -i - #change MAN path so package builds - sed -e "s|/usr/share/man/man8|$pkgdir&|" ./install.pl -i + # Change MAN path so package builds. + sed "s|/usr/share/man/man8|$pkgdir&|" ./install.pl -i # --install-test-dir sets the INSTALL_ROOT to $src/../test/fwsnort-test # avoids installation attempted into /etc /usr /var @@ -38,25 +37,31 @@ build() { } package() { - cd "$_builddir" - mkdir -p $pkgdir/etc \ - $pkgdir/usr \ - $pkgdir/usr - cp -rf $srcdir/fwsnort-$pkgver/test/fwsnort-install/* $pkgdir + cd "$builddir" + + mkdir -p "$pkgdir"/etc "$pkgdir"/usr + cp -rf "$srcdir"/fwsnort-$pkgver/test/fwsnort-install/* "$pkgdir"/ || return 1 + + # Delete references to $pkgdir made by the installer. + cp -f "$srcdir"/fwsnort-$pkgver/fwsnort.conf \ + "$pkgdir"/etc/fwsnort/fwsnort.conf || return 1 + + # Fix permissions. + chmod 0500 "$pkgdir"/etc/fwsnort "$pkgdir"/etc/fwsnort/snort_rules || return 1 + chmod 0500 "$pkgdir"/usr/sbin/fwsnort || return 1 + chmod 0600 "$pkgdir"/etc/fwsnort/fwsnort.conf || return 1 + + # Install rule / signature update script. + install -Dm755 "$srcdir"/fwsnort.update \ + "$pkgdir"/usr/bin/update-fwsnort || return 1 - # delete references to $pkgdir made by the installer - cp -f $srcdir/fwsnort-$pkgver/fwsnort.conf $pkgdir/etc/fwsnort/fwsnort.conf - #fix permissions - chmod 0500 $pkgdir/etc/fwsnort $pkgdir/etc/fwsnort/snort_rules - chmod 0500 $pkgdir/usr/sbin/fwsnort - chmod 0600 $pkgdir/etc/fwsnort/fwsnort.conf + # Install iptables rule splicing script. + install -Dm755 "$srcdir"/fwsnort.up \ + "$pkgdir"/etc/network/if-pre-up.d/fwsnort || return 1 - # install rule / signature update script - install -Dm755 "$srcdir"/fwsnort.update "$pkgdir"/usr/bin/update-fwsnort - # install iptables rule splicing script - install -Dm755 "$srcdir"/fwsnort.up "$pkgdir"/etc/network/if-pre-up.d/fwsnort - # install daily cron - install -Dm755 "$srcdir"/periodic.daily "$pkgdir"/etc/periodic/daily/fwsnort + # Install daily cron. + install -Dm755 "$srcdir"/periodic.daily \ + "$pkgdir"/etc/periodic/daily/fwsnort } md5sums="7c34730c93c6ef42f79c478538c499e9 fwsnort-nodeps-1.6.6.tar.gz |