File caffeine.spec of Package caffeine

#
# spec file for package caffeine
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2011 Malcolm J Lewis <malcolmlewis@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define __requires_exclude typelib\\(AppIndicator3\\)

Name:           caffeine
Version:        2.4.1+419
Release:        0
Summary:        Utility to inhibit screensaver and sleep modes
License:        GPL-3.0+ and LGPL-3.0+
Group:          System/GUI/GNOME
Url:            https://launchpad.net/caffeine
Source0:        http://launchpad.net/caffeine/2.4/2.4.1/+download/caffeine_2.4.1+419~oneiric1.tar.gz
# PATCH-FIX-UPSTREAM caffeine-add-indicator-menu.patch lp#892663 malcolmlewis@opensuse.org -- Adds the menu via right-click on indicator
Patch0:         caffeine-add-indicator-menu.patch
# PATCH-FIX-UPSTREAM caffeine-fix-desktop-categories.patch lp#931874 malcolmlewis@opensuse.org -- Fix categories string and missing semi-colon.
Patch1:         caffeine-fix-desktop-categories.patch
# PATCH-FIX-UPSTREAM caffeine-fix-non-executable-script.patch lp#931875 malcolmlewis@opensuse.org -- Fix non-executable-script warnings.
Patch2:         caffeine-fix-non-executable-script.patch
BuildRequires:  fdupes
# For %%glib2_gsettings_schema_* macros
BuildRequires:  glib2-devel
# For typelib() Requires
BuildRequires:  gobject-introspection
BuildRequires:  hicolor-icon-theme
BuildRequires:  python-devel
BuildRequires:  update-desktop-files
Requires:       python-xdg
Requires:       python-xlib
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
%glib2_gsettings_schema_requires
%py_requires

%description
Caffeine is a status bar application able to temporarily prevent the
activation of both the screensaver and the "sleep" powersaving mode.

%lang_package
%prep
%setup -q -n recipe-%{version}
%patch0
%patch1 -p1
%patch2 -p1

%build
python setup.py build

%install
python setup.py install -O1 --skip-build --prefix=%{_prefix} --root=%{buildroot}
%suse_update_desktop_file %{name}
%suse_update_desktop_file %{name}-preferences
# we don't need ubuntu themes
rm -r %{buildroot}%{_datadir}/icons/ubuntu*
%find_lang %{name} %{?no_lang_C}
%fdupes %{buildroot}

%post
%glib2_gsettings_schema_post
%desktop_database_post
%icon_theme_cache_post

%postun
%glib2_gsettings_schema_postun
%desktop_database_postun
%icon_theme_cache_postun

%files
%defattr(-,root,root)
%doc COPYING COPYING.LESSER ICONS.INFO README
%{_bindir}/caffeine
%{python_sitelib}/caffeine
%{python_sitelib}/caffeine-2.4.1-py%{py_ver}.egg-info
%{_datadir}/applications/caffeine-preferences.desktop
%{_datadir}/applications/caffeine.desktop
%{_datadir}/caffeine/
%{_datadir}/glib-2.0/schemas/net.launchpad.caffeine.gschema.xml
%{_datadir}/icons/hicolor/*/apps/caffeine.*
%{_datadir}/icons/hicolor/*/status/caffeine-*.*
%{_datadir}/pixmaps/caffeine.png
%{_mandir}/man1/caffeine.1%{?ext_man}

%files lang -f %{name}.lang

%changelog
openSUSE Build Service is sponsored by