55410b8
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
55410b8
55410b8
Name:		deluge
55410b8
Version:	0.4.1
55410b8
Release:	6%{?dist}
55410b8
Summary:	A Python BitTorrent client with support for UPnP and DHT
55410b8
Group:		Applications/Editors
55410b8
License:	GPL
55410b8
URL:		http://deluge-torrent.org/           
55410b8
55410b8
Source0:	http://deluge-torrent.org/downloads/%{name}-%{version}.tar.gz
55410b8
Source1:	%{name}.desktop
55410b8
Source2:	COPYING
55410b8
55410b8
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
55410b8
BuildArch:	noarch
55410b8
55410b8
BuildRequires:	desktop-file-utils
55410b8
55410b8
Requires:	/bin/sh
55410b8
Requires:	pyxdg
55410b8
Requires:	python-libtorrent >= 0.3.0-4
55410b8
Requires:	gnome-python2-libegg
55410b8
Requires:	pygtk2-libglade
55410b8
Requires:	PyXML
55410b8
55410b8
%if 0%{?fedora} >= 6
55410b8
Requires:	notify-python
55410b8
%endif
55410b8
55410b8
%description
55410b8
Deluge is a new BitTorrent client, created using Python and GTK+. It is
55410b8
intended to bring a native, full-featured client to Linux GTK+ desktop
55410b8
environments such as GNOME and XFCE. It supports features such as DHT
55410b8
(Distributed Hash Tables) and UPnP (Universal Plug-n-Play) that allow one to
55410b8
more easily share BitTorrent data even from behind a router with virtually
55410b8
zero configuration of port-forwarding.
55410b8
55410b8
55410b8
%prep
55410b8
%setup -q
55410b8
55410b8
55410b8
%build
55410b8
## Nothing to build...
55410b8
55410b8
55410b8
%install
55410b8
rm -rf %{buildroot}
55410b8
## Copy the necessary files...
55410b8
install -p -m 0755 -d %{buildroot}%{python_sitelib}/%{name}/
55410b8
install -p -m 0755 -t %{buildroot}%{python_sitelib}/%{name}/ *.py
55410b8
cp -pr glade plugins pixmaps %{buildroot}%{python_sitelib}/%{name}/
55410b8
install -p -D -m 0644 pixmaps/%{name}-256.png	\
55410b8
	%{buildroot}%{_datadir}/pixmaps/%{name}.png 
55410b8
install -p -m 0644 %{SOURCE2} ./COPYING
55410b8
55410b8
## ...Create the wrapper script...
55410b8
echo -e '#!/bin/sh\ncd %{python_sitelib}/%{name} && exec python ./deluge.py' > %{name}-wrapper.sh 
55410b8
install -D -m 0755 %{name}-wrapper.sh %{buildroot}%{_bindir}/%{name}
55410b8
55410b8
## ...then strip the unneeded shebang lines from the plugins...
55410b8
for FILE in %{buildroot}/%{python_sitelib}/%{name}/plugins/*.py; do
55410b8
	sed -i 1d ${FILE};
55410b8
done  
55410b8
55410b8
## ...Then install the .desktop file.
55410b8
desktop-file-install --vendor fedora	\
55410b8
	--dir %{buildroot}%{_datadir}/applications	\
55410b8
	%{SOURCE1}
55410b8
55410b8
55410b8
%clean
55410b8
rm -rf %{buildroot}
55410b8
55410b8
55410b8
%files
55410b8
%defattr(-,root,root,-)
55410b8
## No LICENSE or COPYING text available in the source tarball, though each
55410b8
## source file has a header GPL comment block. I've submitted a bug report to
55410b8
## the upstream developers about this; and they will include such a file in
55410b8
## the next release of Deluge.
55410b8
%doc COPYING
55410b8
%{python_sitelib}/%{name}/
55410b8
%{_datadir}/pixmaps/%{name}.png
55410b8
%{_datadir}/applications/fedora-%{name}.desktop
55410b8
%{_bindir}/%{name}
55410b8
55410b8
55410b8
%post
55410b8
update-desktop-database &>/dev/null ||:
55410b8
55410b8
55410b8
%postun
55410b8
update-desktop-database &> /dev/null ||:
55410b8
55410b8
55410b8
%changelog
55410b8
* Fri Feb 23 2007 Peter Gordon <peter@thecodergeek.com> - 0.4.1-6
55410b8
- Fix Source0 URL.
55410b8
55410b8
* Wed Feb 21 2007 Peter Gordon <peter@thecodergeek.com> - 0.4.1-5 
55410b8
- Make notify-python dependency conditional (FC6+ only)
55410b8
- Strip the unneeded shebang lines from the plugin scripts, since they are not
55410b8
  meant to be directly executed.
55410b8
55410b8
* Wed Feb 07 2007 Peter Gordon <peter@thecodergeek.com> - 0.4.1-4
55410b8
- Update .desktop file: Icon should not have the "-256" size suffix.
55410b8
- Add Requires: notify-python
55410b8
- Remove strict dependency on python 2.3+, since we're targetting FC5+
55410b8
  only, which has 2.4+.
55410b8
55410b8
* Wed Jan 10 2007 Peter Gordon <peter@thecodergeek.com> - 0.4.1-3
55410b8
- Use install instead of the cp/find/chmod fiasco of earlier releases for
55410b8
  clarity and proper permissions setting.
55410b8
- Be more consistent about use of %%{name} and other macros in file naming as
55410b8
  well as whitespace between sections.
55410b8
55410b8
* Sun Jan 07 2007 Peter Gordon <peter@thecodergeek.com> - 0.4.1-2
55410b8
- Bump python-libtorrent dependency to 0.3.0-4, which contains a fix for
55410b8
  64-bit systems.
55410b8
55410b8
* Wed Jan 03 2007 Peter Gordon <peter@thecodergeek.com> - 0.4.1-1
55410b8
- Initial packaging for Fedora Extras.