# A very helpful document for packaging Shorewall is "Anatomy of Shorewall 4.0" # which is found at http://www.shorewall.net/Anatomy.html Name: shorewall Version: 4.0.5 Release: 1%{?dist} Summary: An iptables front end for firewall configuration Group: Applications/System License: GPLv2+ URL: http://www.shorewall.net/ Source0: http://www.shorewall.net/pub/shorewall/4.0/shorewall-%{version}/shorewall-common-%{version}.tar.bz2 Source1: http://www.shorewall.net/pub/shorewall/4.0/shorewall-%{version}/shorewall-perl-%{version}.tar.bz2 Source2: http://www.shorewall.net/pub/shorewall/4.0/shorewall-%{version}/shorewall-shell-%{version}.tar.bz2 Source3: http://www.shorewall.net/pub/shorewall/4.0/shorewall-%{version}/shorewall-lite-%{version}.tar.bz2 Patch0: shorewall-4.0.4-init.patch Patch1: shorewall-lite-4.0.4-init.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: perl BuildArch: noarch Requires: shorewall-common = %{version}-%{release} Requires: shorewall-perl = %{version}-%{release} Requires: shorewall-shell = %{version}-%{release} %description The Shoreline Firewall, more commonly known as "Shorewall", is a Netfilter (iptables) based firewall that can be used on a dedicated firewall system, a multi-function gateway/ router/server or on a standalone GNU/Linux system. %package common Summary: Common files for the shorewall firewall compilers Group: Applications/System Requires: iptables iproute Requires(post): /sbin/chkconfig Requires(preun):/sbin/chkconfig Requires(preun):/sbin/service %description common This package contains files required by both the shorewall-perl and shorewall-shell compilers for the Shoreline Firewall (shorewall). %package perl Summary: Perl-based compiler for Shoreline Firewall Group: Applications/System Requires: perl %description perl shorewall-perl is a part of Shorewall that allows faster compilation and execution than the legacy shorewall-shell compiler. %package shell Summary: Shell-based compiler for Shoreline Firewall Group: Applications/System %description shell Shorewall-shell is a part of Shorewall that allows running Shorewall with legacy configurations, but shorewall-perl is the preferred compiler, please use it for new installations. %package lite Group: Applications/System Summary: Shorewall firewall for compiled rulesets Requires: iptables iproute Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig Requires(preun): /sbin/service %description lite Shorewall Lite is a companion product to Shorewall that allows network administrators to centralize the configuration of Shorewall-based firewalls. Shorewall Lite runs a firewall script generated by a machine with a Shorewall rule compiler. A machine running Shorewall Lite does not need to have a Shorewall rule compiler installed. %prep %setup -q -c -n shorewall-%{version} %setup -q -T -D -a 1 %setup -q -T -D -a 2 %setup -q -T -D -a 3 pushd shorewall-common-%{version} %patch0 -p1 popd pushd shorewall-lite-%{version} %patch1 -p1 popd # Remove hash-bang from files which are not directly executed as shell # scripts. This silences some rpmlint errors. find . -name "lib.*" -exec sed -i -e '/\#\!\/bin\/sh/d' {} \; %build %install rm -rf $RPM_BUILD_ROOT export PREFIX=$RPM_BUILD_ROOT export DEST=%{_initrddir} #### Build shorewall-common pushd shorewall-common-%{version} ./install.sh popd # Create %ghost files install -d $RPM_BUILD_ROOT/%{_localstatedir}/lib/shorewall touch $RPM_BUILD_ROOT/%{_localstatedir}/lib/shorewall/{chains,nat,proxyarp,restarted,zones,restore-base,restore-tail,state,.modules,.modulesdir} #### Build shorewall-perl pushd shorewall-perl-%{version} ./install.sh -n popd #### Build shorewall-shell pushd shorewall-shell-%{version} ./install.sh -n popd #### Build shorewall-lite pushd shorewall-lite-%{version} ./install.sh -n popd %clean rm -rf $RPM_BUILD_ROOT %post common if [ $1 = 1 ]; then /sbin/chkconfig --add shorewall fi %preun common if [ $1 = 0 ]; then /sbin/service shorewall stop >/dev/null 2>&1 /sbin/chkconfig --del shorewall fi %post lite if [ $1 = 1 ]; then /sbin/chkconfig --add shorewall-lite fi %preun lite if [ $1 = 0 ]; then /sbin/service shorewall stop >/dev/null 2>&1 /sbin/chkconfig --del shorewall-lite fi %files %defattr(-,root,root,-) %files common %defattr(0644,root,root,0755) %doc shorewall-common-%{version}/{COPYING,changelog.txt,releasenotes.txt,Samples} %attr(0755,root,root) %{_initrddir}/shorewall %attr(0755,root,root) /sbin/shorewall %dir %{_sysconfdir}/shorewall %config(noreplace) %{_sysconfdir}/shorewall/* %dir %{_datadir}/shorewall %attr(0755,root,root) %{_datadir}/shorewall/firewall %attr(0755,root,root) %{_datadir}/shorewall/wait4ifup %{_datadir}/shorewall/action.* %{_datadir}/shorewall/actions.std %{_datadir}/shorewall/configpath %{_datadir}/shorewall/macro.* %{_datadir}/shorewall/rfc1918 %{_datadir}/shorewall/version %{_datadir}/shorewall/modules %{_datadir}/shorewall/configfiles %{_datadir}/shorewall/functions %{_datadir}/shorewall/lib.* %dir %{_localstatedir}/lib/shorewall %ghost %{_localstatedir}/lib/shorewall/* %ghost %{_localstatedir}/lib/shorewall/.* # Man files - can't use /man5/* here as shorewall-lite also has man5 pages %{_mandir}/man5/shorewall-tunnels.5.gz %{_mandir}/man5/shorewall-nat.5.gz %{_mandir}/man5/shorewall-proxyarp.5.gz %{_mandir}/man5/shorewall-vardir.5.gz %{_mandir}/man5/shorewall-accounting.5.gz %{_mandir}/man5/shorewall-policy.5.gz %{_mandir}/man5/shorewall-route_rules.5.gz %{_mandir}/man5/shorewall-providers.5.gz %{_mandir}/man5/shorewall-modules.5.gz %{_mandir}/man5/shorewall-tcrules.5.gz %{_mandir}/man5/shorewall-params.5.gz %{_mandir}/man5/shorewall-zones.5.gz %{_mandir}/man5/shorewall.conf.5.gz %{_mandir}/man5/shorewall-blacklist.5.gz %{_mandir}/man5/shorewall-tcclasses.5.gz %{_mandir}/man5/shorewall-rfc1918.5.gz %{_mandir}/man5/shorewall-routestopped.5.gz %{_mandir}/man5/shorewall-rules.5.gz %{_mandir}/man5/shorewall-actions.5.gz %{_mandir}/man5/shorewall-tos.5.gz %{_mandir}/man5/shorewall-ecn.5.gz %{_mandir}/man5/shorewall-nesting.5.gz %{_mandir}/man5/shorewall-exclusion.5.gz %{_mandir}/man5/shorewall-masq.5.gz %{_mandir}/man5/shorewall-hosts.5.gz %{_mandir}/man5/shorewall-tcdevices.5.gz %{_mandir}/man5/shorewall-netmap.5.gz %{_mandir}/man5/shorewall-interfaces.5.gz %{_mandir}/man5/shorewall-maclist.5.gz %{_mandir}/man8/shorewall.8.gz %files perl %defattr(0644,root,root,0755) %doc shorewall-perl-%{version}/{COPYING,releasenotes.txt} %dir %{_datadir}/shorewall-perl %dir %{_datadir}/shorewall-perl/Shorewall %attr(755,root,root) %{_datadir}/shorewall-perl/compiler.pl %{_datadir}/shorewall-perl/prog.* %{_datadir}/shorewall-perl/version %{_datadir}/shorewall-perl/Shorewall/*.pm %files shell %defattr(0644,root,root,0755) %doc shorewall-shell-%{version}/COPYING %attr(0755,root,root) %dir %{_datadir}/shorewall-shell %attr(0755,root,root) %{_datadir}/shorewall-shell/compiler %{_datadir}/shorewall-shell/lib.* %{_datadir}/shorewall-shell/prog.* %{_datadir}/shorewall-shell/version %files lite %defattr(0644,root,root,0755) %doc shorewall-lite-%{version}/{COPYING,changelog.txt,releasenotes.txt} %attr(0755,root,root) /sbin/shorewall-lite %dir %{_sysconfdir}/shorewall-lite %config(noreplace) %{_sysconfdir}/shorewall-lite/shorewall-lite.conf %{_sysconfdir}/shorewall-lite/Makefile %attr(0755,root,root) %{_initrddir}/shorewall-lite %dir %{_localstatedir}/lib/shorewall-lite %dir %{_datadir}/shorewall-lite %{_datadir}/shorewall-lite/version %{_datadir}/shorewall-lite/configpath %{_datadir}/shorewall-lite/functions %{_datadir}/shorewall-lite/lib.* %{_datadir}/shorewall-lite/modules %attr(0755,root,root) %{_datadir}/shorewall-lite/shorecap %attr(0755,root,root) %{_datadir}/shorewall-lite/wait4ifup %{_mandir}/man5/shorewall-lite.conf.5.gz %{_mandir}/man5/shorewall-lite-vardir.5.gz %{_mandir}/man8/shorewall-lite.8.gz %changelog * Sat Oct 27 2007 Jonathan G. Underwood - 4.0.5-1 - Update to 4.0.5 which removes the need for the buildports.pl functionality * Mon Oct 8 2007 Jonathan G. Underwood - 4.0.4-2 - Add ghost files for /var/lib/shorewall/.modules and /var/lib/shorewall/.modulesdir - Fix ownership of /var/lib/shorewall-lite * Sun Oct 7 2007 Jonathan G. Underwood - 4.0.4-1 - Initial version 4 packaging based upon upstream specs by Tom Eastep and version 3 spec by Robert Marcano