|
| 1 | +# Copyright 2023 Wong Hoi Sing Edison <[email protected]> |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +%global debug_package %{nil} |
| 16 | + |
| 17 | +Name: python-pip |
| 18 | +Epoch: 100 |
| 19 | +Version: 23.3 |
| 20 | +Release: 1%{?dist} |
| 21 | +BuildArch: noarch |
| 22 | +Summary: Python package management system |
| 23 | +License: MIT |
| 24 | +URL: https://github.com/pypa/pip/tags |
| 25 | +Source0: %{name}_%{version}.orig.tar.gz |
| 26 | +BuildRequires: fdupes |
| 27 | +BuildRequires: python-rpm-macros |
| 28 | +BuildRequires: python3-devel |
| 29 | +BuildRequires: python3-setuptools |
| 30 | + |
| 31 | +%description |
| 32 | +Pip is a replacement for easy_install. It uses mostly the same |
| 33 | +techniques for finding packages, so packages that were made |
| 34 | +easy_installable should be pip-installable as well. |
| 35 | + |
| 36 | +%prep |
| 37 | +%autosetup -T -c -n %{name}_%{version}-%{release} |
| 38 | +tar -zx -f %{S:0} --strip-components=1 -C . |
| 39 | + |
| 40 | +%build |
| 41 | +%py3_build |
| 42 | + |
| 43 | +%install |
| 44 | +%py3_install |
| 45 | +find %{buildroot}%{python3_sitelib} -type f -name '*.pyc' -exec rm -rf {} \; |
| 46 | +fdupes -qnrps %{buildroot}%{python3_sitelib} |
| 47 | + |
| 48 | +%check |
| 49 | + |
| 50 | +%if 0%{?suse_version} > 1500 |
| 51 | +%package -n python%{python_version_nodots}-pip |
| 52 | +Summary: Python package management system |
| 53 | +Requires: ca-certificates |
| 54 | +Requires: python3 |
| 55 | +Requires: python3-distutils-extra |
| 56 | +Requires: python3-setuptools |
| 57 | +Requires: python3-wheel |
| 58 | +Provides: python3-pip = %{epoch}:%{version}-%{release} |
| 59 | +Provides: python3dist(pip) = %{epoch}:%{version}-%{release} |
| 60 | +Provides: python%{python3_version}-pip = %{epoch}:%{version}-%{release} |
| 61 | +Provides: python%{python3_version}dist(pip) = %{epoch}:%{version}-%{release} |
| 62 | +Provides: python%{python3_version_nodots}-pip = %{epoch}:%{version}-%{release} |
| 63 | +Provides: python%{python3_version_nodots}dist(pip) = %{epoch}:%{version}-%{release} |
| 64 | + |
| 65 | +%description -n python%{python_version_nodots}-pip |
| 66 | +Pip is a replacement for easy_install. It uses mostly the same |
| 67 | +techniques for finding packages, so packages that were made |
| 68 | +easy_installable should be pip-installable as well. |
| 69 | + |
| 70 | +%files -n python%{python_version_nodots}-pip |
| 71 | +%license LICENSE.txt |
| 72 | +%{_bindir}/* |
| 73 | +%{python3_sitelib}/* |
| 74 | +%endif |
| 75 | + |
| 76 | +%if 0%{?centos_version} == 800 |
| 77 | +%package -n platform-python-pip |
| 78 | +Summary: Python package management system |
| 79 | +Requires: ca-certificates |
| 80 | +Requires: python3 |
| 81 | +Requires: python3-distutils-extra |
| 82 | +Requires: python3-setuptools |
| 83 | +Requires: python3-wheel |
| 84 | +Conflicts: platform-python-pip < %{epoch}:%{version}-%{release} |
| 85 | +Conflicts: python3-pip < %{epoch}:%{version}-%{release} |
| 86 | + |
| 87 | +%description -n platform-python-pip |
| 88 | +Pip is a replacement for easy_install. It uses mostly the same |
| 89 | +techniques for finding packages, so packages that were made |
| 90 | +easy_installable should be pip-installable as well. |
| 91 | + |
| 92 | +%package -n python3-pip |
| 93 | +Summary: Python package management system |
| 94 | +Requires: platform-python-pip = %{epoch}:%{version}-%{release} |
| 95 | +Provides: python3-pip = %{epoch}:%{version}-%{release} |
| 96 | +Provides: python3dist(pip) = %{epoch}:%{version}-%{release} |
| 97 | +Provides: python%{python3_version}-pip = %{epoch}:%{version}-%{release} |
| 98 | +Provides: python%{python3_version}dist(pip) = %{epoch}:%{version}-%{release} |
| 99 | +Provides: python%{python3_version_nodots}-pip = %{epoch}:%{version}-%{release} |
| 100 | +Provides: python%{python3_version_nodots}dist(pip) = %{epoch}:%{version}-%{release} |
| 101 | + |
| 102 | +%description -n python3-pip |
| 103 | +Pip is a replacement for easy_install. It uses mostly the same |
| 104 | +techniques for finding packages, so packages that were made |
| 105 | +easy_installable should be pip-installable as well. |
| 106 | + |
| 107 | +%files -n platform-python-pip |
| 108 | +%license LICENSE.txt |
| 109 | +%{_bindir}/* |
| 110 | +%{python3_sitelib}/* |
| 111 | + |
| 112 | +%files -n python3-pip |
| 113 | +%license LICENSE.txt |
| 114 | +%endif |
| 115 | + |
| 116 | +%if !(0%{?suse_version} > 1500) && !(0%{?centos_version} == 800) |
| 117 | +%package -n python3-pip |
| 118 | +Summary: Python package management system |
| 119 | +Requires: ca-certificates |
| 120 | +Requires: python3 |
| 121 | +Requires: python3-distutils-extra |
| 122 | +Requires: python3-setuptools |
| 123 | +Requires: python3-wheel |
| 124 | +Provides: python3-pip = %{epoch}:%{version}-%{release} |
| 125 | +Provides: python3dist(pip) = %{epoch}:%{version}-%{release} |
| 126 | +Provides: python%{python3_version}-pip = %{epoch}:%{version}-%{release} |
| 127 | +Provides: python%{python3_version}dist(pip) = %{epoch}:%{version}-%{release} |
| 128 | +Provides: python%{python3_version_nodots}-pip = %{epoch}:%{version}-%{release} |
| 129 | +Provides: python%{python3_version_nodots}dist(pip) = %{epoch}:%{version}-%{release} |
| 130 | + |
| 131 | +%description -n python3-pip |
| 132 | +Pip is a replacement for easy_install. It uses mostly the same |
| 133 | +techniques for finding packages, so packages that were made |
| 134 | +easy_installable should be pip-installable as well. |
| 135 | + |
| 136 | +%files -n python3-pip |
| 137 | +%license LICENSE.txt |
| 138 | +%{_bindir}/* |
| 139 | +%{python3_sitelib}/* |
| 140 | +%endif |
| 141 | + |
| 142 | +%changelog |
0 commit comments