%if 0%{?fedora} > 12 || 0%{?rhel} > 6 # turned off until we have python3-dateutil package %global with_python3 0 %else %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} %endif Name: pytrailer Version: 0.6.0 Release: 1%{?dist} Summary: Python module to simplify access to movie trailers on apple.com Group: Development/Libraries License: LGPLv3 URL: http://github.com/sochotnicky/%{name} Source0: http://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: python-devel,python-setuptools BuildRequires: python-dateutil Requires: python-dateutil %if 0%{?with_python3} BuildRequires: python3-devel,python3-setuptools %endif # if with_python3 %description Pytrailer is very simple python module using JSON and few simple regular expressions to simplify access to trailer information on www.apple.com/trailers. %if 0%{?with_python3} %package -n python3-%{name} Summary: Python module to simplify access to movie trailers on apple.com Group: Development/Libraries %description -n python3-%{name} Pytrailer is very simple python 3 module using JSON and few simple regular expressions to simplify access to trailer information on www.apple.com/trailers. %endif #with_python3 %prep %setup -q %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif # with_python3 %build %{__python} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif # with_python3 %install rm -rf %{buildroot} %{__python} setup.py install --skip-build --root %{buildroot} %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root %{buildroot} popd %endif # with_python3 %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc LICENSE README ChangeLog %{python_sitelib}/%{name}* %{python_sitelib}/*.egg-info %if 0%{?with_python3} %files -n python3-%{name} %defattr(-,root,root,-) %doc LICENSE README ChangeLog %{python3_sitelib}/%{name}* # we __pycache__ dirs exist from Python 3.2+ %if 0%{?fedora} > 14 %{python3_sitelib}/__pycache__/* %endif %{python3_sitelib}/*.egg-info %endif # with_python3 %changelog * Mon Nov 29 2010 Stanislav Ochotnicky - 0.6.0-1 - Update to latest upstream version * Wed Oct 27 2010 Stanislav Ochotnicky - 0.4-2 - Added __pycache__ contents to files * Tue Oct 26 2010 Stanislav Ochotnicky - 0.4-1 - New upstream version - Python3 subpackage * Fri Oct 15 2010 Stanislav Ochotnicky - 0.3.1-2 - Fix License tag to match license of the package - Change RPM_BUILD_ROOT to buildroot macro * Fri Oct 15 2010 Stanislav Ochotnicky - 0.3.1-1 - Initial version of package