%if 0%{?fedora} > 22 || 0%{?rhel} > 7 %global pyver 3 %else %global pyver 2 %endif %global python_sitelib %{python%{pyver}_sitelib} %global commit0 1e3c9020785a88796fc914d2bc7f90458abd1abc %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) %global gittag0 0.1.5 Name: autotrash Version: %{gittag0}git%{shortcommit0} Release: 3%{?dist} Summary: Automatically take-out the trash License: GPLv3+ URL: http://www.logfish.net/pr/autotrash/ Source0: https://github.com/bneijt/%{name}/archive/%{commit0}.tar.gz#/%{name}-%{version}.tar.gz # https://github.com/bneijt/autotrash/issues/8 Patch0: 0001-man-page-converted-from-docbook.patch BuildArch: noarch Requires: python%{pyver} BuildRequires: python%{pyver}-devel %description Autotrash is a simple Python script which will purge files from your trash based on their age or the amount of free space left on the device. %prep %setup -qn %{name}-%{commit0} %patch0 sed -i -e '/^#!\//, 1d' %{name} sed -i -e '1i#!/usr/bin/python%{pyver}' %{name} %build %if 0%{?fedora} > 22 || 0%{?rhel} > 7 %py3_build %else %py2_build %endif %install %if 0%{?fedora} > 22 || 0%{?rhel} > 7 %py3_install %else %py2_install %endif mkdir -p %{buildroot}%{_mandir}/man1 cp -p %{_builddir}/%{name}-%{commit0}/doc/%{name}.1* %{buildroot}%{_mandir}/man1 %files %doc COPYING README.md TODO %{_mandir}/man1/autotrash.1* %{_bindir}/autotrash %{python_sitelib}/%{name}-%{gittag0}-py%{pyver}.*.egg-info %changelog * Sun Nov 15 2015 Francesco Frassinelli - 0.1.5git1e3c902-3 - Python 3 fixes * Sun Nov 15 2015 Francesco Frassinelli - 0.1.5git1e3c902-2 - Man page converted from docbook * Sat Nov 14 2015 Francesco Frassinelli - 0.1.5git1e3c902-1 - Version Bump; ported to Python 3 * Wed Jun 17 2015 Fedora Release Engineering - 0.1.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Sun Sep 28 2014 Robert Mayr 0.1.5-2 - Version Bump * Thu Sep 18 2014 Robert Mayr 0.1.5-1 - Initial package for Fedora