diff --git a/python-rarfile.spec b/python-rarfile.spec index 499d239..30ddac9 100644 --- a/python-rarfile.spec +++ b/python-rarfile.spec @@ -1,85 +1,66 @@ -%if 0%{?fedora} > 12 -%global with_python3 1 -%else -%{!?__python2: %global __python2 /usr/bin/python2} -%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} -%endif +%global srcname rarfile +%global sum A RAR archive reader for Python -%global scrname rarfile - -Name: python-%{scrname} +Name: python-%{srcname} Version: 2.7 -Release: 1%{?dist} -Summary: A RAR archive reader for Python +Release: 2%{?dist} +Summary: %{sum} License: ISC URL: https://github.com/markokr/rarfile -Source0: https://pypi.python.org/packages/source/r/%{scrname}/%{scrname}-%{version}.tar.gz +Source0: https://pypi.python.org/packages/source/r/%{srcname}/%{srcname}-%{version}.tar.gz Buildarch: noarch BuildRequires: python2-devel -BuildRequires: python-setuptools - -%if 0%{?with_python3} BuildRequires: python3-devel -BuildRequires: python3-setuptools -%endif %description This is Python module for RAR archive reading. The interface is made as zipfile like as possible. -%if 0%{?with_python3} -%package -n python3-%{scrname} -Summary: A RAR archive reader for Python -BuildArch: noarch +%package -n python2-%{srcname} +Summary: %{sum} +%{?python_provide:%python_provide python2-%{srcname}} -%description -n python3-%{scrname} +%description -n python2-%{srcname} +This is Python module for RAR archive reading. The interface is made as +zipfile like as possible. + +%package -n python3-%{srcname} +Summary: %{sum} +%{?python_provide:%python_provide python3-%{srcname}} + +%description -n python3-%{srcname} This is Python module for RAR archive reading. The interface is made as zipfile like as possible. -%endif %prep -%setup -q -n %{scrname}-%{version} -find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' -rm -rf %{srcname}.egg-info -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' -%endif +%autosetup -n %{srcname}-%{version} %build -%{__python2} setup.py build -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py build -popd -%endif # with_python3 +%py2_build +%py3_build %install -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py install --skip-build --root %{buildroot} -popd -%endif # with_python3 -%{__python2} setup.py install --skip-build --root %{buildroot} +%py2_install +%py3_install -%files +%files -n python2-%{srcname} %doc README.rst %license LICENSE -%{python2_sitelib}/%{scrname}.py* -%{python2_sitelib}/%{scrname}*.egg-info +%{python2_sitelib}/%{srcname}.py* +%{python2_sitelib}/%{srcname}*.egg-info -%if 0%{?with_python3} -%files -n python3-%{scrname} +%files -n python3-%{srcname} %doc README.rst %license LICENSE -%{python3_sitelib}/%{scrname}.py* -%{python3_sitelib}/%{scrname}*.egg-info -%{python3_sitelib}/__pycache__/%{scrname}* -%endif # with_python3 +%{python3_sitelib}/%{srcname}.py* +%{python3_sitelib}/%{srcname}*.egg-info +%{python3_sitelib}/__pycache__/%{srcname}* %changelog +* Sat Nov 14 2015 Fabian Affolter - 2.7-2 +- Cleanup + * Sun Mar 15 2015 Fabian Affolter - 2.7-1 - Initial package