File netams.spec of Package NetAms

Name:           netams
Version:        3.4.1rc1
Release:        1
License:        GPL v3
Source:         %{name}-%{version}.tar.bz2
Group:          Productivity/Networking/Other
Summary:        Network Traffic Accounting and Management Service
BuildRequires:  iptables-devel, libpcap-devel, mysql, mysql-devel, openssl-devel, gcc, gcc-c++ 
Requires:       iptables-devel, libpcap-devel, mysql
URL:            http://www.netams.com/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Packager:       XAOC <bitbox@bk.ru>

%description
 NeTAMS is a Network Traffic Accounting and Monitoring Software. It
 collects an IP traffic information flowing via your PC/UNIX or Cisco
 router, filters it, aggregates, stores onto HASH/SQL database, and
 makes SMTP/HTML reports to site administrator. Anoter features are
 flexible policy targets, firewalling, access control, quotas,
 scheduler and much much more.


%prep
%setup -q

%build
./configure.sh $RPM_BUILD_ROOT
make

%postun
%insserv_cleanup

%preun
%stop_on_removal

%install
mkdir -m 755 $RPM_BUILD_ROOT/etc
mkdir -m 755 $RPM_BUILD_ROOT/etc/init.d
mkdir -m 755 $RPM_BUILD_ROOT/var
mkdir -m 755 $RPM_BUILD_ROOT/srv
mkdir -m 755 $RPM_BUILD_ROOT/srv/www
mkdir -m 755 $RPM_BUILD_ROOT/srv/www/htdocs
mkdir -m 755 $RPM_BUILD_ROOT/srv/www/htdocs/netams
mkdir -m 755 $RPM_BUILD_ROOT/usr
mkdir -m 755 $RPM_BUILD_ROOT/usr/sbin
mkdir -m 755 $RPM_BUILD_ROOT/usr/share
mkdir -m 755 $RPM_BUILD_ROOT/usr/share/man
make install


%clean
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)
/etc/netams/*
/etc/netams/.netamsctl.rc
/etc/apache2/sites-available/*
/etc/init.d/*
/usr/sbin/*
/usr/share/man/man8/*
/srv/www/htdocs/netams/*
/srv/www/htdocs/netams/*/*
/srv/www/htdocs/netams/*/*/*

%changelog