File udiskie.spec of Package udiskie
#
# spec file for package udiskie
#
# Copyright (c) 2016 SUSE LINUX 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/
#
Name:           udiskie
Version:        @SERVICE@
Release:        0
Summary:        Removable disk automounter for udisks
License:        MIT
Group:          System/GUI/Other
Url:            https://github.com/coldfix/udiskie
Source:         %{name}-%{version}.tar.xz
BuildRequires:  asciidoc
BuildRequires:  fdupes
# Needed for typelib() - Requires.
BuildRequires:  gobject-introspection
BuildRequires:  hicolor-icon-theme
BuildRequires:  libxslt-tools
BuildRequires:  python3-setuptools
BuildRequires:  update-desktop-files
# Runtime dependencies:
BuildRequires:  python3-gobject
BuildRequires:  typelib(Gtk) = 3.0
BuildRequires:  typelib(Notify)
Requires:       gdk-pixbuf-loader-rsvg
Requires:       python3-PyYAML
Requires:       python3-docopt
Requires:       python3-gobject
Requires:       python3-setuptools
Requires:       python3-xml
Requires:       typelib(Gtk) = 3.0
Requires:       udisks2
Recommends:     %{name}-lang
Recommends:     python3-keyutils
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
%description
udiskie is a UDisks front-end that allows to manage removeable media such as CDs
or flash drives from userspace. Its features include:
- automount removable media when inserted
- notifications (on insertion, mount, unmount, …)
- GTK tray icon to manage all available devices
- command line tools for manual un-/mounting
- support for LUKS encrypted devices
- support for unlocking with keyfiles (requires udisks 2.6.4)
- support for loop devices (mounting iso archives, requires UDisks2)
- password caching
- works with either udisks1 or udisks2
- an extensible code base (python)
- a maintainer who is open for suggestions;)
%lang_package
%package zsh-completion
Summary:        ZSH Completion for %{name}
License:        MIT
Group:          System/GUI/Other
Requires:       %{name} = %{version}-%{release}
Supplements:    packageand(%{name}:zsh)
BuildArch:      noarch
%description zsh-completion
ZSH command line completion support for %{name}.
%prep
%setup -q
%build
python3 ./setup.py build
%install
python3 ./setup.py install -O1 \
    --prefix=%{_prefix} \
    --root %{buildroot} \
    --record-rpm=files.lst
make %{?_smp_mflags} -C doc
install -Dm 0644 doc/%{name}.8 %{buildroot}%{_mandir}/man8/%{name}.8
# Create man pages for other binaries
for other in %{name}-mount %{name}-umount; do
  echo ".so man8/%{name}.8" > %{buildroot}%{_mandir}/man8/"${other}.8"
done
%suse_update_desktop_file -c %{name} "Udiskie" "Automounter for removable media" "%{name} -sA" %{name}-mount GTK System TrayIcon
echo "OnlyShowIn=XFCE;MATE;LXDE;" >> %{buildroot}%{_datadir}/applications/%{name}.desktop
%fdupes %{buildroot}%{python3_sitelib}/%{name}/
%fdupes %{buildroot}%{_mandir}/man8/
%find_lang %{name}
%post
%desktop_database_post
%icon_theme_cache_post
%postun
%desktop_database_postun
%icon_theme_cache_postun
%files
%defattr(-,root,root)
%doc CHANGES.rst CONTRIBUTORS COPYING README.rst
%{_bindir}/%{name}*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/actions/%{name}-*.??g
%{python3_sitelib}/%{name}
%{python3_sitelib}/%{name}-*-py%{py3_ver}.egg-info
%{_mandir}/man?/%{name}*.?%{ext_man}
%files lang -f %{name}.lang
%defattr(-,root,root)
%files zsh-completion
%defattr(-,root,root)
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_%{name}*
%changelog