%define debug_package %{nil} %define basedir /etc/apf Summary: APF - Advanced Policy Firewall Name: apf Version: 9.6.5 Release: 1 License: GPL Group: System Environment/Daemons Source0: %{name}-current.tar.gz Source1: conf.apf URL: http://www.rfxnetworks.com/apf.php Vendor: Atomic Rocket Turtle http://www.atomicrocketturtle.com Packager: Scott R. Shinn BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildArch: noarch PreReq: grep PreReq: sed PreReq: net-tools PreReq: coreutils Requires: iptables %description APF is a policy based iptables firewall system designed for ease of use and configuration. It employs a subset of features to satisfy the veteran Linux user and the novice alike. Packaged in tar.gz format and RPM formats, make APF ideal for deployment in many server environments based on Linux. %prep [ -n %{buildroot} ] && rm -rf %{buildroot} %setup -q -n %{name}-%{version} %build %install mkdir -p %{buildroot}%{basedir} cp -R files/* %{buildroot}%{basedir} find %{buildroot}%{basedir} -type f \-exec chmod 640 {} \; find %{buildroot}%{basedir} -type d \-exec chmod 750 {} \; #cp README.apf README.antidos CHANGELOG COPYING.GPL %{buildroot}%{basedir}/doc cp CHANGELOG COPYING.GPL README.apf %{buildroot}%{basedir}/doc #mkdir -p %{buildroot}%{_sysconfdir}/cron.daily mkdir -p %{buildroot}%{_sysconfdir}/init.d mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d #install -m 0700 cron.daily %{buildroot}%{_sysconfdir}/cron.daily/fw install -m 0700 apf.init %{buildroot}%{_sysconfdir}/init.d/apf install -m 0600 logrotate.d.apf %{buildroot}%{_sysconfdir}/logrotate.d/apf chmod 750 %{buildroot}%{basedir}/apf chmod 750 %{buildroot}%{basedir}/firewall chmod 750 %{buildroot}%{basedir}/vnet/vnetgen install -m 0640 %{SOURCE1} %{buildroot}%{basedir} %clean [ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot} %pre %postun %post /bin/ln -fs %{basedir}/apf /usr/sbin/apf /bin/ln -fs %{basedir}/apf /usr/sbin/fwmgr # # make sure we do the right think on VPS systems # if [ `ifconfig | egrep -c "venet0"` -gt 0 ]; then /bin/sed -i -r "s/IF=\"eth0\"/IF=\"venet0\"/" %{basedir}/conf.apf /bin/sed -i -r "s/MONOKERN=\"0\"/MONOKERN=\"1\"/" %{basedir}/conf.apf fi [ -f "%{_sysconfdir}/cron.d/fwdev" ] && rm -f %{_sysconfdir}/cron.d/fwdev [ -f "%{basedir}/cron.fwdev" ] && rm -f %{basedir}/cron.fwdev [ -f "%{_sysconfdir}/cron.hourly/fw" ] && rm -f %{_sysconfdir}/cron.hourly/fw if [ -f "/var/log/apf_log" ] || [ -f "/var/log/apfados_log" ]; then rm -f /var/log/apf_log /var/log/apfados_log fi if [ -f "/sbin/chkconfig" ]; then /sbin/chkconfig --add apf /sbin/chkconfig --level 345 apf off fi #%{basedir}/vnet/vnetgen if [ -f "/usr/bin/dialog" ] && [ -d "%{basedir}/extras/apf-m" ]; then pushd %{basedir}/extras/apf-m/ sh install -i popd fi %preun %files %defattr(-,root,root) %attr(0750,root,root) %dir %{basedir} #%attr(-,root,root) %{basedir}/ad %attr(-,root,root) %{basedir}/doc %attr(-,root,root) %{basedir}/extras %attr(-,root,root) %{basedir}/internals %attr(-,root,root) %{basedir}/vnet %attr(-,root,root) %{basedir}/VERSION %attr(-,root,root) %{basedir}/apf %attr(-,root,root) %{basedir}/firewall %attr(0700,root,root) %{_sysconfdir}/init.d/apf %attr(0600,root,root) %{_sysconfdir}/logrotate.d/apf %config(noreplace) %{basedir}/conf.apf %config(noreplace) %{basedir}/*.rules #%attr(0700,root,root) %{_sysconfdir}/cron.daily/fw %changelog * Wed Sep 24 2008 Scott R. Shinn - 9.6.5 - Update to 9.6-5 - Renamed the tar file to "9.6.5" - Updated .spec to work with mock * Wed Oct 19 2005 Chris Wells - making work on vps systems * Sat Oct 23 2004 Chris Wells - initial release