%if 0%{?rhel} <= 5 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %endif %global commit 68bc5de84dc90e1292c6aa19abd95f660b5e3277 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global date 20130611 %global libname TorCtl Name: pytorctl Version: 0 Release: 0.12.%{date}git%{shortcommit}%{?dist} Summary: TorCtl Python bindings Group: Development/Libraries License: BSD URL: https://gitweb.torproject.org/pytorctl.git # git clone git://git.torproject.org/pytorctl.git # cd pytorctl; git archive --format=tar --prefix=pytorctl/ %%{commit} | gzip > pytorctl-%%{version}-%%{date}git%%{shortcommit}.tar.gz Source0: %{name}-%{version}-%{date}git%{shortcommit}.tar.gz BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildArch: noarch BuildRequires: python2-devel %description Python bindings for controlling the Tor router %prep %setup -q -n %{name} %build %install rm -rf %{buildroot} mkdir -p %{buildroot}%{python_sitelib}/%{libname} install -m 0644 *.py %{buildroot}%{python_sitelib}/%{libname} # Remove shebang from libraries for lib in %{buildroot}%{python_sitelib}/%{libname}/*.py; do sed '/#!\/usr\/bin\/python/d' $lib > $lib.new && touch -r $lib $lib.new && mv $lib.new $lib done %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc LICENSE README %{python_sitelib}/%{libname} %changelog * Tue Jun 11 2013 Juan Orti Alcaine <jorti@fedoraproject.org> - 0-0.12.20130611git68bc5de - Update source code to git commit 68bc5de * Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.11.20111213git - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.10.20111213git - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Thu Apr 12 2012 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 0-0.9.20111213git - Change variables to global - Drop support for old Fedora releases in python_sitelib definition * Wed Dec 21 2011 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 0-0.8.20111213git - Remove noarch exception for EPEL - Preserve timestamps - Remove python shebang from libraries * Tue Dec 13 2011 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 0-0.7.20111213git - Update source code to last commit * Wed Nov 23 2011 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 0-0.6.20110927git - Make scripts executable to fix rpmlint errors * Mon Oct 10 2011 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 0-0.5.20110927git - minor fixes * Sat Oct 08 2011 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 0-0.4.20110927git - fix rpmlint errors * Tue Sep 27 2011 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 0-0.3.20110927git - noarch exception for Suse * Tue Sep 27 2011 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 0-0.2.20110927git - noarch exception for EPEL * Tue Sep 27 2011 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 0-0.1.20110927git - First edition of the package