72665ba
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
72665ba
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
72665ba
%endif
72665ba
72665ba
Name:           batti
72665ba
Version:        0.3.7
72665ba
Release:        2%{?dist}
72665ba
Summary:        Simple battery monitor for the system tray
72665ba
72665ba
Group:          Applications/System
72665ba
License:        GPLv2+
72665ba
URL:            http://batti-gtk.googlecode.com/
72665ba
Source0:        http://batti-gtk.googlecode.com/files/%{name}-%{version}.tar.gz
72665ba
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
72665ba
72665ba
BuildArch:      noarch
72665ba
BuildRequires:  python-devel
72665ba
BuildRequires:  desktop-file-utils
72665ba
BuildRequires:  gettext
72665ba
Requires:       pygtk2
72665ba
Requires:       dbus-python
72665ba
Requires:       notify-python
72665ba
%if 0%{?fedora} >= 13
72665ba
Requires:       upower
72665ba
%else
72665ba
Requires:       DeviceKit-power
72665ba
%endif
72665ba
72665ba
72665ba
%description
72665ba
Batti is a simple battery monitor for the system tray, similar to batterymon. 
72665ba
Unlike the latter batti uses UPower, and if that is missing DeviceKit.Power, 
72665ba
for it's power information.
72665ba
72665ba
Features
72665ba
* one tray icon per inserted battery
72665ba
* tray icons (dis-)appear with the battery (un-)plugging
72665ba
* notification on low and critical battery status
72665ba
* use of GTK icon-theme
72665ba
* suspend/hibernate menu on left-click, if allowed by PolicyKit
72665ba
72665ba
72665ba
%prep
72665ba
%setup -q
72665ba
72665ba
72665ba
%build
72665ba
%{__python} setup.py build
72665ba
72665ba
72665ba
%install
72665ba
rm -rf $RPM_BUILD_ROOT
72665ba
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
72665ba
desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
72665ba
%find_lang %{name}
72665ba
72665ba
72665ba
%clean
72665ba
rm -rf $RPM_BUILD_ROOT
72665ba
72665ba
72665ba
%post
72665ba
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
72665ba
72665ba
72665ba
%postun
72665ba
if [ "$1" -eq 0 ] ; then
72665ba
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
72665ba
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
72665ba
fi
72665ba
72665ba
72665ba
%posttrans
72665ba
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
72665ba
72665ba
72665ba
%files -f %{name}.lang
72665ba
%defattr(-,root,root,-)
72665ba
%doc AUTHORS COPYING
72665ba
%{_bindir}/%{name}
72665ba
%{python_sitelib}/%{name}*.egg-info
72665ba
%{python_sitelib}/%{name}/
72665ba
%{_datadir}/applications/batti.desktop
72665ba
%{_datadir}/icons/hicolor/*/*/%{name}*
72665ba
72665ba
72665ba
%changelog
72665ba
* Fri May 21 2010 Christoph Wickert <cwickert@fedoraproject.org> - 0.3.7-2
72665ba
- Fix License tag
72665ba
- Add COPYING to doc
72665ba
72665ba
* Sun May 16 2010 Christoph Wickert <cwickert@fedoraproject.org> - 0.3.7-1
72665ba
- Update to 0.3.7
72665ba
- BuildRequire gettext
72665ba
72665ba
* Thu May 13 2010 Christoph Wickert <cwickert@fedoraproject.org> - 0.3.5-1
72665ba
- Update to 0.3.5
72665ba
72665ba
* Fri Apr 16 2010 Christoph Wickert <cwickert@fedoraproject.org> - 0.3.4-1
72665ba
- Update to 0.3.4
72665ba
72665ba
* Tue Apr 13 2010 Christoph Wickert <cwickert@fedoraproject.org> - 0.3.1-1
72665ba
- Update to 0.3.1
72665ba
72665ba
* Thu Apr 08 2010 Christoph Wickert <cwickert@fedoraproject.org> - 
72665ba
- Initial package
72665ba