d187c65
%define _default_patch_fuzz 2
fa49311
Name: pads
fa49311
Version: 1.2
61c1d87
Release: 8%{?dist}
fa49311
Summary: Passive Asset Detection System
fa49311
Group: Applications/System
fa49311
License: GPLv2+
fa49311
URL: http://passive.sourceforge.net/
fa49311
Source0: http://prdownloads.sourceforge.net/passive/%{name}-%{version}.tar.gz
61c1d87
Source1: pads.service
fa49311
Source2: pads.sysconfig
fa49311
Patch1: pads-1.2-cleanup.patch
fa49311
Patch2: pads-1.2-memleak.patch
fa49311
Patch3: pads-1.2-overrun.patch
fa49311
Patch4: pads-1.2-disable-debug.patch
fa49311
Patch5: pads-1.2-daemonize.patch
fa49311
Patch6: pads-1.2-ether-codes-update.patch
fa49311
Patch7: pads-1.2-misc.patch
fa49311
Patch8: pads-1.2-arp.patch
fa49311
Patch9: pads-1.2-prelude.patch
fa49311
Patch10: pads+vlan.patch
fa49311
Patch11: pads-1.2-prelude-cleanup.patch
fa49311
Patch12: pads-1.2-readonly.patch
fa49311
Patch13: pads-1.2-bstring.patch
fa49311
Patch14: pads-1.2-leak.patch
fa49311
Patch15: pads-1.2-perf.patch
fa49311
Patch16: pads-1.2-daemon.patch
a2cb05a
Patch17: pads-1.2-pthreads.patch
fa49311
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
fa49311
BuildRequires: automake autoconf
fa49311
BuildRequires: pcre-devel libpcap-devel
a2cb05a
BuildRequires: libprelude-devel >= 0.9.21
61c1d87
#Requires(post)  : /sbin/chkconfig
61c1d87
#Requires(preun) : /sbin/chkconfig
61c1d87
#Requires(preun) : /sbin/service
61c1d87
#Requires(postun): /sbin/service
61c1d87
Requires(post): systemd-units
61c1d87
Requires(preun): systemd-units
61c1d87
Requires(postun): systemd-units
61c1d87
fa49311
fa49311
%description
fa49311
PADS is a libpcap based detection engine used to passively 
fa49311
detect network assets.  It is designed to complement IDS 
fa49311
technology by providing context to IDS alerts. When new assets
fa49311
are found, it can send IDMEF alerts via prelude.
fa49311
fa49311
%prep
fa49311
%setup -q
fa49311
%patch1 -p1
fa49311
%patch2 -p1
fa49311
%patch3 -p1
fa49311
%patch4 -p1
fa49311
%patch5 -p1
fa49311
%patch6 -p1
fa49311
%patch7 -p1
fa49311
%patch8 -p1
fa49311
%patch9 -p1
fa49311
%patch10 -p1
fa49311
%patch11 -p1
fa49311
%patch12 -p1
fa49311
%patch13 -p1
fa49311
%patch14 -p1
fa49311
%patch15 -p1
fa49311
%patch16 -p1
a2cb05a
%patch17 -p1
fa49311
fa49311
%build
fa49311
autoreconf -fv --install
fa49311
%configure --with-prelude
fa49311
make %{?_smp_mflags}
fa49311
fa49311
%install
fa49311
rm -rf %{buildroot}
61c1d87
mkdir -p %{buildroot}%{_unitdir}
fa49311
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
fa49311
make install DESTDIR=%{buildroot}
61c1d87
install -m 755 %SOURCE1 %{buildroot}%{_unitdir}/%{name}.service
fa49311
install -m 640 %SOURCE2 %{buildroot}%{_sysconfdir}/sysconfig/%{name}
fa49311
# Remove installed docs since we pick this up another way
fa49311
rm -rf $RPM_BUILD_ROOT/usr/share/pads/
fa49311
fa49311
%clean
fa49311
rm -rf %{buildroot}
fa49311
fa49311
%post
61c1d87
#/sbin/chkconfig --add %{name}
61c1d87
if [ $1 -eq 1 ] ; then 
61c1d87
    # Initial installation 
61c1d87
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
61c1d87
fi
61c1d87
fa49311
fa49311
%preun
61c1d87
#if [ $1 = 0 ]; then
61c1d87
#        /sbin/service %{name} stop > /dev/null 2>&1 || :
61c1d87
#        /sbin/chkconfig --del %{name}
61c1d87
#fi
61c1d87
if [ $1 -eq 0 ] ; then
61c1d87
    # Package removal, not upgrade
61c1d87
    /bin/systemctl --no-reload pads.service > /dev/null 2>&1 || :
61c1d87
    /bin/systemctl stop pads.service > /dev/null 2>&1 || :
fa49311
fi
fa49311
61c1d87
fa49311
%postun
61c1d87
#if [ "$1" -ge "1" ]; then
61c1d87
#        /sbin/service %{name} condrestart >/dev/null 2>&1 || :
61c1d87
#fi
61c1d87
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
61c1d87
if [ $1 -ge 1 ] ; then
61c1d87
    # Package upgrade, not uninstall
61c1d87
    /bin/systemctl try-restart pads.service >/dev/null 2>&1 || :
fa49311
fi
fa49311
61c1d87
%triggerun -- pads < 1.2-8
61c1d87
# Save the current service runlevel info
61c1d87
# User must manually run systemd-sysv-convert --apply pads
61c1d87
# to migrate them to systemd targets
61c1d87
/usr/bin/systemd-sysv-convert --save pads >/dev/null 2>&1 ||:
61c1d87
61c1d87
# Run these because the SysV package being removed won't do them
61c1d87
/sbin/chkconfig --del pads >/dev/null 2>&1 || :
61c1d87
/bin/systemctl try-restart pads.service >/dev/null 2>&1 || :
61c1d87
61c1d87
fa49311
%files
fa49311
%defattr(-,root,root,-)
fa49311
%doc doc/AUTHORS doc/COPYING doc/README doc/ChangeLog
fa49311
%{_sysconfdir}/pads-ether-codes
fa49311
%{_sysconfdir}/pads-signature-list
fa49311
%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/pads.conf
fa49311
%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/sysconfig/%{name}
61c1d87
%attr(0755,root,root) %{_unitdir}/%{name}.service
fa49311
%{_bindir}/pads
fa49311
%{_bindir}/pads-report
fa49311
%{_mandir}/*/*
fa49311
fa49311
%changelog
61c1d87
* Mon Feb 20 2012 Jon Ciesla <limburgher@gmail.com> - 1.2-8
61c1d87
- Migrate to systemd, BZ 661632.
61c1d87
8175dc5
* Fri Feb 10 2012 Petr Pisar <ppisar@redhat.com> - 1.2-7
8175dc5
- Rebuild against PCRE 8.30
8175dc5
d03110f
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-6
d03110f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
d03110f
77e944f
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-5
77e944f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
77e944f
fcb477b
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-4
fcb477b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
fcb477b
758410f
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-3
758410f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
758410f
a2cb05a
* Tue Oct 28 2008 Steve Grubb <sgrubb@redhat.com> 1.2-2
221fa0f
- Update CFLAGS for newer libprelude (#465964)
a2cb05a
fa49311
* Tue Aug 12 2008 Steve Grubb <sgrubb@redhat.com> 1.2-1
fa49311
 Initial rpm build with many bug fixes