File nnfc.spec of Package nnfc

# norootforbuild

%define ver 0.8.3
Name:           nnfc
BuildRequires:  libmysqlclient-devel postgresql-devel
License:        BSD
Group:          Productivity/Networking/Other
Summary:        New NetFlow Collector
Version:        %{ver}
URL:            http://sourceforge.net/projects/nnfc/
Release:        1.1
Source0:        nnfc-%{ver}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{ver}-build
Packager:       Alexey Kozodoev <kav@iao.ru>
AutoReqProv:    on

%description
nnfc is the New Netflow Collector. nnfc is aimed to be POSIX-
compliant, portable collector of flows, generated by Cisco and other
routers. It understands v1, v5 and v7 flows now. Support for v8 and v9
netflow will be added soon. All flows, collected by nnfc, may be stored
in databases or other places, using module interface of nnfc.


%prep
%setup -q
./configure --with-megabit --with-mysql --with-postgres \
        --prefix="%{_prefix}" --mandir="%{_mandir}" --libdir="%{_libdir}" \
        CFLAGS="%{optflags}"

%build
make %{?jobs:-j%{jobs}}
        CFLAGS="%{optflags}" \
        PREFIX="%{_prefix}" \
        LIBDIR="%{_libdir}" \
        MANDIR="%{_mandir}"

%install
make \
        CFLAGS="%{optflags}" \
        PREFIX="%{_prefix}" \
        LIBDIR="%{_libdir}" \
        MANDIR="%{_mandir}" \
        DESTDIR=%{buildroot} \
        install

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING INSTALL NEWS README THANKS TODO
%{_sbindir}/nnfc
%{_mandir}/man3/*
%{_mandir}/man5/*
%{_mandir}/man7/*
%{_mandir}/man8/*
%{_libdir}/nnfc/dump.la*
%{_libdir}/nnfc/dump.so*
%{_libdir}/nnfc/redirect.la*
%{_libdir}/nnfc/redirect.so*
%{_libdir}/nnfc/null.la*
%{_libdir}/nnfc/null.so*
%{_libdir}/nnfc/file.la*
%{_libdir}/nnfc/file.so*
%{_libdir}/nnfc/megabit.la*
%{_libdir}/nnfc/megabit.so*
/usr/share/nnfc/*
%{_libdir}/libnnfc.*

%clean
# clean up the hard disc after build
rm -rf $RPM_BUILD_ROOT

%package devel
License:        BSD
Summary:        Headers and libraries for nnfc
Group:          Development/Libraries/C and C++
Requires:       nnfc = %{ver}
AutoReqProv:    on

%description devel
Headers and libraries for developing additional modules for nnfc

%files devel
%defattr(-,root,root)
/usr/include/libnnfc.h
%{_libdir}/nnfc/*.a

%post -p /sbin/ldconfig devel

%postun -p /sbin/ldconfig devel

%package mysql
License:        BSD
Summary:        Mysql module for nnfc
Group:          Productivity/Networking/Other
Requires:       nnfc = %{ver} libmysqlclient15 libmysqlclient_r15
AutoReqProv:    on

%description mysql
Nnfc module for exporting data to MySQL

%files mysql
%defattr(-,root,root)
%{_libdir}/nnfc/mysql.la*
%{_libdir}/nnfc/mysql.so*

%post mysql -p /sbin/ldconfig

%postun mysql -p /sbin/ldconfig

%package postgresql
License:        BSD
Summary:        PostreSQL module for nnfc
Group:          Productivity/Networking/Other
Requires:       nnfc = %{ver} postgresql-libs
AutoReqProv:    on

%description postgresql
Nnfc module for exporting data to PostreSQL

%files postgresql
%defattr(-,root,root)
%{_libdir}/nnfc/postgres.la*
%{_libdir}/nnfc/postgres.so*

%post postgresql -p /sbin/ldconfig

%postun postgresql -p /sbin/ldconfig


%changelog
* Tue Feb 16 2008 kav@iao.ru
- initial release on Opensuse Build Service
openSUSE Build Service is sponsored by