diff --git a/.gitignore b/.gitignore index 8e9fdf4..6a13f7b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /apipkg-1.0.tar.gz +/apipkg-1.2.zip diff --git a/python-apipkg.spec b/python-apipkg.spec index 34785f2..fb1c744 100644 --- a/python-apipkg.spec +++ b/python-apipkg.spec @@ -1,25 +1,29 @@ -%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +%if 0%{?fedora} > 12 +%global with_python3 1 +%else +%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} %endif %global srcname apipkg Name: python-%{srcname} -Version: 1.0 -Release: 2%{?dist} +Version: 1.2 +Release: 1%{?dist} Summary: Python namespace control and lazy-import mechanism Group: Development/Languages License: MIT URL: http://pypi.python.org/pypi/apipkg -Source0: http://pypi.python.org/packages/source/a/%{srcname}/%{srcname}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Source0: http://pypi.python.org/packages/source/a/%{srcname}/%{srcname}-%{version}.zip BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools -BuildRequires: python-nose +%if 0%{?with_python3} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +%endif %description With apipkg you can control the exported namespace of a python package and @@ -28,32 +32,61 @@ module that works on virtually all Python versions, including CPython2.3 to Python3.1, Jython and PyPy. It co-operates well with Python's help() system, custom importers (PEP302) and common command line completion tools. +%if 0%{?with_python3} +%package -n python3-%{srcname} +Summary: Python namespace control and lazy-import mechanism +Group: Development/Languages + +%description -n python3-%{srcname} +With apipkg you can control the exported namespace of a python package and +greatly reduce the number of imports for your users. It is a small python +module that works on virtually all Python versions, including CPython2.3 to +Python3.1, Jython and PyPy. It co-operates well with Python's help() system, +custom importers (PEP302) and common command line completion tools. +%endif + %prep %setup -q -n %{srcname}-%{version} - +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 %build +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif %{__python} setup.py build - %install -rm -rf %{buildroot} %{__python} setup.py install --skip-build --root %{buildroot} - - -%clean -rm -rf %{buildroot} - +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root %{buildroot} +popd +%endif %files -%defattr(-,root,root,-) %doc CHANGELOG README.txt -%{python_sitelib}/%{srcname}.p* -%{python_sitelib}/%{srcname}*.egg-info +%{python_sitelib}/* +%if 0%{?with_python3} +%files -n python3-%{srcname} +%doc CHANGELOG README.txt +%{python3_sitelib}/* +%endif %changelog +* Sat Nov 10 2012 Fabian Affolter - 1.2-1 +- Updated to match new guidlines +- Python3 +- Updated to new upstream version 1.2 + * Sat Jul 21 2012 Fedora Release Engineering - 1.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild diff --git a/sources b/sources index ab09a8c..ffdc9ed 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e8319fc4a3ca8edb13b5d7e233acb9ea apipkg-1.0.tar.gz +1df75fbb514094a338a9773c28152f05 apipkg-1.2.zip