16 PATH = stdenv.lib.concatStringsSep ":"
27 stdenv.mkDerivation rec {
28 baseName = "shorewall";
30 name = "${baseName}-${version}";
33 url = "http://www.shorewall.net/pub/shorewall/5.2/shorewall-5.2.0/${baseName}-${version}.tar.bz2";
34 sha256 = "005qv6kybk1jn1i63rchf86kwbxwwn463cxkp03q0mpc0cnj018w";
48 ] ++ (with perlPackages; [
52 substituteInPlace ./configure --replace '#!/bin/bash' ${stdenv.shell}
53 PATH=$PATH:${shorewall-core}/bin \
57 CONFDIR=\$PREFIX/etc \
58 SBINDIR=\$PREFIX/sbin \
59 SYSCONFDIR=\$PREFIX/etc/default \
67 # Merge with shorewall-core
68 cp -r -s ${shorewall-core} $out
69 chmod u+w $out $out/*/ $out/*/*/ $out/*/*/*/
71 # Install shorewallrc and shorewall
72 cp --remove-destination shorewallrc $out/share/shorewall/
73 substituteInPlace ./install.sh --replace '#!/bin/sh' ${stdenv.shell}
75 cp ${shorewall-core}/sbin/shorewall $out/sbin/shorewall4
76 ln -fns shorewall4 $out/sbin/shorewall
77 # Actual config will be expected in /etc/shorewall
78 sed -i $out/share/shorewall/shorewallrc \
79 -e 's~^CONFDIR=.*~CONFDIR=/etc~'
81 sed -i $out/sbin/shorewall \
82 -e 's~^\. ${shorewall-core}\(/share/shorewall/shorewallrc\)~. '$out'\1~' \
83 -e 's~^PRODUCT=.*~&\nexport PATH=${PATH}''${PATH:+:}$PATH~'
85 sed -i $out/etc/shorewall/shorewall.conf \
86 -e 's|^LOGFILE=.*|LOGFILE=/var/log/shorewall.log|' \
87 -e 's|^PATH=.*|PATH=${PATH}|' \
88 -e 's|^PERL=.*|PERL=${perl}/bin/perl|' \
89 -e 's|^SHOREWALL_SHELL=.*|SHOREWALL_SHELL=${stdenv.shell}|'
90 # FIXME: the default GEOIPDIR=/usr/share/xt_geoip/LE may require attention.
94 homepage = http://www.shorewall.net/;
95 description = "An IPv4 gateway/firewall configuration tool for GNU/Linux";
97 Shorewall is a high-level tool for configuring Netfilter. You describe your
98 firewall/gateway requirements using entries in a set of configuration
99 files. Shorewall reads those configuration files and with the help of the
100 iptables, iptables-restore, ip and tc utilities, Shorewall configures
101 Netfilter and the Linux networking subsystem to match your requirements.
102 Shorewall can be used on a dedicated firewall system, a multi-function
103 gateway/router/server or on a standalone GNU/Linux system. Shorewall does
104 not use Netfilter's ipchains compatibility mode and can thus take
105 advantage of Netfilter's connection state tracking capabilities.
107 license = stdenv.lib.licenses.gpl2Plus;
108 platforms = stdenv.lib.platforms.linux;