comparison syslog2iptables.spec.in @ 10:5dfe0138b4f9

initial coding
author carl
date Thu, 08 Dec 2005 13:58:08 -0800
parents
children a9b52f657f08
comparison
equal deleted inserted replaced
9:d76f9ff42487 10:5dfe0138b4f9
1 Summary: Syslog to iptables dynamic firewall
2 Name: @PACKAGE@
3 Version: @VERSION@
4 Release: %{?custom_release}%{!?custom_release:1}
5 Copyright: GPL
6 Group: System Environment/Daemons
7 Source: http://www.five-ten-sg.com/util/@PACKAGE@-@VERSION@.tar.gz
8 BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
9 URL: http://www.five-ten-sg.com/@PACKAGE@
10 Vendor: 510 Software Group
11 Packager: 510 Software Group
12 Requires(post,preun): /sbin/chkconfig /sbin/service
13 Requires: iptables
14 Requires: coreutils
15 BuildRequires: gcc gcc-c++
16
17
18 %description
19 @PACKAGE@ reads a configuration file /etc/@PACKAGE@.conf that defines a collection of syslog files to be parsed for ip addresses to be added to the iptables INPUT chain with DROP rules.
20
21 This package cannot co-exist with any other daemon that tries to maintain the INPUT chain, since it periodically flushes and recreates the INPUT chain.
22
23
24 %prep
25
26
27 %setup
28
29
30 %build
31 ./configure --prefix=%{_prefix} \
32 --bindir=%{_bindir} --mandir=%{_mandir} \
33 --localstatedir=%{localstatedir} --libdir=%{_libdir} \
34 --datadir=%{_datadir} --includedir=%{_includedir} \
35 --sysconfdir=%{_sysconfdir}
36 make
37
38
39 %install
40 if [ "$RPM_BUILD_ROOT" = "/" -o -z "$RPM_BUILD_ROOT" ] ; then
41 echo sorry, you probably do not want me to delete the old buildroot at $RPM_BUILD_ROOT
42 exit 1
43 fi
44 rm -rf $RPM_BUILD_ROOT
45 make prefix=$RPM_BUILD_ROOT%{_prefix} bindir=$RPM_BUILD_ROOT%{_bindir} \
46 mandir=$RPM_BUILD_ROOT%{_mandir} libdir=$RPM_BUILD_ROOT%{_libdir} \
47 localstatedir=$RPM_BUILD_ROOT%{localstatedir} \
48 datadir=$RPM_BUILD_ROOT%{_datadir} \
49 includedir=$RPM_BUILD_ROOT%{_includedir} \
50 sysconfdir=$RPM_BUILD_ROOT%{_sysconfdir} install
51 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
52 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/syslog2iptables $RPM_BUILD_ROOT/etc/rc.d/init.d
53
54
55 %clean
56 rm -rf $RPM_BUILD_ROOT
57
58
59 %pre
60
61
62 %post
63 /sbin/chkconfig --add @PACKAGE@
64 /sbin/chkconfig @PACKAGE@ on
65 /sbin/service @PACKAGE@ start || :
66
67
68 %preun
69 /sbin/service @PACKAGE@ stop || :
70 /sbin/chkconfig --del @PACKAGE@
71
72
73 %postun
74
75
76 %files
77 %doc AUTHORS COPYING ChangeLog NEWS README
78 %defattr(-,root,root)
79 %{_sbindir}/*
80 %config(noreplace) %{_sysconfdir}/@PACKAGE@.conf
81 /etc/rc.d/init.d/@PACKAGE@
82
83
84 %changelog
85 * Thu Dec 08 2005 Carl Byington 1.0
86 - initial revision based on dnsbl spec file
87 - and http://www.fedora.us/docs/rpm-packaging-guidelines.html