view syslog2iptables.spec.in @ 18:b34e716781ed stable-1-0

prevent auto-requires in rpm building
author carl
date Tue, 20 Dec 2005 17:36:18 -0800
parents 91b26521effc
children 601bc0e075e1
line wrap: on
line source

%define localstatedir   /var/lib

Summary:            Syslog to iptables dynamic firewall
Name:               @PACKAGE@
Version:            @VERSION@
Release:            %{?custom_release}%{!?custom_release:1}
Copyright:          GPL
Group:              System Environment/Daemons
Source:             http://www.five-ten-sg.com/@PACKAGE@/packages/@PACKAGE@-@VERSION@.tar.gz
BuildRoot:          %{_tmppath}/%{name}-%{version}-buildroot
URL:                http://www.five-ten-sg.com/@PACKAGE@/
Vendor:             510 Software Group
Packager:           510 Software Group
AutoReqProv:        no

Requires(post,preun):   /sbin/chkconfig
Requires(post,preun):   /sbin/service
Requires:               iptables
Requires:               coreutils
BuildRequires:          gcc gcc-c++
Requires:               libc.so.6, libgcc_s.so.1, libm.so.6, libpthread.so.0, libstdc++.so.6


%description

@PACKAGE@ is a simple adaptive firewall.  It maintains the INPUT chain of the iptables firewall set based on syslog entries.

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.


%prep


%setup


%build
./configure --prefix=%{_prefix} \
    --bindir=%{_bindir} --mandir=%{_mandir} \
    --localstatedir=%{localstatedir} --libdir=%{_libdir} \
    --datadir=%{_datadir} --includedir=%{_includedir} \
    --sysconfdir=%{_sysconfdir}
make


%install
if [ "$RPM_BUILD_ROOT" = "/" -o -z "$RPM_BUILD_ROOT" ] ; then
        echo sorry, you probably do not want me to delete the old buildroot at $RPM_BUILD_ROOT
        exit 1
fi
rm -rf $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{_prefix} bindir=$RPM_BUILD_ROOT%{_bindir} \
    mandir=$RPM_BUILD_ROOT%{_mandir} libdir=$RPM_BUILD_ROOT%{_libdir} \
    localstatedir=$RPM_BUILD_ROOT%{localstatedir} \
    datadir=$RPM_BUILD_ROOT%{_datadir} \
    includedir=$RPM_BUILD_ROOT%{_includedir} \
    sysconfdir=$RPM_BUILD_ROOT%{_sysconfdir} install
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
mkdir -p $RPM_BUILD_ROOT%{_datadir}/doc/@PACKAGE@-@VERSION@
mv -f $RPM_BUILD_ROOT%{_sysconfdir}/syslog2iptables  $RPM_BUILD_ROOT/etc/rc.d/init.d
mv AUTHORS COPYING ChangeLog NEWS README             $RPM_BUILD_ROOT%{_datadir}/doc/@PACKAGE@-@VERSION@


%clean
rm -rf $RPM_BUILD_ROOT


%pre


%post
/sbin/chkconfig --add @PACKAGE@


%preun
/sbin/service @PACKAGE@ stop || :
/sbin/chkconfig --del @PACKAGE@


%postun


%files
%defattr(-,root,root)
%{_sbindir}/*
%doc %{_mandir}/*
%docdir %{_datadir}/doc/@PACKAGE@-@VERSION@
%{_datadir}/doc/@PACKAGE@-@VERSION@
%config(noreplace) %{_sysconfdir}/@PACKAGE@.conf
/etc/rc.d/init.d/@PACKAGE@

%changelog
* Thu Dec 08 2005 Carl Byington 1.0
- initial revision based on dnsbl spec file
- and http://www.fedora.us/docs/rpm-packaging-guidelines.html