SPECS: psad.spec - unify macros - some cleanup - NFY
shadzik
shadzik at pld-linux.org
Sun Dec 17 20:19:13 CET 2006
Author: shadzik Date: Sun Dec 17 19:19:13 2006 GMT
Module: SPECS Tag: HEAD
---- Log message:
- unify macros
- some cleanup
- NFY
---- Files affected:
SPECS:
psad.spec (1.1 -> 1.2)
---- Diffs:
================================================================
Index: SPECS/psad.spec
diff -u SPECS/psad.spec:1.1 SPECS/psad.spec:1.2
--- SPECS/psad.spec:1.1 Sun Dec 17 10:36:07 2006
+++ SPECS/psad.spec Sun Dec 17 20:19:07 2006
@@ -1,5 +1,5 @@
# $Revision$, $Date$
-%define psadlibdir %_libdir/%name
+%define psadlibdir %{_libdir}/%{name}
%define psadlogdir /var/log/psad
%define psadrundir /var/run/psad
%define psadvarlibdir /var/lib/psad
@@ -50,20 +50,14 @@
mv $i.tmp $i
done
-cd Psad && perl Makefile.PL PREFIX=%psadlibdir LIB=%psadlibdir
-cd ..
-cd IPTables-Parse && perl Makefile.PL PREFIX=%psadlibdir LIB=%psadlibdir
-cd ..
-cd IPTables-ChainMgr && perl Makefile.PL PREFIX=%psadlibdir LIB=%psadlibdir
-cd ..
-cd Bit-Vector && perl Makefile.PL PREFIX=%psadlibdir LIB=%psadlibdir
-cd ..
-cd Net-IPv4Addr && perl Makefile.PL PREFIX=%psadlibdir LIB=%psadlibdir
-cd ..
-cd Unix-Syslog && perl Makefile.PL PREFIX=%psadlibdir LIB=%psadlibdir
-cd ..
-cd Date-Calc && perl Makefile.PL PREFIX=%psadlibdir LIB=%psadlibdir
-cd ..
+# FIXME - do it with a loop
+perl Psad/Makefile.PL PREFIX=%{psadlibdir} LIB=%{psadlibdir}
+perl IPTables-Parse/Makefile.PL PREFIX=%{psadlibdir} LIB=%{psadlibdir}
+perl IPTables-ChainMgr/Makefile.PL PREFIX=%{psadlibdir} LIB=%{psadlibdir}
+perl Bit-Vector/Makefile.PL PREFIX=%{psadlibdir} LIB=%{psadlibdir}
+perl Net-IPv4Addr/Makefile.PL PREFIX=%{psadlibdir} LIB=%{psadlibdir}
+perl Unix-Syslog/Makefile.PL PREFIX=%{psadlibdir} LIB=%{psadlibdir}
+perl Date-Calc/Makefile.PL PREFIX=%{psadlibdir} LIB=%{psadlibdir}
%build
### build psad binaries (kmsgsd and psadwatchd)
@@ -84,30 +78,30 @@
%install
rm -rf $RPM_BUILD_ROOT
### config directory
-#install -d $RPM_BUILD_ROOT%psadetcdir
+#install -d $RPM_BUILD_ROOT%{psadetcdir}
### log directory
-install -d $RPM_BUILD_ROOT%psadlogdir
+install -d $RPM_BUILD_ROOT%{psadlogdir}
### dir for psadfifo
-install -d $RPM_BUILD_ROOT%psadvarlibdir
+install -d $RPM_BUILD_ROOT%{psadvarlibdir}
### dir for pidfiles
-install -d $RPM_BUILD_ROOT%psadrundir
+install -d $RPM_BUILD_ROOT%{psadrundir}
### psad module dirs
-install -d $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/auto/Bit/Vector
-install -d $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Bit
-install -d $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/auto/Psad
-install -d $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/auto/Unix/Syslog
-install -d $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/auto/Date/Calc
-install -d $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/auto/Net/IPv4Addr
-install -d $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/auto/IPTables/Parse
-install -d $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/auto/IPTables/ChainMgr
-install -d $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Unix
-install -d $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Carp
-install -d $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Date/Calc
-install -d $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Date/Calendar
-install -d $RPM_BUILD_ROOT%psadlibdir/auto/Net/IPv4Addr
-install -d $RPM_BUILD_ROOT%psadlibdir/Net
-install -d $RPM_BUILD_ROOT%psadlibdir/IPTables
+install -d $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/auto/Bit/Vector
+install -d $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Bit
+install -d $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/auto/Psad
+install -d $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/auto/Unix/Syslog
+install -d $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/auto/Date/Calc
+install -d $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/auto/Net/IPv4Addr
+install -d $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/auto/IPTables/Parse
+install -d $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/auto/IPTables/ChainMgr
+install -d $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Unix
+install -d $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Carp
+install -d $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Date/Calc
+install -d $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Date/Calendar
+install -d $RPM_BUILD_ROOT%{psadlibdir}/auto/Net/IPv4Addr
+install -d $RPM_BUILD_ROOT%{psadlibdir}/Net
+install -d $RPM_BUILD_ROOT%{psadlibdir}/IPTables
### whois_psad binary
install -d $RPM_BUILD_ROOT%{_bindir}
@@ -115,7 +109,7 @@
install -d $RPM_BUILD_ROOT%{_mandir}/man1
install -d $RPM_BUILD_ROOT%{_sbindir}
### psad config
-install -d $RPM_BUILD_ROOT%_sysconfdir/%{name}
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
### psad init script
install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
@@ -126,41 +120,41 @@
install whois/whois $RPM_BUILD_ROOT%{_bindir}/whois_psad
install nf2csv $RPM_BUILD_ROOT%{_bindir}/nf2csv
install init-scripts/psad-init.redhat $RPM_BUILD_ROOT/etc/rc.d/init.d/psad
-install {psad.conf,kmsgsd.conf,psadwatchd.conf,fw_search.conf,alert.conf} $RPM_BUILD_ROOT%_sysconfdir/%{name}/
-install {signatures,icmp_types,ip_options,auto_dl,snort_rule_dl,posf,pf.os} $RPM_BUILD_ROOT%_sysconfdir/%{name}/
+install {psad.conf,kmsgsd.conf,psadwatchd.conf,fw_search.conf,alert.conf} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/
+install {signatures,icmp_types,ip_options,auto_dl,snort_rule_dl,posf,pf.os} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/
install *.8 $RPM_BUILD_ROOT%{_mandir}/man8/
install nf2csv.1 $RPM_BUILD_ROOT%{_mandir}/man1/
### install perl modules used by psad
-install Bit-Vector/blib/arch/auto/Bit/Vector/Vector.so $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/auto/Bit/Vector/Vector.so
-install Bit-Vector/blib/arch/auto/Bit/Vector/Vector.bs $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/auto/Bit/Vector/Vector.bs
-install Bit-Vector/blib/lib/Bit/Vector.pm $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Bit/Vector.pm
-install Unix-Syslog/blib/arch/auto/Unix/Syslog/Syslog.so $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/auto/Unix/Syslog/Syslog.so
-install Unix-Syslog/blib/arch/auto/Unix/Syslog/Syslog.bs $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/auto/Unix/Syslog/Syslog.bs
-install Unix-Syslog/blib/lib/auto/Unix/Syslog/autosplit.ix $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/auto/Unix/Syslog/autosplit.ix
-install Unix-Syslog/blib/lib/Unix/Syslog.pm $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Unix/Syslog.pm
-install Date-Calc/blib/arch/auto/Date/Calc/Calc.so $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/auto/Date/Calc/Calc.so
-install Date-Calc/blib/arch/auto/Date/Calc/Calc.bs $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/auto/Date/Calc/Calc.bs
-install Date-Calc/blib/lib/Carp/Clan.pod $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Carp/Clan.pod
-install Date-Calc/blib/lib/Carp/Clan.pm $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Carp/Clan.pm
-install Date-Calc/blib/lib/Date/Calc.pm $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Date/Calc.pm
-install Date-Calc/blib/lib/Date/Calc.pod $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Date/Calc.pod
-install Date-Calc/blib/lib/Date/Calendar.pm $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Date/Calendar.pm
-install Date-Calc/blib/lib/Date/Calendar.pod $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Date/Calendar.pod
-install Date-Calc/blib/lib/Date/Calc/Object.pm $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Date/Calc/Object.pm
-install Date-Calc/blib/lib/Date/Calc/Object.pod $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Date/Calc/Object.pod
-install Date-Calc/blib/lib/Date/Calendar/Year.pm $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Date/Calendar/Year.pm
-install Date-Calc/blib/lib/Date/Calendar/Profiles.pod $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Date/Calendar/Profiles.pod
-install Date-Calc/blib/lib/Date/Calendar/Profiles.pm $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Date/Calendar/Profiles.pm
-install Date-Calc/blib/lib/Date/Calendar/Year.pod $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/Date/Calendar/Year.pod
-install Net-IPv4Addr/blib/lib/auto/Net/IPv4Addr/autosplit.ix $RPM_BUILD_ROOT%psadlibdir/auto/Net/IPv4Addr/autosplit.ix
-install Net-IPv4Addr/blib/lib/Net/IPv4Addr.pm $RPM_BUILD_ROOT%psadlibdir/Net/IPv4Addr.pm
-install IPTables-Parse/blib/lib/IPTables/Parse.pm $RPM_BUILD_ROOT%psadlibdir/IPTables/Parse.pm
-install IPTables-ChainMgr/blib/lib/IPTables/ChainMgr.pm $RPM_BUILD_ROOT%psadlibdir/IPTables/ChainMgr.pm
-install Psad/blib/lib/Psad.pm $RPM_BUILD_ROOT%psadlibdir/Psad.pm
+install Bit-Vector/blib/arch/auto/Bit/Vector/Vector.so $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/auto/Bit/Vector/Vector.so
+install Bit-Vector/blib/arch/auto/Bit/Vector/Vector.bs $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/auto/Bit/Vector/Vector.bs
+install Bit-Vector/blib/lib/Bit/Vector.pm $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Bit/Vector.pm
+install Unix-Syslog/blib/arch/auto/Unix/Syslog/Syslog.so $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/auto/Unix/Syslog/Syslog.so
+install Unix-Syslog/blib/arch/auto/Unix/Syslog/Syslog.bs $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/auto/Unix/Syslog/Syslog.bs
+install Unix-Syslog/blib/lib/auto/Unix/Syslog/autosplit.ix $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/auto/Unix/Syslog/autosplit.ix
+install Unix-Syslog/blib/lib/Unix/Syslog.pm $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Unix/Syslog.pm
+install Date-Calc/blib/arch/auto/Date/Calc/Calc.so $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/auto/Date/Calc/Calc.so
+install Date-Calc/blib/arch/auto/Date/Calc/Calc.bs $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/auto/Date/Calc/Calc.bs
+install Date-Calc/blib/lib/Carp/Clan.pod $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Carp/Clan.pod
+install Date-Calc/blib/lib/Carp/Clan.pm $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Carp/Clan.pm
+install Date-Calc/blib/lib/Date/Calc.pm $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Date/Calc.pm
+install Date-Calc/blib/lib/Date/Calc.pod $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Date/Calc.pod
+install Date-Calc/blib/lib/Date/Calendar.pm $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Date/Calendar.pm
+install Date-Calc/blib/lib/Date/Calendar.pod $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Date/Calendar.pod
+install Date-Calc/blib/lib/Date/Calc/Object.pm $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Date/Calc/Object.pm
+install Date-Calc/blib/lib/Date/Calc/Object.pod $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Date/Calc/Object.pod
+install Date-Calc/blib/lib/Date/Calendar/Year.pm $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Date/Calendar/Year.pm
+install Date-Calc/blib/lib/Date/Calendar/Profiles.pod $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Date/Calendar/Profiles.pod
+install Date-Calc/blib/lib/Date/Calendar/Profiles.pm $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Date/Calendar/Profiles.pm
+install Date-Calc/blib/lib/Date/Calendar/Year.pod $RPM_BUILD_ROOT%{psadlibdir}/%{psadmoddir}/Date/Calendar/Year.pod
+install Net-IPv4Addr/blib/lib/auto/Net/IPv4Addr/autosplit.ix $RPM_BUILD_ROOT%{psadlibdir}/auto/Net/IPv4Addr/autosplit.ix
+install Net-IPv4Addr/blib/lib/Net/IPv4Addr.pm $RPM_BUILD_ROOT%{psadlibdir}/Net/IPv4Addr.pm
+install IPTables-Parse/blib/lib/IPTables/Parse.pm $RPM_BUILD_ROOT%{psadlibdir}/IPTables/Parse.pm
+install IPTables-ChainMgr/blib/lib/IPTables/ChainMgr.pm $RPM_BUILD_ROOT%{psadlibdir}/IPTables/ChainMgr.pm
+install Psad/blib/lib/Psad.pm $RPM_BUILD_ROOT%{psadlibdir}/Psad.pm
### install snort rules files
-cp -r snort_rules $RPM_BUILD_ROOT%_sysconfdir/%{name}
+cp -r snort_rules $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
@@ -176,15 +170,15 @@
%post
### put the current hostname into the psad C binaries
### (kmsgsd and psadwatchd).
-perl -p -i -e 'use Sys::Hostname; my $hostname = hostname(); s/HOSTNAME(\s+)_?CHANGE.?ME_?/HOSTNAME${1}$hostname/' %_sysconfdir/%{name}/psad.conf
-perl -p -i -e 'use Sys::Hostname; my $hostname = hostname(); s/HOSTNAME(\s+)_?CHANGE.?ME_?/HOSTNAME${1}$hostname/' %_sysconfdir/%{name}/psadwatchd.conf
+perl -p -i -e 'use Sys::Hostname; my $hostname = hostname(); s/HOSTNAME(\s+)_?CHANGE.?ME_?/HOSTNAME${1}$hostname/' %{_sysconfdir}/%{name}/psad.conf
+perl -p -i -e 'use Sys::Hostname; my $hostname = hostname(); s/HOSTNAME(\s+)_?CHANGE.?ME_?/HOSTNAME${1}$hostname/' %{_sysconfdir}/%{name}/psadwatchd.conf
-/bin/touch %psadlogdir/fwdata
-chown root.root %psadlogdir/fwdata
+/bin/touch %{psadlogdir}/fwdata
+chown root.root %{psadlogdir}/fwdata
chmod 0500 %{_sbindir}/psad
chmod 0500 %{_sbindir}/kmsgsd
chmod 0500 %{_sbindir}/psadwatchd
-chmod 0600 %psadlogdir/fwdata
+chmod 0600 %{psadlogdir}/fwdata
if [ ! -p %psadvarlibdir/psadfifo ];
then [ -e %psadvarlibdir/psadfifo ] && /bin/rm -f %psadvarlibdir/psadfifo
/bin/mknod -m 600 %psadvarlibdir/psadfifo p
@@ -224,7 +218,7 @@
%files
%defattr(644,root,root,755)
-%dir %psadlogdir
+%dir %{psadlogdir}
%dir %psadvarlibdir
%dir %psadrundir
%attr(754,root,root) /etc/rc.d/init.d/psad
@@ -233,18 +227,18 @@
%{_mandir}/man8/*
%{_mandir}/man1/*
-%dir %_sysconfdir/%{name}
-%config(noreplace) %_sysconfdir/%{name}/*.conf
-%config(noreplace) %_sysconfdir/%{name}/signatures
-%config(noreplace) %_sysconfdir/%{name}/auto_dl
-%config(noreplace) %_sysconfdir/%{name}/ip_options
-%config(noreplace) %_sysconfdir/%{name}/snort_rule_dl
-%config(noreplace) %_sysconfdir/%{name}/posf
-%config(noreplace) %_sysconfdir/%{name}/pf.os
-%config(noreplace) %_sysconfdir/%{name}/icmp_types
+%dir %{_sysconfdir}/%{name}
+%config(noreplace) %{_sysconfdir}/%{name}/*.conf
+%config(noreplace) %{_sysconfdir}/%{name}/signatures
+%config(noreplace) %{_sysconfdir}/%{name}/auto_dl
+%config(noreplace) %{_sysconfdir}/%{name}/ip_options
+%config(noreplace) %{_sysconfdir}/%{name}/snort_rule_dl
+%config(noreplace) %{_sysconfdir}/%{name}/posf
+%config(noreplace) %{_sysconfdir}/%{name}/pf.os
+%config(noreplace) %{_sysconfdir}/%{name}/icmp_types
-%dir %_sysconfdir/%{name}/snort_rules
-%config(noreplace) %_sysconfdir/%{name}/snort_rules/*
+%dir %{_sysconfdir}/%{name}/snort_rules
+%config(noreplace) %{_sysconfdir}/%{name}/snort_rules/*
%_libdir/%{name}
@@ -254,6 +248,11 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.2 2006/12/17 19:19:07 shadzik
+- unify macros
+- some cleanup
+- NFY
+
Revision 1.1 2006/12/17 09:36:07 paszczus
- raw and dirty spec (downloaded from official program site)
- release 0.1 (adapterized; builds)
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SPECS/psad.spec?r1=1.1&r2=1.2&f=u
More information about the pld-cvs-commit
mailing list