File deluge.spec of Package deluge

%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Name:		deluge
Version:	1.1.2
Release:	0.1%{?dist}
Summary:	A GTK+ BitTorrent client with support for DHT, UPnP, and PEX
Group:		Applications/Internet
License:	GPLv3
URL:		http://deluge-torrent.org/           

Source0:	http://download.deluge-torrent.org/source/%{version}/%{name}-1.1.2.tar.bz2

BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:	boost-devel
BuildRequires:	desktop-file-utils
BuildRequires:	libtool
BuildRequires:	gcc-c++
BuildRequires:	gcc
BuildRequires:	openssl-devel
BuildRequires:	python-devel
BuildRequires:	python-setuptools

Requires:	/bin/sh
Requires:	dbus-python
Requires:	dbus-x11
Requires:	hicolor-icon-theme
Requires:	pygtk2-libglade
Requires:	pyOpenSSL
Requires:	python-setuptools
Requires:	pyxdg

%description
Deluge is a new BitTorrent client, created using Python and GTK+. It is
intended to bring a native, full-featured client to Linux GTK+ desktop
environments such as GNOME and XFCE. It supports features such as DHT
(Distributed Hash Tables), PEX (µTorrent-compatible Peer Exchange), and UPnP
(Universal Plug-n-Play) that allow one to more easily share BitTorrent data
even from behind a router with virtually zero configuration of port-forwarding.


%prep
%setup -qn "%{name}-1.1.2"


%build
CFLAGS="%{optflags}" %{__python} setup.py build


%install
rm -rf %{buildroot}
echo $build_dist
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
strip --strip-all %{buildroot}%{python_sitearch}/deluge/libtorrent.so
desktop-file-install		\
	--dir %{buildroot}%{_datadir}/applications	\
	--copy-name-to-generic-name			\
	--add-mime-type=application/x-bittorrent	\
	--delete-original				\
	--remove-category=Application			\
	%{buildroot}%{_datadir}/applications/%{name}.desktop
pushd %{buildroot}
	find -type f -o -type l \
		| sed '
			s:%{buildroot}%{python_sitearch}::
			s:^\.::
			s:\(.*/deluge/i18n/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
			s:^\([^%].*\)::
			s:%lang(C) ::
			/^$/d' \
	> %{name}.filelist
	find ./%{python_sitearch}/deluge -not -iname '%{name}.mo' -type f \
		| sed 's:^\./::' >> %{name}.filelist
	find ./%{python_sitearch}/deluge -not -iname '%{name}.mo' -type d \
		| sed 's:^\./:%%dir :' >> %{name}.filelist	
popd && mv %{buildroot}/%{name}.filelist .


%clean
rm -rf %{buildroot}


%files -f %{name}.filelist
%defattr(-,root,root,-)
%doc ChangeLog
%{python_sitearch}/%{name}-1.1.2-py?.?.egg-info
%{_bindir}/%{name}
%{_bindir}/%{name}d
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.*
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/icons/scalable/apps/%{name}.svg
%{_mandir}/man?/%{name}*


%post
update-desktop-database &>/dev/null ||:
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
	%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor ||:
fi


%postun
update-desktop-database &> /dev/null ||:
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
	%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor ||:
fi


%changelog
* Sat Jan 31 2009 Marcos Pinto <markybob@gmail.com> - 1.1.2-0.1
- Update to new upstream release (1.1.2)
openSUSE Build Service is sponsored by