aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStuart Cardall <developer@it-offshore.co.uk>2018-08-30 18:32:38 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-09-04 10:32:48 +0000
commita6caef63909ff1fc535a9c3a236cd50ba0e612b1 (patch)
tree45c5426dcf57a84b0cc3471d4f2eca6674a70c91
parentd8592b9b65622a5d32ed53b843843dc82751b1ff (diff)
downloadaports-a6caef63909ff1fc535a9c3a236cd50ba0e612b1.tar.gz
aports-a6caef63909ff1fc535a9c3a236cd50ba0e612b1.tar.bz2
aports-a6caef63909ff1fc535a9c3a236cd50ba0e612b1.tar.xz
community/psad: use patches not sed in APKBUILD
* fixes https://github.com/alpinelinux/aports/pull/4964#pullrequestreview-151034227
-rw-r--r--community/psad/01-disable-init-install.patch22
-rw-r--r--community/psad/02-travis-build.patch11
-rw-r--r--community/psad/APKBUILD20
3 files changed, 41 insertions, 12 deletions
diff --git a/community/psad/01-disable-init-install.patch b/community/psad/01-disable-init-install.patch
new file mode 100644
index 0000000000..8942ef92c7
--- /dev/null
+++ b/community/psad/01-disable-init-install.patch
@@ -0,0 +1,22 @@
+--- psad-2.4.6/install.pl
++++ psad-2.4.6/install.new
+@@ -780,19 +780,6 @@
+ }
+ }
+
+- if ($init_dir and &is_root()) {
+- &logr("[+] Copying $init_file -> ${init_dir}/$init_name\n");
+- copy $init_file, "${init_dir}/$init_name" or die "[*] Could not copy ",
+- "$init_file -> ${init_dir}/$init_name: $!";
+- if ($is_systemd) {
+- &perms_ownership("${init_dir}/$init_name", 0644);
+- } else {
+- &perms_ownership("${init_dir}/$init_name", 0744);
+- }
+- &enable_psad_at_boot($distro);
+- $installed_init_script = 1;
+- }
+-
+ &logr("\n========================================================\n");
+ if ($archived_old) {
+ &logr("[+] Copies of your original configs have been made " .
diff --git a/community/psad/02-travis-build.patch b/community/psad/02-travis-build.patch
new file mode 100644
index 0000000000..a643a43e1a
--- /dev/null
+++ b/community/psad/02-travis-build.patch
@@ -0,0 +1,11 @@
+--- psad-2.4.6/install.pl
++++ psad-2.4.6/install.new
+@@ -247,7 +247,7 @@
+ my $distro = &get_distro();
+
+ ### handle systems with systemd
+-my $is_systemd = &look_for_process(qr|/systemd|);
++my $is_systemd = 0;
+
+ if ($is_systemd) {
+ $init_dir = $systemd_init_dir;
diff --git a/community/psad/APKBUILD b/community/psad/APKBUILD
index 6caaa829ff..f3047102af 100644
--- a/community/psad/APKBUILD
+++ b/community/psad/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=psad
pkgver=2.4.6
-pkgrel=0
+pkgrel=1
pkgdesc="3 lightweight system daemons that analyze iptables log messages to detect port scans and other suspicious traffic"
url="http://cipherdyne.org/psad/"
arch="all"
@@ -14,7 +14,10 @@ depends="perl iptables ip6tables ssmtp mailx psmisc perl-bit-vector
subpackages="$pkgname-doc $pkgname-openrc"
source="http://cipherdyne.org/psad/download/$pkgname-nodeps-$pkgver.tar.gz
psad.initd
- psad.confd"
+ psad.confd
+ 01-disable-init-install.patch
+ 02-travis-build.patch
+ "
builddir="$srcdir/$pkgname-$pkgver"
build() {
@@ -41,15 +44,6 @@ build() {
# Set mail command to mailx.
sed -e 's|/bin/mail;|/usr/bin/mail;|g' -i ./psad.conf
- # Disable install of generic init script & setting numeric run level.
- local start=$(sed -n '/if ($init_dir and &is_root()) {/=' ./install.pl)
- local end=$(expr $start + 11)
- # Busybox sed does not support +11d.
- sed ''$start','$end'd' ./install.pl -i
-
- # fix for building on Travis
- sed -i "s|^my \$is_systemd =.*|my \$is_systemd = 0;|" ./install.pl
-
# Populate install.answers so build does not wait for them.
cat >./install.answers <<-EOF
Would you like to merge the config from the existing psad installation: y;
@@ -109,4 +103,6 @@ package() {
sha512sums="95ddd18da2b9c6703b0d156873622740517cad62fda8d69ddb0686c43c4e306155dd646965cd52081dbd0d6c235bd3c794f6b004e3ee3bfa3e6150eb5f617c56 psad-nodeps-2.4.6.tar.gz
ec709b1ba1df36dad5c1c2cfb5fc45765ac4ccdd6fc7a3e2f23c972c7dfb8e5910aeb1ba42437abd0d2c766bb99bcb790301c7b8ba3ee7e6593dcae13e9efc3a psad.initd
-a80666f59356cc6157a9f5dca132991d4f1e0afda8f673d602de2557219d5521bec9ae148330e98d9483175d14d96e4cc2ccd11541d8b187b0e47f44ba4ada54 psad.confd"
+a80666f59356cc6157a9f5dca132991d4f1e0afda8f673d602de2557219d5521bec9ae148330e98d9483175d14d96e4cc2ccd11541d8b187b0e47f44ba4ada54 psad.confd
+6ecbb376e5eae2b68fb1e3d65d3a105cac698abd4f65b9e3892efa2aba30b68445aa17ff31f2799d36f6a7e5bc1ba2566f12c9b7ab2864dc210ead1a3f974412 01-disable-init-install.patch
+6117125b7efe9557be1f6af9ce786100e1c81968a2b28878f8a63058a4349e9430ae2dc58778221f9704b57360224233a76fc7cf4fe5c1693bd43c6c83107ac8 02-travis-build.patch"