File mugshot.spec of Package mugshot
#
# spec file for package mugshot
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 series 0.4
Name: mugshot
Version: 0.4.0
Release: 0
License: GPL-3.0
Summary: A lightweight user-configuration application
Url: https://launchpad.net/mugshot
Group: System/Management
Source: https://launchpad.net/mugshot/%{series}/%{version}/+download/%{name}-%{version}.tar.gz
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: python3-distutils-extra
BuildRequires: intltool
BuildRequires: hicolor-icon-theme
BuildRequires: fdupes
# Runtime dependencies:
BuildRequires: python3-gobject
BuildRequires: python3-pexpect
# Needed for typelib() - Requires.
BuildRequires: gobject-introspection
Requires: accountsservice
Requires: dbus-1-python3
Requires: gdk-pixbuf-loader-rsvg
Requires: gsettings-backend-dconf
Requires: python3-pexpect
Requires: python3-cairo
Requires: python3-gobject
Requires: shadow
Requires: sudo
Recommends: %{name}-lang
Suggests: gnome-control-center-user-faces
Suggests: gstreamer-plugins-good-extra
Suggests: gstreamer-utils
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%glib2_gsettings_schema_requires
%description
Mugshot is a lightweight, easy-to-use user configuration utility. It allows
you to easily set profile image and user details for your user profile and any
supported applications. This is great for quick profile updates and frequent
image refreshes.
%lang_package
%prep
%setup -q
%build
python3 ./setup.py build
%install
rm -rf %{buildroot}
install -dm 0755 %{buildroot}%{_datadir}/locale
cp -a build/mo/* %{buildroot}%{_datadir}/locale/
install -Dm 0644 build/share/applications/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
export LC_ALL=C.UTF-8
python3 ./setup.py install --skip-build \
--prefix="%{_prefix}" \
--root="%{buildroot}" \
--record-rpm=files.lst
rm -rf %{buildroot}%{_datadir}/doc
sed -i '/^Exec/s|/usr/bin/||' %{buildroot}%{_datadir}/applications/%{name}.desktop
grep -rl '^#!' %{buildroot}%{python3_sitelib}/%{name}* | xargs chmod 0755
%fdupes %{buildroot}%{_datadir}/icons/hicolor/
rm -f %{buildroot}%{_datadir}/%{name}/ui/CameraMugshotDialog.ui~
%find_lang %{name}
# Python byte compile.
pushd %{buildroot}%{python3_sitelib}/%{name}_lib/__pycache__
%py3_compile ..
popd
%clean
rm -rf %{buildroot}
%if 0%{?suse_version} <= 1320
%post
%glib2_gsettings_schema_post
%icon_theme_cache_post
%postun
%glib2_gsettings_schema_postun
%icon_theme_cache_postun
%endif
%files
%defattr(-,root,root)
%doc AUTHORS COPYING NEWS README
%{_bindir}/%{name}
%dir %{_datadir}/%{name}/
%dir %{_datadir}/%{name}/metainfo/
%dir %{_datadir}/%{name}/ui/
%{_datadir}/%{name}/metainfo/%{name}.appdata.xml.in
%{_datadir}/%{name}/ui/*.ui
%{_datadir}/%{name}/ui/*.xml
%dir %{_datadir}/metainfo/
%{_datadir}/metainfo/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/glib-2.0/schemas/apps.%{name}.gschema.xml
%{_datadir}/icons/hicolor/*/apps/%{name}.svg
%{_mandir}/man?/%{name}.*
%{python3_sitelib}/%{name}-%{version}-py%{py3_ver}.egg-info
%{python3_sitelib}/%{name}/
%{python3_sitelib}/%{name}_lib/
%files lang -f %{name}.lang
%changelog