File qbittorrent.spec of Package qBittorrent
#
# spec file for package qbittorrent
#
# 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: qbittorrent
Version: 2.6.7
Release: 1
License: GPLv2+
Summary: A Bittorrent Client built with C++ / Qt4
Url: http://sourceforge.net/projects/qbittorrent
Group: Productivity/Networking/File-Sharing
Source: http://downloads.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.gz
Patch0: ntfs-fix.patch
BuildRequires: boost-devel >= 1.35
BuildRequires: libqt4 >= 4.5
BuildRequires: libqt4-devel >= 4.5
BuildRequires: libqt4-x11 >= 4.5
# try to use the same version of libtorrent-rasterbar
BuildRequires: libtorrent-rasterbar-devel
BuildRequires: shared-mime-info
BuildRequires: update-desktop-files
Requires: GeoIP
# This one is done by rpm
#Requires: libtorrent-rasterbar#
Requires: python
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# To get libnotify support (usually for Gnome users)
# uncomment following 2 lines:
#BuildRequires: libnotify-devel
#BuildRequires: glib-devel
# After that, qbittorrent will require some additional packages:
# bundle-lang-gnome-en, bundle-lang-gnome-(your_locale), iso-codes,
# libnotify, libnotify1, libsexy, libwnck-1-22, notification-daemon
%description
A Bittorrent client using C++ / libtorrent and a Qt4 Graphical User Interface.
It aims to be as fast as possible and to provide multi-OS, unicode support.
%package nox
Summary: A Bittorrent Client built with C++, console version
Group: Productivity/Networking/File-Sharing
%description nox
A Bittorrent client using C++ / libtorrent, console version.
It aims to be as fast as possible and to provide multi-OS, unicode support.
%prep
%setup -q
# apply patches
%patch0
%build
echo -e "\n# openSUSE way optflags\nQMAKE_CFLAGS += %{optflags}\nQMAKE_CXXFLAGS += %{optflags}" >> unixconf.pri
# build nox first
mkdir nox && cd nox
../configure --prefix=%{_prefix} --disable-gui
cp conf.pri ../
make %{?_smp_mflags}
cd ../
# build gui version
# --disable-libnotify - enabled completly disables libnotify support
mkdir gui && cd gui
../configure --prefix=%{_prefix} --disable-libnotify
cp conf.pri ../
make %{?_smp_mflags}
%install
# install nox version
cd nox && cp conf.pri ../ && cp conf.log ../ && cp Makefile ../ && sed -i '/STRIP/d' src/Makefile
make INSTALL_ROOT=%{buildroot} install
cd ../
#install gui version
cd gui && cp conf.pri ../ && cp conf.log ../ && cp Makefile ../ && sed -i '/STRIP/d' src/Makefile
make INSTALL_ROOT=%{buildroot} install
# update .desktop file
sed -e "s:application/x-bittorrent:application/x-bittorrent;application/x-magnet:" -i %{buildroot}%{_datadir}/applications/qBittorrent.desktop
%suse_update_desktop_file -r qBittorrent Network P2P
%clean
%{?buildroot:rm -rf %{buildroot}}
%post
update-mime-database /usr/share/mime &> /dev/null
%postun
update-mime-database /usr/share/mime &> /dev/null
%files
%defattr(-,root,root)
%doc AUTHORS Changelog COPYING INSTALL NEWS README TODO
%doc %{_mandir}/man1/qbittorrent.1.gz
%{_bindir}/qbittorrent
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/*
%dir %{_datadir}/icons/hicolor/*/apps
%{_datadir}/icons/hicolor/*/apps/*.png
%{_datadir}/applications/qBittorrent.desktop
%files nox
%defattr(-,root,root)
%doc AUTHORS Changelog COPYING INSTALL NEWS README TODO
%doc %{_mandir}/man1/qbittorrent-nox.1.gz
%{_bindir}/qbittorrent-nox
%changelog