File transmission.spec of Package transmission
#
# spec file for package transmission
#
# 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/
#
# norootforbuild
Name: transmission
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: gconf2-devel
BuildRequires: gtk2-devel >= 2.6.0
BuildRequires: intltool
BuildRequires: libcanberra-devel
BuildRequires: libcurl-devel
BuildRequires: libevent-devel
BuildRequires: libnotify-devel
BuildRequires: libqt4-devel
BuildRequires: openssl-devel
BuildRequires: update-desktop-files
Version: 2.13
Release: 4
# FIXME: check if removal of locales in %install is still needed (last checked: 2010-12-11)
Summary: Lightweight, yet powerful BitTorrent client
Source: http://download.m0k.org/transmission/files/%{name}-%{version}.tar.bz2
Source1: transmission-qt.desktop
Url: http://www.transmissionbt.com/
Group: Productivity/Networking/Other
License: GPLv2 ; MIT License (or similar)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: %{name}-common = %{version}
Requires(post): update-alternatives
Requires(postun): update-alternatives
Provides: %{name}-ui = %{version}
%description
Transmission is a fast, easy, and free multi-platform BitTorrent client
with a focus on being lightweight yet feature-filled. Its simple,
intuitive interface is designed to integrate tightly with whatever
computing environment you choose to use. Transmission strikes a balance
between providing useful functionality without feature bloat.
Furthermore, it is free for anyone to use or modify.
%package gtk
License: GPLv2 ; MIT License (or similar)
Summary: Lightweight, yet powerful BitTorrent client
Group: Productivity/Networking/Other
Requires: %{name}-common = %{version}
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends: %{name}-gtk-lang
Provides: %{name}-ui = %{version}
%description gtk
Transmission is a fast, easy, and free multi-platform BitTorrent client
with a focus on being lightweight yet feature-filled. Its simple,
intuitive interface is designed to integrate tightly with whatever
computing environment you choose to use. Transmission strikes a balance
between providing useful functionality without feature bloat.
Furthermore, it is free for anyone to use or modify.
This package contains a graphical user interface to transmission.
%package qt
License: GPLv2 ; MIT License (or similar)
Summary: Lightweight, yet powerful BitTorrent client
Group: Productivity/Networking/Other
Requires: %{name}-common = %{version}
Requires(post): update-alternatives
Requires(postun): update-alternatives
Provides: %{name}-ui = %{version}
%description qt
Transmission is a fast, easy, and free multi-platform BitTorrent client
with a focus on being lightweight yet feature-filled. Its simple,
intuitive interface is designed to integrate tightly with whatever
computing environment you choose to use. Transmission strikes a balance
between providing useful functionality without feature bloat.
Furthermore, it is free for anyone to use or modify.
This package contains a graphical user interface to transmission.
%package common
License: GPLv2 ; MIT License (or similar)
Summary: Lightweight, yet powerful BitTorrent client - Common Data
Group: Productivity/Networking/Other
Requires: %{name}-ui = %{version}
%if 0%{suse_version} > 1110
BuildArch: noarch
%endif
%description common
Transmission is a fast, easy, and free multi-platform BitTorrent client
with a focus on being lightweight yet feature-filled. Its simple,
intuitive interface is designed to integrate tightly with whatever
computing environment you choose to use. Transmission strikes a balance
between providing useful functionality without feature bloat.
Furthermore, it is free for anyone to use or modify.
%lang_package -n %{name}-gtk
%prep
%setup -q
%build
export CFLAGS="$RPM_OPT_FLAGS -fPIC"
export CXXFLAGS="$RPM_OPT_FLAGS -fPIC"
%configure \
--disable-static \
--with-gtk
%__make %{?jobs:-j%{jobs}}
# the qt ui requires an extrawurst for now
cd qt
qmake QMAKE_CXXFLAGS="$RPM_OPT_FLAGS -fPIC" qtr.pro
%__make %{?jobs:-j%{jobs}}
%install
%makeinstall
%if 0%{?suse_version} <= 1110
%{__rm} %{buildroot}%{_datadir}/locale/fil/LC_MESSAGES/*
%endif
# FIXME: waiting for https://bugzilla.novell.com/show_bug.cgi?id=659001 ; once the bug is resolved, remove the comment for %if
#%if 0%{?suse_version} <= 1130
%{__rm} %{buildroot}%{_datadir}/locale/ceb/LC_MESSAGES/*
#%endif
# install qt ui
cd qt
%__make install INSTALL_ROOT=%{buildroot}%{_prefix}
cd ..
# touch files for alternatives
touch %{buildroot}%{_bindir}/transmission
chmod 0755 %{buildroot}%{_bindir}/transmission
touch %{buildroot}%{_mandir}/man1/transmission.1.gz
%find_lang transmission-gtk %{?no_lang_C}
%suse_update_desktop_file transmission-gtk
%suse_update_desktop_file -i transmission-qt
%fdupes $RPM_BUILD_ROOT
%clean
rm -rf %{buildroot}
%post
update-alternatives --install %{_bindir}/transmission transmission %{_bindir}/transmission-cli 5 \
--slave %{_mandir}/man1/transmission.1.gz transmission.1.gz %{_mandir}/man1/transmission-cli.1.gz
%post gtk
update-alternatives --install %{_bindir}/transmission transmission %{_bindir}/transmission-gtk 15 \
--slave %{_mandir}/man1/transmission.1.gz transmission.1.gz %{_mandir}/man1/transmission-gtk.1.gz
%if 0%{?suse_version} > 1130
%desktop_database_post
%endif
%post qt
update-alternatives --install %{_bindir}/transmission transmission %{_bindir}/transmission-qt 10 \
--slave %{_mandir}/man1/transmission.1.gz transmission.1.gz %{_mandir}/man1/transmission-qt.1.gz
%if 0%{?suse_version} > 1130
%desktop_database_post
%endif
%if 0%{?suse_version} > 1130
%post common
%icon_theme_cache_post
%endif
%postun
# Note: we don't use "$1 -eq 0", to avoid issues if the package gets renamed
if [ ! -f %{_bindir}/transmission-cli ]; then
update-alternatives --remove transmission %{_bindir}/transmission-cli
fi
%postun gtk
# Note: we don't use "$1 -eq 0", to avoid issues if the package gets renamed
if [ ! -f %{_bindir}/transmission-gtk ]; then
update-alternatives --remove transmission %{_bindir}/transmission-gtk
fi
%if 0%{?suse_version} > 1130
%desktop_database_postun
%endif
%postun qt
# Note: we don't use "$1 -eq 0", to avoid issues if the package gets renamed
if [ ! -f %{_bindir}/transmission-qt ]; then
update-alternatives --remove transmission %{_bindir}/transmission-qt
fi
%if 0%{?suse_version} > 1130
%desktop_database_postun
%endif
%if 0%{?suse_version} > 1130
%postun common
%icon_theme_cache_postun
%endif
%files
%defattr(-,root,root)
%doc AUTHORS NEWS README COPYING
%ghost %{_bindir}/transmission
%{_bindir}/transmission-cli
%{_bindir}/transmission-create
%{_bindir}/transmission-daemon
%{_bindir}/transmission-edit
%{_bindir}/transmission-remote
%{_bindir}/transmission-show
%ghost %doc %{_mandir}/man1/transmission.1*
%doc %{_mandir}/man1/transmission-cli.1*
%doc %{_mandir}/man1/transmission-create.1*
%doc %{_mandir}/man1/transmission-daemon.1*
%doc %{_mandir}/man1/transmission-edit.1*
%doc %{_mandir}/man1/transmission-remote.1*
%doc %{_mandir}/man1/transmission-show.1*
%files -n %{name}-gtk-lang -f transmission-gtk.lang
%defattr(-,root,root)
%dir %{_datadir}/locale/an
%dir %{_datadir}/locale/an/LC_MESSAGES
%files gtk
%defattr(-,root,root)
%doc AUTHORS NEWS README COPYING
%ghost %{_bindir}/transmission
%{_bindir}/transmission-gtk
%{_datadir}/applications/transmission-gtk.desktop
%ghost %doc %{_mandir}/man1/transmission.1*
%doc %{_mandir}/man1/transmission-gtk.1*
%files qt
%defattr(-,root,root)
%doc AUTHORS NEWS README COPYING
%ghost %{_bindir}/transmission
%{_bindir}/transmission-qt
%{_datadir}/applications/transmission-qt.desktop
%ghost %doc %{_mandir}/man1/transmission.1*
%doc %{_mandir}/man1/transmission-qt.1*
%files common
%defattr(-,root,root)
%{_datadir}/transmission/
%{_datadir}/icons/*/*/apps/transmission.*
%{_datadir}/pixmaps/transmission.png
%changelog