ktorrent/ktorrent.spec

205 lines
7.0 KiB
RPMSpec

#
# spec file for package ktorrent
#
# Copyright (c) 2011 SUSE LINUX Products 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: ktorrent
Version: 4.1.0
Release: 1
Summary: KDE BitTorrent Client
License: GPLv2+ and GPLv3 and LGPLv2 and LGPLv2+ and LGPLv2.1+ and BSD
Url: http://ktorrent.org/
Group: Productivity/Networking/File-Sharing
Source0: http://ktorrent.org/downloads/4.1.0/%{name}-%{version}.tar.bz2
# Mimetype icons
Source1: icons.tar.bz2
Source2: ktorrent.1
Source3: ktupnptest.1
# PATCH-FIX-OPENSUSE remove-links.diff adrian@suse.de -- Remove links to some search engine with maybe legal problems
Patch0: remove-links.diff
# PATCH-FIX-OPENSUSE suse-dht-warning.diff wstephenson@novell.com -- Warning popup for DHT
Patch1: suse-dht-warning.diff
# PATCH-FIX-OPENSUSE initial-preference.diff cmorve69@yahoo.es -- InitialPreference to set it as the default torrent downloader
Patch2: initial-preference.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: ImageMagick
BuildRequires: fdupes
BuildRequires: kdebase4-workspace-devel
BuildRequires: libkdepimlibs4-devel
BuildRequires: libktorrent-devel >= 1.1.0
BuildRequires: taglib-devel
%if 0%{?suse_version}
BuildRequires: update-desktop-files
%endif
%kde4_pimlibs_requires
%kde4_runtime_requires
Recommends: %{name}-lang = %{version}
Obsoletes: ktorrent-devel
Obsoletes: libktcore12
%description
KTorrent is a bittorrent application for KDE which allows you to download files
using the BitTorrent protocol. It enables you to run multiple torrents at the
same time and comes with extended features to make it a full-featured client
for BitTorrent.
%lang_package
%prep
%setup -q
%patch0
%if ! 0%{?packman_bs}
%patch1
%endif
%patch2
tar jxf %{SOURCE1}
%build
%cmake_kde4 -d build
%make_jobs
%install
cd build
%kde4_makeinstall
cd ..
# Not needed, fix "devel-file-in-non-devel-package" rpmlint warning
rm -f %{buildroot}%{_kde4_libdir}/libktcore.so
# Fix wrong-icon-size
convert -scale 22x22! %{buildroot}%{_kde4_iconsdir}/hicolor/22x22/actions/kt-encrypted.png %{buildroot}%{_kde4_iconsdir}/hicolor/22x22/actions/kt-encrypted.png
# Add man pages from help2man edited.
mkdir -p %{buildroot}%{_mandir}/man1
cp %{S:2} %{buildroot}%{_mandir}/man1
cp %{S:3} %{buildroot}%{_mandir}/man1
# Fix any .py files with shebangs and wrong permissions.
if test -z `find %{buildroot} -name *.py -perm 0644 -print0|xargs -0r grep -l '#!'`; \
then break;
else chmod -f 0755 `find %{buildroot} -name *.py -perm 0644 -print0|xargs -0r grep -l '#!'`; \
fi
%if 0%{?suse_version}
%suse_update_desktop_file -r %{name} Qt KDE Network P2P
%endif
# Remove unneeded locales
%if 0%{?suse_version} < 1140
rm -rf %{buildroot}%{_datadir}/locale/ast/
rm -rf %{buildroot}%{_datadir}/locale/hne/
rm -rf %{buildroot}%{_datadir}/locale/sr@ijekavian/
rm -rf %{buildroot}%{_datadir}/locale/sr@ijekavianlatin/
%endif
%fdupes -s %{buildroot}
%find_lang %{name}
%kde_post_install
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc COPYING ChangeLog RoadMap
%{_kde4_bindir}/ktmagnetdownloader
%{_kde4_bindir}/ktorrent
%{_kde4_bindir}/ktupnptest
%{_kde4_modulesdir}/kio_magnet.so
%{_kde4_modulesdir}/ktbwschedulerplugin.so
%{_kde4_modulesdir}/ktdownloadorderplugin.so
%{_kde4_modulesdir}/ktinfowidgetplugin.so
%{_kde4_modulesdir}/ktipfilterplugin.so
%{_kde4_modulesdir}/ktlogviewerplugin.so
%{_kde4_modulesdir}/ktmagnetgeneratorplugin.so
%{_kde4_modulesdir}/ktmediaplayerplugin.so
%{_kde4_modulesdir}/ktscanfolderplugin.so
%{_kde4_modulesdir}/ktscriptingplugin.so
%{_kde4_modulesdir}/ktsearchplugin.so
%{_kde4_modulesdir}/ktshutdownplugin.so
%{_kde4_modulesdir}/ktstatsplugin.so
%{_kde4_modulesdir}/ktsyndicationplugin.so
%{_kde4_modulesdir}/ktupnpplugin.so
%{_kde4_modulesdir}/ktwebinterfaceplugin.so
%{_kde4_modulesdir}/ktzeroconfplugin.so
%{_kde4_modulesdir}/plasma_applet_ktorrent.so
%{_kde4_modulesdir}/plasma_engine_ktorrent.so
%{_kde4_libdir}/libktcore.so.*
%{_kde4_applicationsdir}/ktorrent.desktop
%doc %{_kde4_htmldir}/en/ktorrent/
%{_kde4_iconsdir}/*/*/actions/kt-add-feeds.*
%{_kde4_iconsdir}/*/*/actions/kt-add-filters.*
%{_kde4_iconsdir}/*/*/actions/kt-bandwidth-scheduler.*
%{_kde4_iconsdir}/*/*/actions/kt-change-tracker.*
%{_kde4_iconsdir}/*/*/actions/kt-check-data.*
%{_kde4_iconsdir}/*/*/actions/kt-chunks.*
%{_kde4_iconsdir}/*/*/actions/kt-encrypted.*
%{_kde4_iconsdir}/*/*/actions/kt-info-widget.*
%{_kde4_iconsdir}/*/*/actions/kt-magnet.*
%{_kde4_iconsdir}/*/*/actions/kt-pause.*
%{_kde4_iconsdir}/*/*/actions/kt-plugins.*
%{_kde4_iconsdir}/*/*/actions/kt-queue-manager.*
%{_kde4_iconsdir}/*/*/actions/kt-remove-feeds.*
%{_kde4_iconsdir}/*/*/actions/kt-remove-filters.*
%{_kde4_iconsdir}/*/*/actions/kt-remove.*
%{_kde4_iconsdir}/*/*/actions/kt-restore-defaults.*
%{_kde4_iconsdir}/*/*/actions/kt-set-max-download-speed.*
%{_kde4_iconsdir}/*/*/actions/kt-set-max-upload-speed.*
%{_kde4_iconsdir}/*/*/actions/kt-show-hide.*
%{_kde4_iconsdir}/*/*/actions/kt-show-statusbar.*
%{_kde4_iconsdir}/*/*/actions/kt-speed-limits.*
%{_kde4_iconsdir}/*/*/actions/kt-start-all.*
%{_kde4_iconsdir}/*/*/actions/kt-start.*
%{_kde4_iconsdir}/*/*/actions/kt-stop-all.*
%{_kde4_iconsdir}/*/*/actions/kt-stop.*
%{_kde4_iconsdir}/*/*/actions/kt-upnp.*
%{_kde4_iconsdir}/*/*/apps/ktorrent.*
%{_kde4_iconsdir}/*/*/mimetypes/torrent.*
%{_kde4_appsdir}/ktorrent/
%{_kde4_sharedir}/config.kcfg/magnetsettings.kcfg
%{_kde4_servicesdir}/ktbwschedulerplugin.desktop
%{_kde4_servicesdir}/ktdownloadorderplugin.desktop
%{_kde4_servicesdir}/ktinfowidgetplugin.desktop
%{_kde4_servicesdir}/ktipfilterplugin.desktop
%{_kde4_servicesdir}/ktlogviewerplugin.desktop
%{_kde4_servicesdir}/ktmagnetgeneratorplugin.desktop
%{_kde4_servicesdir}/ktmediaplayerplugin.desktop
%{_kde4_servicesdir}/ktscanfolderplugin.desktop
%{_kde4_servicesdir}/ktscriptingplugin.desktop
%{_kde4_servicesdir}/ktsearchplugin.desktop
%{_kde4_servicesdir}/ktshutdownplugin.desktop
%{_kde4_servicesdir}/ktstatsplugin.desktop
%{_kde4_servicesdir}/ktsyndicationplugin.desktop
%{_kde4_servicesdir}/ktupnpplugin.desktop
%{_kde4_servicesdir}/ktwebinterfaceplugin.desktop
%{_kde4_servicesdir}/ktzeroconfplugin.desktop
%{_kde4_servicesdir}/magnet.protocol
%{_kde4_servicesdir}/plasma-applet-ktorrent.desktop
%{_kde4_servicesdir}/plasma-dataengine-ktorrent.desktop
%{_kde4_servicetypesdir}/ktorrentplugin.desktop
%doc %{_mandir}/man1/*
%files lang -f %{name}.lang
%defattr(-,root,root,-)
%exclude %{_kde4_htmldir}/en/ktorrent/
%changelog