%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?pyver: %global pyver %(%{__python} -c "import sys ; print sys.version[:3]")} Summary: Command line interface to the freedesktop.org trashcan Name: trash-cli Version: 0.11.2 Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base URL : http://trash-cli.googlecode.com/ Source0: http://trash-cli.googlecode.com/files/trash-cli-%{version}.tar.gz BuildArch: noarch BuildRequires: python-setuptools-devel dos2unix Requires: python-unipath %description trash-cli provides a command line trash usable with GNOME, KDE, Xfce or any freedesktop.org compatible trash implementation. The command line interface is compatible with rm and you can use trash-put as an alias to rm. %prep %setup -q for f in filesystem.py cli/restore.py cli/util.py ; do dos2unix -k trashcli/$f done for f in cli/restore.py cli/util.py filesystem.py trash.py ; do %{__sed} -i -e '1d' trashcli/$f done %build %{__python} setup.py build %install %{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT # installs to /usr/man/man1 instead of /usr/share/man/man1 otherwise install -d $(dirname %{buildroot}%{_mandir}) mv %{buildroot}/usr/man %{buildroot}%{_mandir} # first command is there for legacy. second one is broken and undocumented rm -f %{buildroot}/%{_bindir}/restore-trash rm -f %{buildroot}/%{_bindir}/volume-of %clean rm -rf %{buildroot} %files %defattr(-, root, root, -) %doc README.txt AUTHORS COPYING %{_bindir}/trash-* %{python_sitelib}/trashcli/ %{python_sitelib}/trash_cli-*-py%{pyver}.egg-info %{_mandir}/man1/trash-* %changelog * Thu Feb 18 2010 Rahul Sundaram - 0.11.2-2 - Update as per review * Fri Oct 23 2009 Rahul Sundaram - 0.11.2-1 - new upstream release - cleaned up spec * Mon Jun 29 2009 Rahul Sundaram - 0.11.1.2-1 - Updated spec for review * Sat Mar 14 2009 Terje Rosten - 0.11.0-1.r199 - initial build