File deluge.spec of Package deluge

#
# spec file for package deluge
#
# 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:           deluge
Version:        1.3.13
Release:        0
Summary:        BitTorrent Client
License:        SUSE-GPL-3.0-with-openssl-exception
Group:          Productivity/Networking/File-Sharing
Url:            http://deluge-torrent.org/
Source:         http://download.deluge-torrent.org/source/%{name}-%{version}.tar.xz
# PATCH-FIX-OPENSUSE deluge-suse-geoip-location.patch -- Point to the right GeoIP.dat location.
Patch0:         %{name}-suse-geoip-location.patch
# PATCH-FIX-UPSTREAM deluge-update_7z_binary.patch
Patch1:         %{name}-update_7z_binary.patch
# PATCH-FEATURE-OPENSUSE deluge-libtorrent-1.1-geoip.patch sor.alexei@meowr.ru -- Use python-GeoIP to get GeoIP data.
Patch2:         %{name}-libtorrent-1.1-geoip.patch
BuildRequires:  fdupes
BuildRequires:  gettext
BuildRequires:  hicolor-icon-theme
BuildRequires:  intltool
BuildRequires:  python-devel
BuildRequires:  python-setuptools
BuildRequires:  update-desktop-files
Requires:       python-Mako
Requires:       python-Twisted >= 8.1
Requires:       python-chardet
Requires:       python-gtk >= 2.12
Requires:       python-libtorrent-rasterbar >= 0.14
Requires:       python-pyOpenSSL
Requires:       python-setuptools
Requires:       python-xdg
Requires:       xdg-utils
Recommends:     %{name}-lang
Recommends:     python-GeoIP
Recommends:     python-notify
Recommends:     python-pygame
Recommends:     python-service_identity
Recommends:     python-setproctitle
BuildArch:      noarch

%description
Deluge is a Free Software, cross-platform BitTorrent client on
Python and Gtk2 with multiple user interfaces in client/server
model.

%lang_package

%prep
%setup -q
%patch0 -p1
%patch1
%patch2 -p1

%build
python2 setup.py build

%install
python2 setup.py install \
  --root=%{buildroot} --prefix=%{_prefix}

mv -f %{buildroot}%{python_sitelib}/%{name}/i18n/ %{buildroot}%{_datadir}/locale/
ln -s %{_datadir}/locale %{buildroot}%{python_sitelib}/%{name}/i18n

# Add execution bit to scripts with shebangs.
find %{buildroot}%{python_sitelib} -name '*.py' | while read py; do
    if [[ "$(head -c2 "$py"; echo)" == "#!" ]]; then
        chmod a+x "$py"
    fi
done

%fdupes %{buildroot}%{python_sitelib}/
%find_lang %{name}

%post
%desktop_database_post
%icon_theme_cache_post

%postun
%desktop_database_postun
%icon_theme_cache_postun

%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog LICENSE README
%{_bindir}/%{name}*
%{python_sitelib}/%{name}/
%{python_sitelib}/%{name}-*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%{_datadir}/pixmaps/%{name}.*
%{_mandir}/man?/%{name}*

%files lang -f %{name}.lang
%defattr(-,root,root)

%changelog
openSUSE Build Service is sponsored by