Blob Blame History Raw
Summary: Generate a readout of the current bandwidth use
Name: bwbar
Version: 1.2.3
Release: 7%{?dist}
License: GPLv2+
Group: System Environment/Base
Source0: http://www.kernel.org/pub/software/web/bwbar/bwbar-1.2.3.tar.bz2
Source1: bwbar
Source2: bwbar.8
Patch0: bwbar.daemon.patch
Patch1: bwbar.debian-010_directory_option.patch
Patch2: bwbar.debian-020_proc_net_2.6.x_fix.patch
URL: http://www.kernel.org/pub/software/web/bwbar/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libpng-devel
Requires(post): chkconfig
Requires(preun): chkconfig /sbin/service

%description
bwbar is a small program that generates a text and a graphical readout
of the current bandwidth use.  It is currently for Linux only.

%prep
%setup -q
%patch0 -p1
%patch1 -p0
%patch2 -p0

%build
%configure
%{__make} %{?_smp_mflags}

%install
%{__rm} -rf $RPM_BUILD_ROOT
%{__mkdir_p} $RPM_BUILD_ROOT%{_bindir}
%{__mkdir_p} $RPM_BUILD_ROOT%{_mandir}/man8
%{__mkdir_p} $RPM_BUILD_ROOT%{_initrddir}
%{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
%{__install} -m 755 %{name} $RPM_BUILD_ROOT%{_bindir}
%{__install} -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}
%{__install} -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man8

%{__cat} >> $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/bwbar << END
#OPTIONS="-D eth0 100 -d /path/to/outdir"
#BWBAR_USER="please_define_a_user"
END

%post
if [ "$1" -eq "1" ]; then
        /sbin/chkconfig --add %{name}
fi

%preun
if [ "$1" -eq "0" ]; then
        /sbin/service %{name} stop > /dev/null 2>&1
        /sbin/chkconfig --del %{name}
fi


%clean
%{__rm} -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root, 0755)
%doc README
%{_bindir}/%{name}
%{_mandir}/man8/*
%{_initrddir}/%{name}
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}

%changelog
* Thu Mar 31 2011 Adrian Reber <adrian@lisas.de> - 1.2.3-7
- fix patch (**** rejecting target file name with ".." component)

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Mon Sep 01 2008 Adrian Reber <adrian@lisas.de> - 1.2.3-3
- recreated bwbar.daemon.patch to apply cleanly

* Fri Feb 15 2008 Adrian Reber <adrian@lisas.de> - 1.2.3-2
- rebuilt for gcc43

* Sat Aug 25 2007 Adrian Reber <adrian@lisas.de> - 1.2.3-1
- updated to 1.2.3
- adapted daemon patch
- fixed some rpmlint warnings/errors

* Mon Sep 11 2006 Adrian Reber <adrian@lisas.de> - 1.2.2-5
- rebuilt

* Wed Feb 13 2006 Adrian Reber <adrian@lisas.de> - 1.2.2-4
- rebuilt

* Fri Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
- rebuilt

* Fri Jul 23 2004 Adrian Reber <adrian@lisas.de> - 0:1.2.2-0.fdr.2
- changed the daemon patch to use -D and --Daemon
- added a debian patch to specify an output directory
- added another debian patch
- added the man page (also from the debian package)

* Fri Jul 16 2004 Adrian Reber <adrian@lisas.de> - 0:1.2.2-0.fdr.1
- Initial RPM release.