1%define name super_mediator
2%define version @PACKAGE_VERSION@
3%define release 0
4
5Summary: IPFIX Super Mediator for use with the YAF and SiLK tools
6Name: %{name}
7Version: %{version}
8Release: %{release}%{dist}
9Group: Applications/System
10License: GPLv2
11Source: http://tools.netsa.cert.org/releases/%{name}-%{version}.tar.gz
12BuildRoot: %{_tmppath}/%{name}-%{version}
13Vendor: http://tools.netsa.cert.org/
14URL: http://tools.netsa.cert.org/super_mediator/
15Packager: Emily Sarneso <ecoff@cert.org>
16Requires(post): /sbin/ldconfig, /sbin/chkconfig
17Requires(preun): /sbin/chkconfig
18Requires(postun): /sbin/ldconfig
19
20%description
21super_mediator is an IPFIX mediator for use with the YAF and SiLK tools.
22It collects and filters YAF output data to various IPFIX collecting processes
23and/or csv files. super_mediator can be configured to perform de-duplication
24of DNS resource records, SSL certificates, or HTTP header fields as exported
25by YAF.
26
27%prep
28%setup -q -n %{name}-%{version}
29
30%build
31./configure --prefix=%{_prefix} @RPM_CONFIG_FLAGS@
32sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
33sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
34%{__make}
35
36%install
37rm -rf $RPM_BUILD_ROOT
38mkdir -p $RPM_BUILD_ROOT%{_binddir}
39%makeinstall
40
41mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d/
42install --mode=0755 etc/init.d/super_mediator $RPM_BUILD_ROOT%{_sysconfdir}/init.d/
43install --mode=0644 etc/super_mediator.conf $RPM_BUILD_ROOT%{_sysconfdir}
44
45%post
46/sbin/ldconfig
47function runlvl(){
48    ( /sbin/chkconfig --del $1 || true )
49    /sbin/chkconfig --add $1
50    /sbin/chkconfig --levels 345 $1 on
51    /sbin/chkconfig --levels 016 $1 off
52}
53
54%postun -p /sbin/ldconfig
55
56%preun
57if [ "$1" = 0 ]; then
58    /sbin/chkconfig --del yaf
59fi
60
61%clean
62rm -rf $RPM_BUILD_ROOT
63
64%files
65%defattr(-, root, root)
66%doc NEWS README
67%{_bindir}/super_mediator
68%if "x@SM_REQ_MYSQL@" == "x1"
69%{_bindir}/super_table_creator
70%endif
71%{_mandir}/man*/*
72%config(noreplace) %{_sysconfdir}/super_mediator.conf
73%attr(755,root,root) %{_sysconfdir}/init.d/super_mediator
74
75%changelog
76