6524d5c
%bcond_without  fedora
6524d5c
6524d5c
%global uid 40
6524d5c
%global username flow-tools
6524d5c
%global homedir %{_localstatedir}/%{name}
6524d5c
%global gecos "Network flow monitoring"
6524d5c
2bd985a
Version: 0.68.5.1
cc09909
Name: flow-tools
cc09909
Summary: Tool set for working with NetFlow data
335074e
Release: 6%{?dist}
cc09909
Group: Applications/System
cc09909
License: BSD 
8a000ee
URL: http://code.google.com/p/%{name}/
3361e09
Source0: http://%{name}.googlecode.com/files/%{name}-%{version}.tar.bz2
111c79b
Source1: flow-capture.service
6524d5c
Source2: flow-capture.sysconfig
8a000ee
BuildRequires: openssl-devel mysql-devel postgresql-devel zlib-devel 
3361e09
BuildRequires: bison flex tcp_wrappers-devel
e977e47
BuildRequires: fedora-usermgmt-devel doxygen
6524d5c
%{?FE_USERADD_REQ}
8a000ee
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
111c79b
Requires(post): systemd-units
111c79b
Requires(preun): systemd-units
111c79b
Requires(postun): systemd-units
111c79b
# For triggerun
111c79b
Requires(post): systemd-sysv
6524d5c
Provides: group(%username) = %uid
6524d5c
Provides: user(%username) = %uid
6524d5c
cc09909
cc09909
%description
cc09909
Flow-tools is library and a collection of programs used to collect, 
cc09909
send, process, and generate reports from NetFlow data. The tools can be 
cc09909
used together on a single server or distributed to multiple servers for 
cc09909
large deployments. The flow-toools library provides an API for development 
cc09909
of custom applications for NetFlow export versions 1,5,6 and the 14 currently 
cc09909
defined version 8 subversions. A Perl and Python interface have been 
cc09909
contributed and are included in the distribution.
cc09909
cc09909
%package devel
cc09909
Summary: Development files for flow-tools
cc09909
Group: Development/Libraries
a381234
Requires: %{name} = %{version}-%{release} zlib-devel
cc09909
cc09909
%description devel
cc09909
Flow-tools is library and a collection of programs used to collect,
cc09909
send, process, and generate reports from NetFlow data. The tools can be
cc09909
used together on a single server or distributed to multiple servers for
cc09909
large deployments. The flow-toools library provides an API for development
cc09909
of custom applications for NetFlow export versions 1,5,6 and the 14 currently
cc09909
defined version 8 subversions. A Perl and Python interface have been
cc09909
contributed and are included in the distribution.
cc09909
cc09909
This package contains header files required to build applications that use
cc09909
libft.
cc09909
1f4bb0e
%package rrdtool
1f4bb0e
Summary: Scripts for flow-tools to build rrd graphs
1f4bb0e
Group: Applications/System
1f4bb0e
Requires: %{name} = %{version}-%{release} rrdtool-python
1f4bb0e
1f4bb0e
%description rrdtool
1f4bb0e
Flow-tools is library and a collection of programs used to collect,
1f4bb0e
send, process, and generate reports from NetFlow data. The tools can be
1f4bb0e
used together on a single server or distributed to multiple servers for
1f4bb0e
large deployments. The flow-toools library provides an API for development
1f4bb0e
of custom applications for NetFlow export versions 1,5,6 and the 14 currently
1f4bb0e
defined version 8 subversions. A Perl and Python interface have been
1f4bb0e
contributed and are included in the distribution.
1f4bb0e
1f4bb0e
This package contains scripts that use python-rrdtool to create rrds and graphs
1f4bb0e
from flow data.
1f4bb0e
1f4bb0e
%package docs
1f4bb0e
Summary: HTML and other redundant docs for flow-tools
1f4bb0e
Group: Applications/System
1f4bb0e
Requires: %{name} = %{version}-%{release}
1f4bb0e
1f4bb0e
%description docs
1f4bb0e
Flow-tools is library and a collection of programs used to collect,
1f4bb0e
send, process, and generate reports from NetFlow data. The tools can be
1f4bb0e
used together on a single server or distributed to multiple servers for
1f4bb0e
large deployments. The flow-toools library provides an API for development
1f4bb0e
of custom applications for NetFlow export versions 1,5,6 and the 14 currently
1f4bb0e
defined version 8 subversions. A Perl and Python interface have been
1f4bb0e
contributed and are included in the distribution.
1f4bb0e
1f4bb0e
This package contains additional documentation, such as man pages in html format.
1f4bb0e
cc09909
%prep
3361e09
%setup -q
cc09909
cc09909
%build
8a000ee
%configure \
Orion Poplawski 25842a8
  LDFLAGS=-L%{_libdir}/mysql \
8a000ee
  --localstatedir=%{_localstatedir}/%{name} \
8a000ee
  --sysconfdir=%{_sysconfdir}/%{name} \
8a000ee
  --enable-static=no \
8a000ee
  --with-mysql \
8a000ee
  --with-postgresql \
8a000ee
  --with-openssl
8a000ee
1f4bb0e
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
1f4bb0e
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
1f4bb0e
cc09909
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
cc09909
cc09909
%install
cc09909
rm -rf $RPM_BUILD_ROOT
8a000ee
make DESTDIR=$RPM_BUILD_ROOT install
cc09909
find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'
8a000ee
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/%{name}
111c79b
install -d $RPM_BUILD_ROOT%{_unitdir}
111c79b
install -m 0644 %SOURCE1 $RPM_BUILD_ROOT%{_unitdir}/flow-capture.service
6524d5c
install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
6524d5c
install -m 0644 %SOURCE2 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/flow-capture
cc09909
cc09909
%clean
cc09909
rm -rf $RPM_BUILD_ROOT
cc09909
6524d5c
%pre
6524d5c
%__fe_groupadd %uid -r %username &>/dev/null || :
6524d5c
%__fe_useradd  %uid -r -s /sbin/nologin -d %homedir -M          \
6524d5c
                    -c '%gecos' -g %username %username &>/dev/null || :
6524d5c
6524d5c
%post
6524d5c
/sbin/ldconfig
111c79b
if [ $1 -eq 1 ] ; then 
111c79b
    # Initial installation 
111c79b
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
111c79b
fi
cc09909
6524d5c
%preun
111c79b
if [ $1 -eq 0 ] ; then
111c79b
    # Package removal, not upgrade
111c79b
    /bin/systemctl --no-reload disable flow-capture.service > /dev/null 2>&1 || :
111c79b
    /bin/systemctl stop flow-capture.service > /dev/null 2>&1 || :
6524d5c
fi
6524d5c
6524d5c
%postun
6524d5c
/sbin/ldconfig
111c79b
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
111c79b
if [ $1 -ge 1 ] ; then
111c79b
    # Package upgrade, not uninstall
111c79b
    /bin/systemctl try-restart flow-capture.service >/dev/null 2>&1 || :
6524d5c
fi
6524d5c
111c79b
%triggerun -- flow-tools < 0.68.5.1-5
111c79b
# Save the current service runlevel info
111c79b
# User must manually run systemd-sysv-convert --apply flow-capture
111c79b
# to migrate them to systemd targets
111c79b
/usr/bin/systemd-sysv-convert --save flow-capture >/dev/null 2>&1 ||:
111c79b
111c79b
# Run these because the SysV package being removed won't do them
111c79b
/sbin/chkconfig --del flow-capture >/dev/null 2>&1 || :
111c79b
/bin/systemctl try-restart flow-capture.service >/dev/null 2>&1 || :
cc09909
cc09909
%files 
cc09909
%defattr(-,root,root)
1f4bb0e
%doc README README.fork COPYING ChangeLog
1f4bb0e
%{_mandir}/man1/flow-capture.1*
1f4bb0e
%{_mandir}/man1/flow-cat.1*
1f4bb0e
%{_mandir}/man1/flow-dscan.1*
1f4bb0e
%{_mandir}/man1/flow-expire.1*
1f4bb0e
%{_mandir}/man1/flow-export.1*
1f4bb0e
%{_mandir}/man1/flow-fanout.1*
1f4bb0e
%{_mandir}/man1/flow-filter.1*
1f4bb0e
%{_mandir}/man1/flow-gen.1*
1f4bb0e
%{_mandir}/man1/flow-header.1*
1f4bb0e
%{_mandir}/man1/flow-import.1*
1f4bb0e
%{_mandir}/man1/flow-mask.1*
1f4bb0e
%{_mandir}/man1/flow-merge.1*
1f4bb0e
%{_mandir}/man1/flow-nfilter.1*
1f4bb0e
%{_mandir}/man1/flow-print.1*
1f4bb0e
%{_mandir}/man1/flow-receive.1*
1f4bb0e
%{_mandir}/man1/flow-report.1*
1f4bb0e
%{_mandir}/man1/flow-rptfmt.1*
1f4bb0e
%{_mandir}/man1/flow-send.1*
1f4bb0e
%{_mandir}/man1/flow-split.1*
1f4bb0e
%{_mandir}/man1/flow-stat.1*
1f4bb0e
%{_mandir}/man1/flow-tag.1*
1f4bb0e
%{_mandir}/man1/flow-tools-examples.1*
1f4bb0e
%{_mandir}/man1/flow-tools.1*
1f4bb0e
%{_mandir}/man1/flow-xlate.1*
1f4bb0e
%{_bindir}/flow-capture
1f4bb0e
%{_bindir}/flow-cat
1f4bb0e
%{_bindir}/flow-dscan
1f4bb0e
%{_bindir}/flow-expire
1f4bb0e
%{_bindir}/flow-export
1f4bb0e
%{_bindir}/flow-fanout
1f4bb0e
%{_bindir}/flow-filter
1f4bb0e
%{_bindir}/flow-gen
1f4bb0e
%{_bindir}/flow-header
1f4bb0e
%{_bindir}/flow-import
1f4bb0e
%{_bindir}/flow-mask
1f4bb0e
%{_bindir}/flow-merge
1f4bb0e
%{_bindir}/flow-nfilter
1f4bb0e
%{_bindir}/flow-print
1f4bb0e
%{_bindir}/flow-receive
1f4bb0e
%{_bindir}/flow-report
1f4bb0e
%{_bindir}/flow-rptfmt
1f4bb0e
%{_bindir}/flow-send
1f4bb0e
%{_bindir}/flow-split
1f4bb0e
%{_bindir}/flow-stat
1f4bb0e
%{_bindir}/flow-tag
1f4bb0e
%{_bindir}/flow-xlate
cc09909
%{_libdir}/*.so.*
8a000ee
%dir %{_sysconfdir}/%{name}/
8a000ee
%dir %{_sysconfdir}/%{name}/cfg/
8a000ee
%dir %{_sysconfdir}/%{name}/sym/
8a000ee
%config(noreplace) %{_sysconfdir}/%{name}/cfg/*
8a000ee
%config(noreplace) %{_sysconfdir}/%{name}/sym/*
6524d5c
%config(noreplace) %{_sysconfdir}/sysconfig/flow-capture
111c79b
%{_unitdir}/flow-capture.service
6524d5c
%attr(-,flow-tools,flow-tools) %{_localstatedir}/%{name}/
8a000ee
%dir %{_datadir}/%{name}/
8a000ee
%{_datadir}/%{name}/*
cc09909
cc09909
%files devel
cc09909
%defattr(-,root,root,-)
cc09909
%{_libdir}/*.so
cc09909
%{_includedir}/*.h
cc09909
1f4bb0e
%files rrdtool
1f4bb0e
%defattr(-,root,root)
1f4bb0e
%{_bindir}/flow-rpt2rrd
1f4bb0e
%{_bindir}/flow-log2rrd
1f4bb0e
%{_mandir}/man1/flow-rpt2rrd.1*
1f4bb0e
%{_mandir}/man1/flow-log2rrd.1*
1f4bb0e
1f4bb0e
%files docs
1f4bb0e
%defattr(-,root,root)
1f4bb0e
%doc docs/*.html ChangeLog.old TODO INSTALL SECURITY
1f4bb0e
cc09909
%changelog
335074e
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.68.5.1-6
335074e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
335074e
111c79b
* Tue Apr 24 2012 Jon Ciesla <limburgher@gmail.com> - 0.68.5.1-5
111c79b
- Migrate to systemd, BZ 767392.
111c79b
15a177a
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.68.5.1-4
15a177a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
15a177a
Orion Poplawski 5f204eb
* Mon Mar 28 2011 Orion Poplawski <orion@cora.nwra.com> - 0.68.5.1-3
Orion Poplawski 5f204eb
- Rebuild for new mysql
Orion Poplawski 25842a8
- Add LDFLAGS for mysql on 64-bit
Orion Poplawski 5f204eb
f9bb1cf
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.68.5.1-2
f9bb1cf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
f9bb1cf
2bd985a
* Fri Aug 27 2010 Paul P. Komkoff Jr <i@stingr.net> - 0.68.5.1
2bd985a
- fix for EINTR while reading/writing in ftio.
2bd985a
adbc238
* Thu Feb 25 2010 Paul P Komkoff Jr <i@stingr.net> - 0.68.5
adbc238
- bunch of fixes from upstream
adbc238
034fa66
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 0.68.4.1-4
034fa66
- rebuilt with new openssl
034fa66
ae50959
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.68.4.1-3
ae50959
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
ae50959
dd9595b
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.68.4.1-2
dd9595b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
dd9595b
1f4bb0e
* Mon Feb  2 2009 Paul P Komkoff Jr <i@stingr.net> - 0.68.4.1-1
1f4bb0e
- fix for pcap generation, by Dave Plonka
1f4bb0e
- split out -rrdtool subpackage, for those who don't need rrdtool on their servers.
1f4bb0e
Caolan McNamara 75953c4
* Sat Jan 24 2009 Caolán McNamara <caolanm@redhat.com> - 0.68.4-2
Caolan McNamara 75953c4
- rebuild for dependencies
Caolan McNamara 75953c4
3361e09
* Mon Mar 31 2008 Paul P Komkoff Jr <i@stingr.net> - 0.68.4-1
3361e09
- New upstream version
3361e09
35a467b
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.68.4-0.2.rc1
35a467b
- Autorebuild for GCC 4.3
35a467b
e977e47
* Tue Feb 19 2008 Paul P Komkoff Jr <i@stingr.net> - 0.68.4-0.1.rc1
e977e47
- new upstream release candidate
e977e47
73ba4fd
* Fri Dec 07 2007 Release Engineering <rel-eng at fedoraproject dot org> - 0.68.3-2
73ba4fd
- Rebuild for deps
73ba4fd
a8ad477
* Mon Nov 12 2007 Paul P Komkoff Jr <i@stingr.net> - 0.68.3-1
a8ad477
- new upstream release
a8ad477
- build tools as PIE
a8ad477
- get rid of ftpaths.h
a8ad477
- do not ship ftconfig.c
a8ad477
- do not require libft
a8ad477
7699060
* Sat Nov  3 2007 Paul P Komkoff Jr <i@stingr.net> - 0.68.2-1
7699060
- New upstream release
7699060
6524d5c
* Thu Sep 13 2007 Orion Poplawski <orion@cora.nwra.com> - 0.68.1-2
6524d5c
- Add user and init scripts
6524d5c
bf685ee
* Sun Aug  5 2007 Paul P Komkoff Jr <i@stingr.net> - 0.68.1-1
bf685ee
- New upstream release
bf685ee
b8684ad
* Sun Jul 15 2007 Paul P Komkoff Jr <i@stingr.net> - 0.68.1-0.1.rc3
b8684ad
- New upstream rc
b8684ad
8a000ee
* Sun Jul 15 2007 Paul P Komkoff Jr <i@stingr.net> - 0.68.1-0.1.rc2
8a000ee
- Switch to 0.68.1 fork
8a000ee
- Drop all patches
8a000ee
- Sanitize spec
8a000ee
fb35041
* Sun Mar 25 2007 Paul P Komkoff Jr <i@stingr.net> - 0.68-16
fb35041
- getopt() is now in unistd.h
fb35041
3209043
* Sun Mar 18 2007 Paul P Komkoff Jr <i@stingr.net> - 0.68-15
3209043
- Add runtime dependency for python-rrdtool
3209043
ac8187c
* Fri Dec 15 2006 Paul P. Komkoff Jr <i@stingr.net>
ac8187c
- rebuilt
ac8187c
a119c43
* Thu Dec 14 2006 Jason L Tibbitts III <tibbs@math.uh.edu> - 0.68-13
a119c43
- Rebuild for new Postgres
a119c43
5314da1
* Thu Nov 16 2006 Paul P Komkoff Jr <i@stingr.net> - 0.68-12
5314da1
- Fix flow report 72 (by reaper@surnet.ru) bz#212928
5314da1
7796f6e
* Sun Sep 10 2006 Paul P Komkoff Jr <i@stingr.net> - 0.68-11
7796f6e
- rebuild
7796f6e
c626ff9
* Sun Jul  9 2006 Paul P Komkoff Jr <i@stingr.net> 0.68-10
c626ff9
- Rebuild
c626ff9
897d754
* Sun Jul  9 2006 Paul P Komkoff Jr <i@stingr.net> 0.68-9
897d754
- Fix build in mock with minimal build environment #197706
897d754
2edfb0e
* Sat Jun 10 2006 Paul P Komkoff Jr <i@stingr.net> 0.68-8
2edfb0e
- Split patches in more convenient way (and bug upstream)
2edfb0e
- Fix 2 unitialized variable bugs
2edfb0e
b76e121
* Sun Feb 19 2006 Paul P Komkoff Jr <i@stingr.net> 0.68-7
b76e121
- Rebuild
b76e121
b3df5d4
* Mon Nov 14 2005 Paul P Komkoff Jr <i@stingr.net> 0.68-6
b3df5d4
- Rebuild
b3df5d4
3eeb44a
* Sun Oct 30 2005 Paul P Komkoff Jr <i@stingr.net> 0.68-5
3eeb44a
- Fix flow-capture segfaults on platforms with 64bit time_t
3eeb44a
a285761
* Thu Oct 20 2005 Paul P Komkoff Jr <i@stingr.net> 0.68-4
a285761
- Fix accidential damage
a285761
a381234
* Wed Oct 19 2005 Paul P Komkoff Jr <i@stingr.net> 0.68-3
a381234
- add zlib-devel to build-requires of main package and to
a381234
  requires of -devel package
a381234
cc09909
* Tue Sep  6 2005 Tom "spot" Callaway <tcallawa@redhat.com> 0.68-2
cc09909
- simplify %%files
cc09909
- use more macros
cc09909
- change Group to Application/System
cc09909
- own/create %{_localstatedir}/ft/
cc09909
- add BR: autoconf
cc09909
- don't need generic INSTALL
cc09909
- mark config files as such
cc09909
- own all directories we create
cc09909
- run ldconfig on post/postun
cc09909
cc09909
* Tue Sep  6 2005 Paul P Komkoff Jr <i@stingr.net> 0.68-1
cc09909
- Submit to fedora-extras
cc09909
- Change volatile data location to /var/ft and nonvolatile
cc09909
  to /etc/flow-tools (FHS)
cc09909
- Make libft shared library
cc09909
- Split to plain/devel
cc09909
cc09909
* Fri Jan  7 2004 William Emmanuel S. Yu <wyu@ateneo.edu>
cc09909
- updated RPM file for version 0.67
cc09909
cc09909
* Tue Aug  8 2003 William Emmanuel S. Yu <wyu@ateneo.edu>
cc09909
- fixed SQL bug
cc09909
- update flow-export documentation
cc09909
cc09909
* Tue Apr 29 2003 William Emmanuel S. Yu <wyu@ateneo.edu>
cc09909
- add support for checking null symbols filename
cc09909
cc09909
* Fri Apr  4 2003 William Emmanuel S. Yu <wyu@ateneo.edu>
cc09909
- updated RPM file for version 0.66
cc09909
cc09909
* Fri Apr  4 2003 William Emmanuel S. Yu <wyu@ateneo.edu>
cc09909
- updated RPM file for version 0.65
cc09909
- included PostgreSQL support patch
cc09909
cc09909
* Mon Feb  3 2003 Larry Fahnoe <fahnoe@FahnoeTech.com>
cc09909
- added makefile patches to use RPM_OPT_FLAGS
cc09909
- added manpages and html files to spec file
cc09909
cc09909
* Tue Dec 17 2002 William Emmanuel S. Yu <wyu@ateneo.edu>
cc09909
- added tagging and ip-port patches
cc09909
cc09909
* Thu Dec 12 2002 William Emmanuel S. Yu <wyu@ateneo.edu>
cc09909
- updated RPM file for version 0.63
cc09909
cc09909
* Wed Oct 16 2002 William Emmanuel S. Yu <wyu@ateneo.edu>
cc09909
- initial creation of RPM file for version 0.62