[packages/firehol] up to 2.0.1

glen glen at pld-linux.org
Wed Apr 20 23:30:17 CEST 2016


commit 8d21b09aa9a539defbdcf3076f6d664fb610385b
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Apr 21 00:29:18 2016 +0300

    up to 2.0.1
    
    rewritten using fedora package, 31cc95c

 firehol.service |  13 ++++++++
 firehol.spec    | 100 +++++++++++++++++++++++++++++++++++---------------------
 fireqos.service |  13 ++++++++
 3 files changed, 89 insertions(+), 37 deletions(-)
---
diff --git a/firehol.spec b/firehol.spec
index 5143c8e..15d2171 100644
--- a/firehol.spec
+++ b/firehol.spec
@@ -2,33 +2,39 @@
 # - pldize initscript
 # - unbash initscript
 # - recheck deps
-Summary:	A powerful yet easy to use iptables frontend
+Summary:	Simple and powerful firewall and traffic shaping languages
 Name:		firehol
-Version:	1.273
+Version:	2.0.1
 Release:	0.1
 License:	GPL v2+
 Group:		Applications/Networking
-Source0:	http://downloads.sourceforge.net/firehol/%{name}-%{version}.tar.bz2
-# Source0-md5:	cbbe1ba21cf44955827d5c906a55aa21
-Patch0:		pld.patch
-URL:		http://firehol.sourceforge.net
-BuildRequires:	rpmbuild(macros) >= 1.228
-Requires:	bash >= 2.04
-Requires:	fileutils >= 4.0.36
+Source0:	http://firehol.org/download/firehol/releases/v%{version}/%{name}-%{version}.tar.xz
+# Source0-md5:	e2672c82b2b6012f9000c15c08c7dc89
+Source1:	%{name}.service
+Source2:	fireqos.service
+URL:		http://firehol.org
+BuildRequires:	hostname
+BuildRequires:	iproute2
+BuildRequires:	iptables
+BuildRequires:	procps
+BuildRequires:	systemd-devel
+BuildRequires:	tar >= 1:1.22
+BuildRequires:	xz
+Requires(post,preun):	/sbin/chkconfig
+Requires:	coreutils
 Requires:	gawk >= 3.0
 Requires:	grep >= 2.4.2
+Requires:	gzip
+Requires:	hostname
 Requires:	iproute2 >= 2.2.4
 Requires:	iptables >= 1.2.4
-Requires:	kernel >= 2.4
+Requires:	kmod
 Requires:	less
-Requires:	modutils >= 2.4.13
-Requires:	net-tools >= 1.57
-Requires:	sed >= 3.02
-Requires:	sh-utils >= 2.0
-Requires:	textutils >= 2.0.11
-Requires:	util-linux >= 2.11
-Requires(post,preun):	/sbin/chkconfig
+Requires:	procps
 Requires:	rc-scripts
+Requires:	sed
+Requires:	uname(release) >= 2.4
+Requires:	util-linux >= 2.11
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -48,47 +54,67 @@ interfaces.
 
 %prep
 %setup -q
-%patch0 -p1
+
+%build
+%configure
+%{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -D -p firehol.sh $RPM_BUILD_ROOT%{_initrddir}/firehol
-install -D -p examples/client-all.conf $RPM_BUILD_ROOT%{_sysconfdir}/firehol/firehol.conf
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
 
-# Install man files
-install -d $RPM_BUILD_ROOT%{_mandir}/man{1,5}
-install -p man/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1
-install -p man/*.5 $RPM_BUILD_ROOT/%{_mandir}/man5
+# Hack for documentation without crufts.
+rm -frv $RPM_BUILD_ROOT%{_docdir}
+find examples/ -name "Makefile*" -delete -print
 
-# Executables
-install -d $RPM_BUILD_ROOT%{_libdir}/firehol
-install -p *.sh $RPM_BUILD_ROOT%{_libdir}/firehol
+# Install systemd units.
+install -d $RPM_BUILD_ROOT%{systemdunitdir}
+cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}
 
-# Install runtime directories
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/firehol/services
+# Install runtime directories.
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/services
 install -d $RPM_BUILD_ROOT%{_localstatedir}/spool/firehol
 
+# Ghost configurations.
+touch $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/firehol.conf \
+      $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/fireqos.conf
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
 %post
 /sbin/chkconfig --add firehol
 %service firehol restart
+%systemd_post firehol.service
+%systemd_post fireqos.service
 
 %preun
 if [ "$1" = 0 ]; then
 	%service firehol stop
 	/sbin/chkconfig --del firehol
 fi
+%systemd_preun firehol.service
+%systemd_preun fireqos.service
 
-%clean
-rm -rf $RPM_BUILD_ROOT
+%postun
+%systemd_reload
 
 %files
 %defattr(644,root,root,755)
-%doc README TODO ChangeLog WhatIsNew examples doc
+%doc AUTHORS NEWS README THANKS examples
+%doc doc/firehol/firehol-manual.{pdf,html}
+%doc doc/fireqos/fireqos-manual.{pdf,html}
 %dir %{_sysconfdir}/firehol
-%config(noreplace) %{_sysconfdir}/firehol/firehol.conf
-%attr(754,root,root) /etc/rc.d/init.d/firehol
-%{_libdir}/firehol
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/firehol.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/fireqos.conf
+%{_sysconfdir}/%{name}/*.example
+%dir %{_sysconfdir}/%{name}/services
+%{_sysconfdir}/%{name}/services/*.example
+%attr(755,root,root) %{_sbindir}/firehol
+%attr(755,root,root) %{_sbindir}/fireqos
 %{_mandir}/man1/*.1*
 %{_mandir}/man5/*.5*
-%{_sysconfdir}/firehol/services
-%{_localstatedir}/spool/firehol
+%{systemdunitdir}/firehol.service
+%{systemdunitdir}/fireqos.service
+%{_localstatedir}/spool/%{name}
diff --git a/firehol.service b/firehol.service
new file mode 100644
index 0000000..cbfc8f1
--- /dev/null
+++ b/firehol.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Firehol iptables stateful firewall
+Documentation=man:firehol(1) man:firehol.conf(5)
+After=network.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/firehol start
+ExecStop=/usr/sbin/firehol stop
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/fireqos.service b/fireqos.service
new file mode 100644
index 0000000..f998f96
--- /dev/null
+++ b/fireqos.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=FireQOS traffic shaping tool
+Documentation=man:fireqos(1) man:fireqos.conf(5)
+After=network.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/fireqos start
+ExecStop=/usr/sbin/fireqos stop
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/firehol.git/commitdiff/8d21b09aa9a539defbdcf3076f6d664fb610385b



More information about the pld-cvs-commit mailing list