Name:             knemo
Summary:          A KDE network monitoring tool
Summary(ja):      KDE 用ネットワーク監視ツール
Version:          0.6.3
Release:          2%{?_dist_release}

Group:            Applications/Internet
License:          GPLv2+
URL:              http://extragear.kde.org/apps/knemo/
Source0:          http://kde-apps.org/CONTENT/content-files/12956-%{name}-%{version}.tar.bz2

BuildRoot:        %{_tmppath}/%{name}-%{version}-root
BuildRequires:    cmake desktop-file-utils gettext
BuildRequires:    kdelibs4-devel wireless-tools-devel libnl-devel

%description
KNemo displays for every network interface an icon in the systray. Tooltips
and an info dialog provide further information about the interface. Passive
popups inform about interface changes. A traffic plotter is also integrated.
It polls the network interface status every second using the ifconfig, route
and iwconfig tools.

%prep
%setup -q

%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
unset QTDIR || : ; . /etc/profile.d/qt4.sh
%{cmake} \
    -DCMAKE_BUILD_TYPE=release \
    -DDATA_INSTALL_DIR:PATH=%{_datadir}/kde4/apps \
    -DINCLUDE_INSTALL_DIR:PATH=%{_includedir}/kde4 \
    -DLIBEXEC_INSTALL_DIR:PATH=%{_libexecdir}/kde4 \
    -DLEGACY_TRAY_ICON=true \
    ..
popd

make %{?_smp_mflags} -C %{_target_platform}

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT -C %{_target_platform}

%find_lang %{name}
%find_lang kcm_%{name}
cat kcm_%{name}.lang >> %{name}.lang

%check
desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/kde4/%{name}.desktop

%clean
rm -rf $RPM_BUILD_ROOT

%post
touch --no-create %{_datadir}/icons/hicolor &> /dev/null || :

%postun
if [ $1 -eq 0 ] ; then
  touch --no-create %{_datadir}/icons/hicolor &> /dev/null
  gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null || :
fi

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null || :


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING README TODO
%{_bindir}/%{name}
%{_libdir}/kde4/kcm_knemo.so
%{_datadir}/kde4/apps/%{name}
%{_datadir}/applications/kde4/%{name}.desktop
%{_datadir}/kde4/services/kcm_knemo.desktop
%{_datadir}/autostart/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}*
%{_datadir}/icons/hicolor/22x22/status/%{name}*

%changelog
* Tue Jul 20 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 0.6.3-2
- Initial build for Vine Linux

* Tue Jun 15 2010 Alexey Kurov <nucleo@fedoraproject.org> - 0.6.3-1
- update to 0.6.3

* Sat Apr 10 2010 Alexey Kurov <nucleo@fedoraproject.org> - 0.6.2-2
- disabled new KStatusNotifierItem for now (kde#226650)

* Fri Apr  9 2010 Alexey Kurov <nucleo@fedoraproject.org> - 0.6.2-1
- update to 0.6.2

* Mon Jan 18 2010 Alexey Kurov <nucleo@fedoraproject.org> - 0.6.1-2
- update to 0.6.1

* Fri Dec  4 2009 Alexey Kurov <nucleo@fedoraproject.org> - 0.6.0-1
- update to 0.6.0

* Thu Nov 19 2009 Alexey Kurov <nucleo@fedoraproject.org> - 0.5.80-2
- rebuild (qt-4.6.0-rc1, fc13+)

* Fri Nov  6 2009 Alexey Kurov <nucleo@fedoraproject.org> - 0.5.80-1
- update to 0.5.80 (0.6.0 beta1)
- drop xdg-utils references
- removed Requires net-tools wireless-tools

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

* Wed Apr  1 2009 Alexey Kurov <nucleo@fedoraproject.org> - 0.5.2-1
- Update to version 0.5.2
- Fixed spec License and URL fields

* Tue Mar 17 2009 Alexey Kurov <nucleo@fedoraproject.org> - 0.5.1-5
- Upstream update from git.mehercule.net

* Thu Mar  5 2009 Alexey Kurov <nucleo@fedoraproject.org> - 0.5.1-1
- Update to version 0.5.1

* Wed Feb 25 2009 Alexey Kurov <nucleo@fedoraproject.org> - 0.5.0-3
- Update to version 0.5.0 for KDE4

* Tue Apr 17 2007 Francois Aucamp <faucamp@csir.co.za> - 0.4.7-1
- Update to version 0.4.7
- Removed unnecessary desktop-file-install statements (KDE-specific desktop
  files)
- Removed desktop file patch - desktop file "Keywords" keys used internally
  by KDE
- Added "OnlyShowIn=KDE" to kcm desktop file
- Removed unnecessary BuildRequires: qt-devel desktop-file-utils
- Simplified %%post and %%postun scriplets
- Use RPM_BUILD_ROOT variable format consistently

* Wed Sep 13 2006 Hugo Cisneiros <hugo@devin.com.br> 0.4.3-2
- Rebuilt for FC6

* Sun Aug  6 2006 Hugo Cisneiros <hugo@devin.com.br> 0.4.3-1
- New upstream version

* Mon Jun 26 2006 Hugo Cisneiros <hugo@devin.com.br> 0.4.2-1
- Upstream update
- Fixes crashing when you click in panel icon (bz #196576)
- ifconfig and iwconfig are now in both Requires and
  BuildRequires (it checks while building too)

* Tue Jun 13 2006 Hugo Cisneiros <hugo@devin.com.br> 0.4.1-2
- ifconfig and iwconfig are now in Requires section instead
  of BuildRequires. They are runtime dependencies. Thanks to
  Kevin Kofler for pointing this.

* Mon Jun 12 2006 Hugo Cisneiros <hugo@devin.com.br> 0.4.1-1
- Upstream update

* Tue May 30 2006 Hugo Cisneiros <hugo@devin.com.br> 0.4.0-4
- Created BuildRequires for the ifconfig and iwconfig commands,
  as knemo utilizes it for monitoring.
- Removed addition of categories in desktop-file-install command

* Thu May 25 2006 Hugo Cisneiros <hugo@devin.com.br> 0.4.0-3
- Removed vendor option from desktop-file-install (no renaming)

* Sat May 20 2006 Hugo Cisneiros <hugo@devin.com.br> 0.4.0-2
- Installed .desktop files now use desktop-file-install

* Sat May 20 2006 Hugo Cisneiros <hugo@devin.com.br> 0.4.0-1
- Initial RPM release.
