| 1 | ### remark: as soon as setuptools is done, enable it here also !!!
|
|---|
| 2 |
|
|---|
| 3 | %global pypi_name packaging
|
|---|
| 4 |
|
|---|
| 5 | %global build_wheel 0
|
|---|
| 6 | %global with_python3 0
|
|---|
| 7 | %global with_sphinx 0
|
|---|
| 8 | %global with_test 0
|
|---|
| 9 |
|
|---|
| 10 | %global python2_wheelname %{pypi_name}-%{version}-py2.py3-none-any.whl
|
|---|
| 11 | %global python3_wheelname %python2_wheelname
|
|---|
| 12 |
|
|---|
| 13 | Name: python-%{pypi_name}
|
|---|
| 14 | Version: 16.8
|
|---|
| 15 | Release: 2%{?dist}
|
|---|
| 16 | Summary: Core utilities for Python packages
|
|---|
| 17 |
|
|---|
| 18 | License: BSD or ASL 2.0
|
|---|
| 19 | URL: https://github.com/pypa/packaging
|
|---|
| 20 | Vendor: bww bitwise works GmbH
|
|---|
| 21 | %scm_source github https://github.com/bitwiseworks/%{pypi_name}-os2 %{version}-os2
|
|---|
| 22 |
|
|---|
| 23 | BuildArch: noarch
|
|---|
| 24 |
|
|---|
| 25 | #BuildRequires: python2-setuptools
|
|---|
| 26 | BuildRequires: python2-devel
|
|---|
| 27 | %if 0%{?with_test}
|
|---|
| 28 | BuildRequires: python2-pytest
|
|---|
| 29 | %endif
|
|---|
| 30 | #BuildRequires: python-pretend
|
|---|
| 31 | BuildRequires: python2-pyparsing
|
|---|
| 32 | BuildRequires: python-six
|
|---|
| 33 |
|
|---|
| 34 | %if 0%{?with_python3}
|
|---|
| 35 | BuildRequires: python3-setuptools
|
|---|
| 36 | BuildRequires: python3-devel
|
|---|
| 37 | BuildRequires: python3-pytest
|
|---|
| 38 | BuildRequires: python3-pretend
|
|---|
| 39 | BuildRequires: python3-pyparsing
|
|---|
| 40 | BuildRequires: python3-six
|
|---|
| 41 | BuildRequires: python3-sphinx
|
|---|
| 42 | %endif
|
|---|
| 43 |
|
|---|
| 44 | %if 0%{?build_wheel}
|
|---|
| 45 | BuildRequires: python2-pip
|
|---|
| 46 | BuildRequires: python-wheel
|
|---|
| 47 | BuildRequires: python%{python3_pkgversion}-pip
|
|---|
| 48 | BuildRequires: python%{python3_pkgversion}-wheel
|
|---|
| 49 | %endif
|
|---|
| 50 |
|
|---|
| 51 | %description
|
|---|
| 52 | python-packaging provides core utilities for Python packages like utilities for
|
|---|
| 53 | dealing with versions, specifiers, markers etc.
|
|---|
| 54 |
|
|---|
| 55 | %package -n python2-%{pypi_name}
|
|---|
| 56 | Summary: %{summary}
|
|---|
| 57 | %{?python_provide:%python_provide python2-%{pypi_name}}
|
|---|
| 58 |
|
|---|
| 59 | Requires: python2-pyparsing
|
|---|
| 60 | Requires: python-six
|
|---|
| 61 | %description -n python2-%{pypi_name}
|
|---|
| 62 | python2-packaging provides core utilities for Python packages like utilities for
|
|---|
| 63 | dealing with versions, specifiers, markers etc.
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 | %if 0%{?with_python3}
|
|---|
| 67 | %package -n python3-%{pypi_name}
|
|---|
| 68 | Summary: %{summary}
|
|---|
| 69 | %{?python_provide:%python_provide python3-%{pypi_name}}
|
|---|
| 70 |
|
|---|
| 71 | Requires: python3-pyparsing
|
|---|
| 72 | Requires: python3-six
|
|---|
| 73 | %description -n python3-%{pypi_name}
|
|---|
| 74 | python3-packaging provides core utilities for Python packages like utilities for
|
|---|
| 75 | dealing with versions, specifiers, markers etc.
|
|---|
| 76 | %endif
|
|---|
| 77 |
|
|---|
| 78 | %package -n python-%{pypi_name}-doc
|
|---|
| 79 | Summary: python-packaging documentation
|
|---|
| 80 | Suggests: python2-%{pypi_name} = %{version}-%{release}
|
|---|
| 81 | %description -n python-%{pypi_name}-doc
|
|---|
| 82 | Documentation for python-packaging
|
|---|
| 83 |
|
|---|
| 84 | %prep
|
|---|
| 85 | %scm_setup
|
|---|
| 86 | # Remove bundled egg-info
|
|---|
| 87 | rm -rf %{pypi_name}.egg-info
|
|---|
| 88 |
|
|---|
| 89 | %build
|
|---|
| 90 | %if 0%{?build_wheel}
|
|---|
| 91 | %py2_build_wheel
|
|---|
| 92 | %else
|
|---|
| 93 | %py2_build
|
|---|
| 94 | %endif
|
|---|
| 95 | %if 0%{?with_python3}
|
|---|
| 96 | %if 0%{?build_wheel}
|
|---|
| 97 | %py3_build_wheel
|
|---|
| 98 | %else
|
|---|
| 99 | %py3_build
|
|---|
| 100 | %endif
|
|---|
| 101 | %endif
|
|---|
| 102 | # generate html docs
|
|---|
| 103 | %if 0%{?with_sphinx}
|
|---|
| 104 | sphinx-build-3 docs html
|
|---|
| 105 | %endif
|
|---|
| 106 | # remove the sphinx-build leftovers
|
|---|
| 107 | rm -rf html/.{doctrees,buildinfo}
|
|---|
| 108 | # Do not bundle fonts
|
|---|
| 109 | rm -rf html/_static/fonts/
|
|---|
| 110 |
|
|---|
| 111 | %install
|
|---|
| 112 | %if 0%{?build_wheel}
|
|---|
| 113 | %py2_install_wheel %{python2_wheelname}
|
|---|
| 114 | %else
|
|---|
| 115 | %py2_install
|
|---|
| 116 | %endif
|
|---|
| 117 | %if 0%{?with_python3}
|
|---|
| 118 | %if 0%{?build_wheel}
|
|---|
| 119 | %py3_install_wheel %{python3_wheelname}
|
|---|
| 120 | %else
|
|---|
| 121 | %py3_install
|
|---|
| 122 | %endif
|
|---|
| 123 | %endif
|
|---|
| 124 |
|
|---|
| 125 | %check
|
|---|
| 126 | %if 0%{?with_test}
|
|---|
| 127 | %%{__python2} -m pytest tests/
|
|---|
| 128 | %if 0%{?with_python3}
|
|---|
| 129 | %{__python3} -m pytest tests/
|
|---|
| 130 | %endif
|
|---|
| 131 | %endif
|
|---|
| 132 |
|
|---|
| 133 | %files -n python2-%{pypi_name}
|
|---|
| 134 | %license LICENSE LICENSE.APACHE LICENSE.BSD
|
|---|
| 135 | %doc README.rst CHANGELOG.rst CONTRIBUTING.rst
|
|---|
| 136 | %{python2_sitelib}/%{pypi_name}*
|
|---|
| 137 |
|
|---|
| 138 | %if 0%{?with_python3}
|
|---|
| 139 | %files -n python3-%{pypi_name}
|
|---|
| 140 | %license LICENSE LICENSE.APACHE LICENSE.BSD
|
|---|
| 141 | %doc README.rst CHANGELOG.rst CONTRIBUTING.rst
|
|---|
| 142 | %{python3_sitelib}/%{pypi_name}/
|
|---|
| 143 | %{python3_sitelib}/%{pypi_name}-*.dist-info/
|
|---|
| 144 | %endif
|
|---|
| 145 |
|
|---|
| 146 | %files -n python-%{pypi_name}-doc
|
|---|
| 147 | %if 0%{?with_sphinx}
|
|---|
| 148 | %doc html
|
|---|
| 149 | %endif
|
|---|
| 150 | %license LICENSE LICENSE.APACHE LICENSE.BSD
|
|---|
| 151 |
|
|---|
| 152 | %changelog
|
|---|
| 153 | * Thu Apr 13 2017 Silvan Scherrer <silvan.scherrer@aroa.ch> 16.8-2
|
|---|
| 154 | - moved source to github
|
|---|
| 155 |
|
|---|
| 156 | * Mon Feb 27 2017 Silvan Scherrer <silvan.scherrer@aroa.ch> 16.8-1
|
|---|
| 157 | - first rpm version (internal version only)
|
|---|