File nethogs.spec of Package nethogs

#
# spec file for package nethogs
#
# Copyright (c) 2008 SOAD Project, Russia.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bug fixes or comments to Maintainer:
# sda00@himki.net
#

# norootforbuild

Name:			nethogs
Version:		0.6.1.pre2
Release:		SOAD.1
Summary:		NetHogs groups bandwidth by process id
License:		GPL
Group:			Network/Tools
URL:			http://nethogs.sourceforge.net/abmode=1
Source:			%{name}-0.6.1-pre2.tar.gz
Source1:		cui.cpp.patch
Source2:		patch1
BuildRequires:	gcc-c++
BuildRequires:	libpcap-devel
BuildRequires:	libpcap
BuildRequires:	ncurses-devel ncurses
BuildRoot:		%{_tmppath}/%{name}-%{version}-build

%description
NetHogs is a small 'net top' tool. Instead of breaking the traffic down per packet type or per subnet, like most similar tools do, this groups bandwidth by process, and does not rely on a special kernel module to be loaded. So if there's suddenly a lot of network traffic, you can immediately see which PID is causing this, and, if it's some kind of spinning process, kill it.

Author:
Arnout Engelen  arnoutfm@bzzt.net

%prep
rm -rf "$RPM_BUILD_ROOT"
%{?suse_update_config:%{suse_update_config -f}} 

%build
%install

cd  $RPM_BUILD_ROOT
tar  xf  $RPM_SOURCE_DIR/%{name}-0.6.1-pre2.tar.gz
cd %{name}
patch -p0 < $RPM_SOURCE_DIR/cui.cpp.patch
patch -p0 < $RPM_SOURCE_DIR/patch1

# %__sed -i -e 's|-shared|-shared -fPIC|g' \
#	Makefile.in
#%__sed -i -e 's|-Wall|-Wall -fPIC|g' \
#	Makefile.in
mkdir -p %{buildroot}/usr/bin
mkdir -p %{buildroot}/usr/share/man/man8
make
make DESTDIR=$RPM_BUILD_ROOT install

#%makeinstall

# we don't need .a and .la files
find %{buildroot}/ -type f  -iname '*.la' -exec %__rm {} \;
find %{buildroot}/ -type f  -iname '*.a'  -exec %__rm {} \;
## find $RPM_BUILD_ROOT/ -type f -perm 755  -exec strip -s {} \;
rm -rf %{buildroot}/nethogs
# we don't need files which are not related to XMMS

# done by doc-macro
#%__rm -r %{buildroot}/%{_datadir}/doc

%clean
rm -rf "$RPM_BUILD_ROOT"
[ -d "%{buildroot}" -a "%{buildroot}" != "" ] && %__rm -rf "%{buildroot}"

%files 
%defattr(-,root,root)
%{_bindir}/*
/usr/share/man/man8/nethogs.8.gz
# %exclude  /nethogs/*



%changelog
* Wed Aug 25 2008 SOAD project <sda00@himki.net> - 0.6.1-pre2
- first build for SUSE
openSUSE Build Service is sponsored by