File clearine.spec of Package clearine

#
# spec file for package clearine
#
# Copyright (c) 2020 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


%define  _name  Clearine
Name:           clearine
Version:        @SERVICE@
Release:        0
Summary:        Beautiful Logout UI for X11 window manager
License:        MIT
Group:          System/X11/Utilities
URL:            https://github.com/okitavera/clearine
Source:         %{name}-%{version}.tar.xz
Source1:        %{name}.conf
# Colors: https://github.com/L4ki/Breeze-Blue-Icons
# actions/32/system-*.svg
Source2:        %{_name}-Breeze.tar.xz
BuildRequires:  fdupes
# Needed for typelib() - Requires.
BuildRequires:  gobject-introspection
BuildRequires:  python3-setuptools
Requires:       python3-cairo
Requires:       python3-gobject
Requires:       python3-gobject-Gdk
Requires:       python3-gobject-cairo
Requires:       python3-setuptools
BuildArch:      noarch

%description
Beautiful Logout UI for X11 window manager. Inspired from oblogout and
Android Oreo's power menu.

%prep
%autosetup
grep -rl '^#!' | xargs sed -i '/^#!/s/env.*py.*/python3/'

%build

%install
python3 ./setup.py install -O1 \
    --root=%{buildroot} \
    --prefix=%{_prefix}
%fdupes -s %{buildroot}%{python3_sitelib}/
%fdupes -s %{buildroot}%{_datadir}/themes/
grep -rl '^#!' %{buildroot}%{python3_sitelib}/%{_name}/ | xargs chmod 0755
install -Dm 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}.conf
tar xf %{SOURCE2} -C %{buildroot}%{_datadir}/themes/

%files
%doc README.md
%{_bindir}/%{name}
%config %{_sysconfdir}/%{name}.conf
%{python3_sitelib}/%{_name}
%{python3_sitelib}/%{_name}-*-py%{py3_ver}.egg-info
%{_datadir}/%{name}
%dir %{_datadir}/themes
%{_datadir}/themes/%{_name}-Breeze
%{_datadir}/themes/%{_name}-Breeze-Colors
%{_datadir}/themes/%{_name}-Breeze-Dark
%{_datadir}/themes/%{_name}-Fallback
%license LICENSE

%changelog
openSUSE Build Service is sponsored by