Blob Blame History Raw
%bcond_without  fedora

%global uid 40
%global username flow-tools
%global homedir %{_localstatedir}/%{name}
%global gecos "Network flow monitoring"

Version: 0.68.3
Name: flow-tools
Summary: Tool set for working with NetFlow data
Release: 1%{?dist}
Group: Applications/System
License: BSD 
URL: http://code.google.com/p/%{name}/
Source0: http://%{name}.googlecode.com/files/%{name}-%{version}.tar.bz2
Source1: flow-capture.init
Source2: flow-capture.sysconfig
Requires: rrdtool-python
BuildRequires: openssl-devel mysql-devel postgresql-devel zlib-devel 
BuildRequires: bison flex tcp_wrappers
BuildRequires: fedora-usermgmt-devel
%{?FE_USERADD_REQ}
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Requires(post): initscripts chkconfig
Requires(preun): initscripts chkconfig
Requires(postun): initscripts
Provides: group(%username) = %uid
Provides: user(%username) = %uid


%description
Flow-tools is library and a collection of programs used to collect, 
send, process, and generate reports from NetFlow data. The tools can be 
used together on a single server or distributed to multiple servers for 
large deployments. The flow-toools library provides an API for development 
of custom applications for NetFlow export versions 1,5,6 and the 14 currently 
defined version 8 subversions. A Perl and Python interface have been 
contributed and are included in the distribution.

%package devel
Summary: Development files for flow-tools
Group: Development/Libraries
Requires: %{name} = %{version}-%{release} zlib-devel

%description devel
Flow-tools is library and a collection of programs used to collect,
send, process, and generate reports from NetFlow data. The tools can be
used together on a single server or distributed to multiple servers for
large deployments. The flow-toools library provides an API for development
of custom applications for NetFlow export versions 1,5,6 and the 14 currently
defined version 8 subversions. A Perl and Python interface have been
contributed and are included in the distribution.

This package contains header files required to build applications that use
libft.

%prep
%setup -qn %{name}-%{version}

%build
%configure \
  --localstatedir=%{_localstatedir}/%{name} \
  --sysconfdir=%{_sysconfdir}/%{name} \
  --enable-static=no \
  --with-mysql \
  --with-postgresql \
  --with-openssl

make RPM_OPT_FLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/%{name}
install -d $RPM_BUILD_ROOT%{_initrddir}
install -m 0755 %SOURCE1 $RPM_BUILD_ROOT%{_initrddir}/flow-capture
install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
install -m 0644 %SOURCE2 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/flow-capture

%clean
rm -rf $RPM_BUILD_ROOT

%pre
%__fe_groupadd %uid -r %username &>/dev/null || :
%__fe_useradd  %uid -r -s /sbin/nologin -d %homedir -M          \
                    -c '%gecos' -g %username %username &>/dev/null || :

%post
/sbin/ldconfig
/sbin/chkconfig --add flow-capture

%preun
if [ $1 = 0 ]; then
        /sbin/service flow-capture stop >/dev/null 2>&1
        /sbin/chkconfig --del flow-capture
fi

%postun
/sbin/ldconfig
if [ "$1" -ge "1" ]; then
        /sbin/service flow-capture condrestart >/dev/null 2>&1 || :
fi

%__fe_userdel  %username &>/dev/null || :
%__fe_groupdel %username &>/dev/null || :

%files 
%defattr(-,root,root)
%doc README README.fork INSTALL TODO COPYING SECURITY ChangeLog ChangeLog.old
%doc docs/*.html
%{_mandir}/man1/*
%{_bindir}/*
%{_libdir}/*.so.*
%dir %{_sysconfdir}/%{name}/
%dir %{_sysconfdir}/%{name}/cfg/
%dir %{_sysconfdir}/%{name}/sym/
%config(noreplace) %{_sysconfdir}/%{name}/cfg/*
%config(noreplace) %{_sysconfdir}/%{name}/sym/*
%config(noreplace) %{_sysconfdir}/sysconfig/flow-capture
%{_initrddir}/flow-capture
%attr(-,flow-tools,flow-tools) %{_localstatedir}/%{name}/
%dir %{_datadir}/%{name}/
%{_datadir}/%{name}/*

%files devel
%defattr(-,root,root,-)
%{_libdir}/*.so
%{_includedir}/*.h

%changelog
* Mon Nov 12 2007 Paul P Komkoff Jr <i@stingr.net> - 0.68.3-1
- new upstream release
- build tools as PIE
- get rid of ftpaths.h
- do not ship ftconfig.c
- do not require libft

* Sat Nov  3 2007 Paul P Komkoff Jr <i@stingr.net> - 0.68.2-1
- New upstream release

* Thu Sep 13 2007 Orion Poplawski <orion@cora.nwra.com> - 0.68.1-2
- Add user and init scripts

* Sun Aug  5 2007 Paul P Komkoff Jr <i@stingr.net> - 0.68.1-1
- New upstream release

* Sun Jul 15 2007 Paul P Komkoff Jr <i@stingr.net> - 0.68.1-0.1.rc3
- New upstream rc

* Sun Jul 15 2007 Paul P Komkoff Jr <i@stingr.net> - 0.68.1-0.1.rc2
- Switch to 0.68.1 fork
- Drop all patches
- Sanitize spec

* Sun Mar 25 2007 Paul P Komkoff Jr <i@stingr.net> - 0.68-16
- getopt() is now in unistd.h

* Sun Mar 18 2007 Paul P Komkoff Jr <i@stingr.net> - 0.68-15
- Add runtime dependency for python-rrdtool

* Fri Dec 15 2006 Paul P. Komkoff Jr <i@stingr.net>
- rebuilt

* Thu Dec 14 2006 Jason L Tibbitts III <tibbs@math.uh.edu> - 0.68-13
- Rebuild for new Postgres

* Thu Nov 16 2006 Paul P Komkoff Jr <i@stingr.net> - 0.68-12
- Fix flow report 72 (by reaper@surnet.ru) bz#212928

* Sun Sep 10 2006 Paul P Komkoff Jr <i@stingr.net> - 0.68-11
- rebuild

* Sun Jul  9 2006 Paul P Komkoff Jr <i@stingr.net> 0.68-10
- Rebuild

* Sun Jul  9 2006 Paul P Komkoff Jr <i@stingr.net> 0.68-9
- Fix build in mock with minimal build environment #197706

* Sat Jun 10 2006 Paul P Komkoff Jr <i@stingr.net> 0.68-8
- Split patches in more convenient way (and bug upstream)
- Fix 2 unitialized variable bugs

* Sun Feb 19 2006 Paul P Komkoff Jr <i@stingr.net> 0.68-7
- Rebuild

* Mon Nov 14 2005 Paul P Komkoff Jr <i@stingr.net> 0.68-6
- Rebuild

* Sun Oct 30 2005 Paul P Komkoff Jr <i@stingr.net> 0.68-5
- Fix flow-capture segfaults on platforms with 64bit time_t

* Thu Oct 20 2005 Paul P Komkoff Jr <i@stingr.net> 0.68-4
- Fix accidential damage

* Wed Oct 19 2005 Paul P Komkoff Jr <i@stingr.net> 0.68-3
- add zlib-devel to build-requires of main package and to
  requires of -devel package

* Tue Sep  6 2005 Tom "spot" Callaway <tcallawa@redhat.com> 0.68-2
- simplify %%files
- use more macros
- change Group to Application/System
- own/create %{_localstatedir}/ft/
- add BR: autoconf
- don't need generic INSTALL
- mark config files as such
- own all directories we create
- run ldconfig on post/postun

* Tue Sep  6 2005 Paul P Komkoff Jr <i@stingr.net> 0.68-1
- Submit to fedora-extras
- Change volatile data location to /var/ft and nonvolatile
  to /etc/flow-tools (FHS)
- Make libft shared library
- Split to plain/devel

* Fri Jan  7 2004 William Emmanuel S. Yu <wyu@ateneo.edu>
- updated RPM file for version 0.67

* Tue Aug  8 2003 William Emmanuel S. Yu <wyu@ateneo.edu>
- fixed SQL bug
- update flow-export documentation

* Tue Apr 29 2003 William Emmanuel S. Yu <wyu@ateneo.edu>
- add support for checking null symbols filename

* Fri Apr  4 2003 William Emmanuel S. Yu <wyu@ateneo.edu>
- updated RPM file for version 0.66

* Fri Apr  4 2003 William Emmanuel S. Yu <wyu@ateneo.edu>
- updated RPM file for version 0.65
- included PostgreSQL support patch

* Mon Feb  3 2003 Larry Fahnoe <fahnoe@FahnoeTech.com>
- added makefile patches to use RPM_OPT_FLAGS
- added manpages and html files to spec file

* Tue Dec 17 2002 William Emmanuel S. Yu <wyu@ateneo.edu>
- added tagging and ip-port patches

* Thu Dec 12 2002 William Emmanuel S. Yu <wyu@ateneo.edu>
- updated RPM file for version 0.63

* Wed Oct 16 2002 William Emmanuel S. Yu <wyu@ateneo.edu>
- initial creation of RPM file for version 0.62