File ipac-ng.spec of Package ipac-ng
#
# spec file for package ipac-ng
#
# Copyright (c) 2015 Peter Conrad <obs@quisquis.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
Summary: IP accounting next generation
Name: ipac-ng
Version: 1.34.2
Release: 1
License: GPL-2.0+
Group: System/Monitoring
URL: http://ipac-ng.sourceforge.net/
Source: http://download.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{version}.tar.bz2
Source1: ipac.conf
Source2: rules.conf
Patch2: ipac-ng-manpage.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: gdbm-devel, bison, flex, iptables
Requires: perl-GD
%if 0%{?suse_version} <= 1210
BuildRequires: iptables-devel
%else
BuildRequires: libiptc-devel, libxtables-devel
%endif
%if 0%{?suse_version} >= 1100 && 0%{?suse_version} < 1150
BuildRequires: licenses
Requires: licenses
%endif
%description
ipac is a package which is designed to gather, summarize and nicely
output the IP accounting data. ipac make summaries and graphs as ascii
text and/or images with graphs.
%prep
%setup -q -n %{name}
%patch2 -p0
iptables_include="`ls -d /usr/include/iptables-* /usr/include/*/iptables 2>/dev/null | head -1`"
if [ -n "$iptables_include" -a -d "$iptables_include" ]; then
export CFLAGS="-I$iptables_include"
fi
%configure
%build
iptables_include="`ls -d /usr/include/iptables-* /usr/include/*/iptables 2>/dev/null | head -1`"
if [ -n "$iptables_include" -a -d "$iptables_include" ]; then
export CFLAGS="-I$iptables_include"
fi
make CFLAGS="$CFLAGS %{optflags} -g" LDFLAGS=-g all
lic="`md5sum COPYING | cut -d' ' -f 1`"
if [ -r "/usr/share/doc/licenses/md5/$lic" ]; then
ln -sf /usr/share/doc/licenses/md5/"$lic" COPYING
fi
%install
%__make DESTDIR="%{buildroot}" doinstall
%__mkdir_p "%{buildroot}%{_sysconfdir}/ipac-ng"
%__install -m 644 %{S:1} "%{buildroot}%{_sysconfdir}/ipac-ng/ipac.conf"
%__install -m 644 %{S:2} "%{buildroot}%{_sysconfdir}/ipac-ng/rules.conf"
%__mkdir_p "%{buildroot}%{_localstatedir}/lib/ipac"
#%%__debug_install_post
%clean
[ "%{buildroot}" != "/" ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%doc CHANGELOG COPYING doc README TODO contrib/sample_configs
%config(noreplace) /etc/ipac-ng/
%{_sbindir}/fetchipac
%{_sbindir}/ipac-convert
%{_sbindir}/ipacsum
%{_localstatedir}/lib/ipac/
%{_mandir}/man8/fetchipac.8.gz
%{_mandir}/man8/ipac-convert.8.gz
%{_mandir}/man8/ipacsum.8.gz
%changelog