# sitelib for noarch packages, sitearch for others (remove the unneeded one) %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %global commit 708a6662e9928f4d50c5a8c7ee8711367eb040f4 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: playitagainsam Version: %{commit} Release: 1%{?dist} Summary: Record and replay interactive terminal sessions. Group: Development/Languages License: MIT URL: http://retask.readthedocs.org/en/latest/index.html Source0: https://github.com/rfk/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: python2-devel, python-setuptools Requires: python-six %description Record and replay interactive terminal sessions. %prep %setup -q -n playitagainsam-%{commit} sed -i -e '/^#!\//, 1d' %{name}/__main__.py %build %{__python} setup.py build %install rm -rf $RPM_BUILD_ROOT %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc LICENSE.txt README.rst # For noarch packages: sitelib %{python_sitelib}/playitagainsam* %{_bindir}/pias %changelog * Fri Mar 14 2014 Kushal Das 708a6662e9928f4d50c5a8c7ee8711367eb040f4-1 - Initial release