diff options
author | Ben Siraphob <bensiraphob@gmail.com> | 2021-01-01 19:44:58 +0700 |
---|---|---|
committer | Jonathan Ringer <jonringer@users.noreply.github.com> | 2021-01-01 10:41:04 -0800 |
commit | 863054f9da86c21df62a856fe0bfdfe109a60f36 (patch) | |
tree | 7d0d8cbc5b08103f3e71179921da66845f931a5c /pkgs | |
parent | 0eb369d907b3d45d236571870c1ecf7a0a7ec4aa (diff) |
firehol: move patches into files
Diffstat (limited to 'pkgs')
4 files changed, 53 insertions, 58 deletions
diff --git a/pkgs/applications/networking/firehol/default.nix b/pkgs/applications/networking/firehol/default.nix index de523b14ba64..83f4d267f959 100644 --- a/pkgs/applications/networking/firehol/default.nix +++ b/pkgs/applications/networking/firehol/default.nix @@ -20,69 +20,19 @@ stdenv.mkDerivation rec { patches = [ # configure tries to determine if `ping6` or the newer, combined # `ping` is installed by using `ping -6` which would fail. - (pkgs.writeText "firehol-ping6.patch" - '' - --- a/m4/ax_check_ping_ipv6.m4 - +++ b/m4/ax_check_ping_ipv6.m4 - @@ -42,16 +42,16 @@ AC_DEFUN([AX_CHECK_PING_IPV6], - - AC_CACHE_CHECK([whether ]PING[ has working -6 option], [ac_cv_ping_6_opt], - [ - - ac_cv_ping_6_opt=no - - if test -n "$PING"; then - - echo "Trying '$PING -6 -c 1 ::1'" >&AS_MESSAGE_LOG_FD - - $PING -6 -c 1 ::1 > conftest.out 2>&1 - - if test "$?" = 0; then - - ac_cv_ping_6_opt=yes - - fi - - cat conftest.out >&AS_MESSAGE_LOG_FD - - rm -f conftest.out - - fi - + ac_cv_ping_6_opt=yes - + #if test -n "$PING"; then - + # echo "Trying '$PING -6 -c 1 ::1'" >&AS_MESSAGE_LOG_FD - + # $PING -6 -c 1 ::1 > conftest.out 2>&1 - + # if test "$?" = 0; then - + # ac_cv_ping_6_opt=yes - + # fi - + # cat conftest.out >&AS_MESSAGE_LOG_FD - + # rm -f conftest.out - + #fi - ]) - - AS_IF([test "x$ac_cv_ping_6_opt" = "xyes"],[ - '') + ./firehol-ping6.patch # put firehol config files in /etc/firehol (not $out/etc/firehol) # to avoid error on startup, see #35114 - (pkgs.writeText "firehol-sysconfdir.patch" - '' - --- a/sbin/install.config.in.in - +++ b/sbin/install.config.in.in - @@ -4 +4 @@ - -SYSCONFDIR="@sysconfdir_POST@" - +SYSCONFDIR="/etc" - '') + ./firehol-sysconfdir.patch - # we must quote "$UNAME_CMD", or the dash in /nix/store/...-coreutils-.../bin/uname - # will be interpreted as IFS -> error. this might be considered an upstream bug - # but only appears when there are dashes in the command path - (pkgs.writeText "firehol-uname-command.patch" - '' - --- a/sbin/firehol - +++ b/sbin/firehol - @@ -10295,7 +10295,7 @@ - kmaj=$1 - kmin=$2 - - - set -- $($UNAME_CMD -r) - + set -- $("$UNAME_CMD" -r) - eval $kmaj=\$1 $kmin=\$2 - } - kernel_maj_min KERNELMAJ KERNELMIN - '') + # we must quote "$UNAME_CMD", or the dash in + # /nix/store/...-coreutils-.../bin/uname will be interpreted as + # IFS -> error. this might be considered an upstream bug but only + # appears when there are dashes in the command path + ./firehol-uname-command.patch ]; - + nativeBuildInputs = [ autoconf automake ]; buildInputs = [ curl iprange iproute ipset iptables iputils kmod diff --git a/pkgs/applications/networking/firehol/firehol-ping6.patch b/pkgs/applications/networking/firehol/firehol-ping6.patch new file mode 100644 index 000000000000..7e06e503ef6f --- /dev/null +++ b/pkgs/applications/networking/firehol/firehol-ping6.patch @@ -0,0 +1,29 @@ +--- a/m4/ax_check_ping_ipv6.m4 ++++ b/m4/ax_check_ping_ipv6.m4 +@@ -42,16 +42,16 @@ AC_DEFUN([AX_CHECK_PING_IPV6], + + AC_CACHE_CHECK([whether ]PING[ has working -6 option], [ac_cv_ping_6_opt], + [ +- ac_cv_ping_6_opt=no +- if test -n "$PING"; then +- echo "Trying '$PING -6 -c 1 ::1'" >&AS_MESSAGE_LOG_FD +- $PING -6 -c 1 ::1 > conftest.out 2>&1 +- if test "$?" = 0; then +- ac_cv_ping_6_opt=yes +- fi +- cat conftest.out >&AS_MESSAGE_LOG_FD +- rm -f conftest.out +- fi ++ ac_cv_ping_6_opt=yes ++ #if test -n "$PING"; then ++ # echo "Trying '$PING -6 -c 1 ::1'" >&AS_MESSAGE_LOG_FD ++ # $PING -6 -c 1 ::1 > conftest.out 2>&1 ++ # if test "$?" = 0; then ++ # ac_cv_ping_6_opt=yes ++ # fi ++ # cat conftest.out >&AS_MESSAGE_LOG_FD ++ # rm -f conftest.out ++ #fi + ]) + + AS_IF([test "x$ac_cv_ping_6_opt" = "xyes"],[ diff --git a/pkgs/applications/networking/firehol/firehol-sysconfdir.patch b/pkgs/applications/networking/firehol/firehol-sysconfdir.patch new file mode 100644 index 000000000000..c541dd585acc --- /dev/null +++ b/pkgs/applications/networking/firehol/firehol-sysconfdir.patch @@ -0,0 +1,5 @@ +--- a/sbin/install.config.in.in ++++ b/sbin/install.config.in.in +@@ -4,1 +4,1 @@ +-SYSCONFDIR="@sysconfdir_POST@" ++SYSCONFDIR="/etc" diff --git a/pkgs/applications/networking/firehol/firehol-uname-command.patch b/pkgs/applications/networking/firehol/firehol-uname-command.patch new file mode 100644 index 000000000000..92ab4cd93214 --- /dev/null +++ b/pkgs/applications/networking/firehol/firehol-uname-command.patch @@ -0,0 +1,11 @@ +--- a/sbin/firehol ++++ b/sbin/firehol +@@ -10295,7 +10295,7 @@ + kmaj=$1 + kmin=$2 + +- set -- $($UNAME_CMD -r) ++ set -- $("$UNAME_CMD" -r) + eval $kmaj=\$1 $kmin=\$2 + } + kernel_maj_min KERNELMAJ KERNELMIN |