8660d03
Name:           udiskie
e770d88
Version:        2.4.2
bb2fd6b
Release:        %{autorelease}
8660d03
Summary:        Removable disk auto-mounter
8660d03
8660d03
License:        MIT
0437d41
URL:            https://pypi.org/project/%{name}
fae044b
Source0:        %{pypi_source}
8660d03
Source1:        50-udiskie.rules
8660d03
8660d03
BuildArch:      noarch
6960089
BuildRequires:  make
8660d03
BuildRequires:  asciidoc gettext
8660d03
BuildRequires:  python3-devel python3-setuptools
8660d03
8660d03
# Require the module for the correct python
8660d03
Requires: python3-%{name} = %{version}-%{release}
8660d03
8660d03
# Require package implementing required functionality
8660d03
Requires: polkit hicolor-icon-theme
8660d03
cae4742
# Recommend tag not supported on EPEL
98b76f0
%if 0%{?!rhel}
026ce3a
# Recommended for full functionality
026ce3a
Recommends: libnotify
d2f2cf4
%endif
026ce3a
8660d03
%description
8660d03
%{name} is a front-end for UDisks written in python. Its main purpose is
8660d03
automatically mounting removable media, such as CDs or flash drives. It has
8660d03
optional mount notifications, a GTK tray icon and user level CLIs for manual
8660d03
mounting and unmounting operations.
8660d03
8660d03
%package -n python3-%{name}
8660d03
Summary: Python 3 module for udisks disk automounting
d2f2cf4
%global non_python_requires udisks2 gtk3 python3-gobject
d2f2cf4
d2f2cf4
BuildRequires: %{non_python_requires}
d2f2cf4
BuildRequires: %{py3_dist docopt PyYAML}
d2f2cf4
Requires: %{non_python_requires}
fae044b
%{?python_provide:%python_provide python3-%{name}}
8660d03
8660d03
%description -n python3-%{name}
108bdd1
%{name} is a front-end for UDisks written in python. This package provides the
8660d03
python 3 modules used by the %{name} binaries.
8660d03
8660d03
%prep
1cce911
%setup -q
d2f2cf4
find -name '*.txt' -exec chmod -x '{}' +
d2f2cf4
find -name '*.py' -exec sed -i 's|^#!python|#!%{__python3}|' '{}' +
0e65c2b
0e65c2b
# Make test folder into a proper module, if it already isn't
0e65c2b
[ -f test/__init__.py ] || touch test/__init__.py
8660d03
8660d03
%build
8304fd9
%py3_build
8660d03
8660d03
# Build man page
1cce911
%make_build -C doc
8660d03
8660d03
%install
8304fd9
%py3_install
1cce911
find %{buildroot}%{python3_sitelib} -name '*.exe' -delete
8660d03
8660d03
# Install polkit rules
8660d03
install -p -D -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/polkit-1/rules.d/50-%{name}.rules
8660d03
8660d03
# Install man page
8660d03
install -d %{buildroot}%{_mandir}/man8
8660d03
install -p -m644 -t %{buildroot}%{_mandir}/man8 doc/%{name}.8
fae044b
8660d03
# Create man pages for other binaries
9caadce
for other in %{name}-mount %{name}-umount %{name}-info; do
8660d03
  echo ".so man8/%{name}.8" > %{buildroot}%{_mandir}/man8/"${other}.8"
8660d03
done
8660d03
8660d03
# Find all localization files
8660d03
%find_lang %{name}
8660d03
8660d03
%check
f9c8bc6
# Only run tests with satisfied dependencies
8304fd9
%{__python3} setup.py test --test-suite test.test_match
8660d03
8660d03
%files -f %{name}.lang
8660d03
%{_mandir}/man8/%{name}*.8*
6960089
%doc README.rst
8660d03
%license COPYING
8660d03
%config(noreplace) %{_sysconfdir}/polkit-1/rules.d/50-%{name}.rules
8660d03
%{_bindir}/%{name}
8660d03
%{_bindir}/%{name}-mount
8660d03
%{_bindir}/%{name}-umount
108bdd1
%{_bindir}/%{name}-info
108bdd1
%{_datadir}/zsh/site-functions/_%{name}*
8660d03
8660d03
%files -n python3-%{name}
6960089
%doc README.rst
8660d03
%license COPYING
8660d03
%{python3_sitelib}/*
8660d03
8660d03
8660d03
%changelog
bb2fd6b
%autochangelog