%define _missing_doc_files_terminate_build 0
%define _unpackaged_files_terminate_build 0

%define desktop_file_utils_version 0.2.90
%define desktop_file 1

Summary: A PPP connection load monitor for KDE.
Name: kpppload
Version: 1.04
Release: 46
Source: ftp://ftp.interpath.net/pub/linuxberg/files/kde/network/%{name}-%{version}.tar.gz
Patch: kpppload-1.04-kde3.patch
Patch1: kpppload-1.04-multilib.patch
License: GPL
Group: Applications/Internet
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot

Requires: kdelibs >= 3.0.3

BuildPrereq: qt-devel >= 3.0.5
BuildPrereq: kdelibs-devel >= 3.0.3
BuildPrereq: XFree86-devel
BuildRequires: automake14 autoconf213 libtool

%if %{desktop_file}
BuildPrereq: desktop-file-utils >= %{desktop_file_utils_version}
%endif

Prefix: /usr

ExcludeArch: s390 s390x

%description
KPPPLoad is a PPP connection load monitor which works with KDE's
session management. KPPPLoad resembles xload.

%prep
%setup -q
%patch -p1 -b .kde3
%patch1 -p1

# the package comes with bad dependencies!
find . -name \*.o | xargs rm -f
find . -name \*.moc | xargs rm -f
find . -name .deps | xargs rm -fr

libtoolize --force
aclocal-1.4
automake-1.4 --add-missing
autoconf-2.13
autoheader-2.13

%build
export mlname=%{_lib}
QTDIR="" && . /etc/profile.d/qt.sh
export CXXFLAGS="$RPM_OPT_FLAGS -DNDEBUG -DNO_DEBUG -I/usr/include/kde"
export CFLAGS="$CXXFLAGS"
%configure

make clean all AUTOCONF=autoconf-2.13 AUTOHEADER=autoheader-2.13 \
        LDFLAGS="" %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
export PATH=`pwd`:$PATH

%makeinstall

mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps \
         $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps

convert $RPM_BUILD_ROOT%{_datadir}/icons/kpppload.xpm \
        $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/kpppload.png
convert $RPM_BUILD_ROOT%{_datadir}/icons/mini/kpppload.xpm \
        $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/kpppload.png

rm -rf $RPM_BUILD_ROOT%{_datadir}/icons/mini \
       $RPM_BUILD_ROOT%{_datadir}/icons/kpppload.xpm

# start desktop-file-install
%if %{desktop_file}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install --vendor kde \
   --dir $RPM_BUILD_ROOT%{_datadir}/applications \
   --add-category "Application;Internet;X-Red-Hat-Base" \
   --add-only-show-in KDE \
   $RPM_BUILD_ROOT%{_datadir}/applnk/*/*
%endif
rm -f $RPM_BUILD_ROOT%{_datadir}/applnk/*/*

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%{_bindir}/*
%{_datadir}/applications/*
%doc %{_docdir}/HTML/en/kpppload/*
%{_datadir}/icons/*/*/*/kpppload.png

%changelog
* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt

* Thu Dec 12 2002 Elliot Lee <sopwith@redhat.com> 1.04-45
- Build on the alpha
- multilib patch to build on x86_64

* Sun Nov 10 2002 Than Ngo <than@redhat.com> 1.04-44
- clean up specfile

* Mon Aug 12 2002 Tim Powers <timp@redhat.com>
- rebuilt with gcc-3.2

* Tue Jul 23 2002 Tim Powers <timp@redhat.com> 1.04-42
- build using gcc-3.2-0.1

* Tue Jul 09 2002 Than Ngo <than@redhat.com> 1.04-41
- use desktop-file-install

* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Wed Jun 19 2002 Than Ngo <than@redhat.com> 1.04-39
- don't forcibly strip binaries

* Sun May 26 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Thu May 23 2002 Bernhard Rosenkraenzer <bero@redhat.com> 1.04-37
- Fix build with current auto* tools

* Tue Apr 16 2002 Than Ngo <than@redhat.com> 1.04-36
- rebuild

* Thu Apr 11 2002 Bernhard Rosenkraenzer <bero@redhat.com> 1.04-35
- Fix up specfile
- Link against correct (threaded) Qt
- Get rid of some KDE 1.x cruft (icons/mini/*, *.kdelnk, xpm icons)

* Mon Mar  7 2002 Than Ngo <than@redhat.com> 1.04-34
- rebuild

* Mon Jan 21 2002 Than Ngo <than@redhat.com> 1.04-32
- fix to build against kde3

* Wed Sep 12 2001 Tim Powers <timp@redhat.com>
- rebuild with new gcc and binutils

* Tue Jul 24 2001 Bernhard Rosenkraenzer <bero@redhat.com> 1.04-29
- Rebuild against new kdelibs, don't require kdesupport

* Mon Jun 25 2001 Than Ngo <than@redhat.com> 1.04-28
- fix dependency problem

* Sun Jun 24 2001 Than Ngo <than@redhat.com> 1.04-27
- rebuild against kde-2.1.x

* Wed Jun 20 2001 Than Ngo <than@redhat.com>
- fix standard-dir-owned-by-package bug
- cleanup specfile

* Tue Jun 19 2001 Florian La Roche <Florian.LaRoche@redhat.de>
- add ExcludeArch: s390 s390x

* Fri Apr 27 2001 Bill Nottingham <notting@redhat.com>
- rebuild for C++ exception handling on ia64

* Wed Feb 28 2001 Trond Eivind Glomsrød <teg@redhat.com>
- rebuild

* Tue Feb  6 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- Rebuild to get rid of libkdefakes.so.0 requirement

* Mon Jan 22 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- Port to KDE2

* Sun Dec 10 2000 Than Ngo <than@redhat.com>
- rebuild with the new  kde1-compat
- remove excludearch ia64

* Thu Aug 24 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Use konfigure instead of hardcoding moc paths

* Thu Aug 24 2000 Than Ngo <than@redhat.com>
- set MOC enviroment for qt.1.45 for using
  moc from qt-1.45

* Tue Aug 01 2000 Than Ngo <than@redhat.de>
- rebuilt against the kde1

* Wed Jul 19 2000 Than Ngo <than@redhat.de>
- rebuilt against compat-libstdc++

* Mon Jul 17 2000 Than Ngo <than@redhat.de>
- install under /usr/share instead /usr/lib/kde1-compat/share,
  fix dependency problem

* Sat Jul 15 2000 Than Ngo <than@redhat.de>
- rebuilt with compat-egcs-c++ 1.1.2
- add BuildPrereq: compat-egcs-c++, kde1-compat-devel
  Requires: kdesupport, kde1-compat
- ExcludeArch: ia64

* Fri Jun 30 2000 Than Ngo <than@redhat.de>
- change prefix to built with kde1-compat

* Sun Jun 18 2000 Than Ngo <than@redhat.de>
- rebuilt in the new build environment, fix docdir

* Thu Jun 02 2000 Than Ngo <than@redhat.de>
- rebuild for 7.0

* Fri Feb 11 2000 Preston Brown <pbrown@redhat.com>
- whoops fix typo

* Thu Feb 10 2000 Preston Brown <pbrown@redhat.com>
- .kdelnk not config file

* Fri Feb 04 2000 Preston Brown <pbrown@redhat.com>
- fix htmldir

* Sat Jan  8 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Rebuild for 6.2
- fix build on alpha/libtool 1.3.4
- fix up download URL

* Fri Sep 24 1999 Preston Brown <pbrown@redhat.com>
- mark doc files as such.

* Mon Sep 13 1999 Preston Brown <pbrown@redhat.com>
- build for new KDE 1.1.2

* Wed Feb 24 1999 Preston Brown <pbrown@redhat.com>
- Injected new description and group.

* Sat Feb 06 1999 Preston Brown <pbrown@redhat.com>
- rebuilt against new libstdc++

* Thu Jan 07 1999 Preston Brown <pbrown@redhat.com>
- changed over to use /usr as the root

* Sat Dec 12 1998 Preston Brown <pbrown@redhat.com>
- initial, rather bare RPM adapted to our stringent standards. :)