Blob Blame History Raw
%global debug_package      %{nil}

Name:       lightdm-gtk-greeter-settings
Version:    1.2.0
Release:    1%{?dist}
Summary:    Settings editor for LightDM GTK+ Greeter
License:    GPLv3
URL:        https://launchpad.net/lightdm-gtk-greeter-settings
Source0:    https://launchpad.net/%{name}/1.2/%{version}/+download/%{name}-%{version}.tar.gz
BuildArch:  noarch

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-distutils-extra
BuildRequires:  intltool
BuildRequires:  desktop-file-utils

Requires:  lightdm-gtk
Requires:  pygobject3



%description
Just a small dialog to make it easier for users to modify the settings 
of lightdm-gtk-greeter.

%prep
%setup -q

# Rename the ubuntu references to fedora
sed -i -e 's@com.ubuntu.pkexec@com.fedora.pkexec@g' com.ubuntu.pkexec.lightdm-gtk-greeter-settings.policy.in \
 po/*
mv com.ubuntu.pkexec.lightdm-gtk-greeter-settings.policy.in com.fedora.pkexec.lightdm-gtk-greeter-settings.policy.in

rm PKG-INFO

%build
%{__python3} setup.py build

%install
%{__python3} setup.py install --root=$RPM_BUILD_ROOT --optimize=1

# Remove shebang from files
for lib in $RPM_BUILD_ROOT%{python3_sitelib}/lightdm_gtk_greeter_settings/*.py; do
 sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
 touch -r $lib $lib.new &&
 mv $lib.new $lib
done

desktop-file-install                                    \
  --delete-original                                     \
  --dir $RPM_BUILD_ROOT/%{_datadir}/applications         \
  $RPM_BUILD_ROOT/%{_datadir}/applications/%{name}.desktop

%find_lang %{name}

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

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

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

%files -f %{name}.lang
%doc NEWS README
%license COPYING
%{_bindir}/lightdm-gtk-greeter-settings
%{_bindir}/lightdm-gtk-greeter-settings-pkexec
%{python3_sitelib}/lightdm_gtk_greeter_settings-%{version}-py*.egg-info
%{python3_sitelib}/lightdm_gtk_greeter_settings/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/lightdm-gtk-greeter-settings*
%{_datadir}/lightdm-gtk-greeter-settings/
%{_datadir}/polkit-1/actions/com.fedora.pkexec.lightdm-gtk-greeter-settings.policy

%changelog
* Sat Jul 04 2015 Leigh Scott <leigh123linux@googlemail.com> - 1.2.0-1
- Initial build