Browse Source

python-pip-9.0.1-1

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@11272 ec354946-7b23-47d6-9f5a-488ba84defc7
tomop 6 years ago
parent
commit
969f304820
1 changed files with 99 additions and 12 deletions
  1. 99 12
      p/python-pip/python-pip-vl.spec

+ 99 - 12
p/python-pip/python-pip-vl.spec

@@ -1,58 +1,145 @@
+%bcond_with bootstrap
+%bcond_without python3
+
 %global srcname pip
 
+%global python_wheelname %{srcname}-%{version}-py2.py3-none-any.whl
+%if %{without bootstrap}
+%global python2_wheelname %python_wheelname
+%if %{with python3}
+%global python3_wheelname %python_wheelname
+%endif
+%endif
+
 Summary:        Pip installs Python packages.  An easy_install replacement
 Summary(ja):    Pip は easy_install を置き換える Python パッケージインストーラです。
 Name:           python-%{srcname}
-Version:        1.5.6
+Version:        9.0.1
 Release:        1%{?_dist_release}
 
 Group:          Development/Libraries
 License:        MIT
 URL:            http://pip.openplans.org
 Source0:        http://pypi.python.org/packages/source/p/pip/%{srcname}-%{version}.tar.gz
+# Patch until the following issue gets implemented upstream:
+# https://github.com/pypa/pip/issues/1351
+Patch0:         allow-stripping-given-prefix-from-wheel-RECORD-files.patch
+
+# Downstream only patch
+# Emit a warning to the user if pip install is run with root privileges
+# Issue upstream: https://github.com/pypa/pip/issues/4288
+Patch1:         emit-a-warning-when-running-with-root-privileges.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
 
 BuildArch:      noarch
+BuildRequires:  python-rpm-macros
+BuildRequires:  python3-rpm-macros
 BuildRequires:  python-devel
 BuildRequires:  python-setuptools
+BuildRequires:  python3-devel
+BuildRequires:  python3-setuptools
 Requires:       python-setuptools
+%if %{without bootstrap}
+BuildRequires:  python-pip
+BuildRequires:  python-wheel
+%endif
 
 Vendor: Project Vine
 Distribution: Vine Linux
 
 %description
+pip is a package management system used to install and manage software packages
+written in Python. Many packages can be found in the Python Package Index
+(PyPI). pip is a recursive acronym that can stand for either "Pip Installs
+Packages" or "Pip Installs Python".
+
+
+%package -n python3-%{srcname}
+Summary:        A tool for installing and managing Python3 packages
+Group:          Development/Libraries
+%if %{without bootstrap}
+BuildRequires:  python3-pip
+BuildRequires:  python3-wheel
+%endif
+Requires:       python3-setuptools
 
-Pip is a replacement for `easy_install
-<http://peak.telecommunity.com/DevCenter/EasyInstall>`_.  It uses mostly the
-same techniques for finding packages, so packages that were made
-easy_installable should be pip-installable as well.
+%description -n python3-%{srcname}
+pip is a package management system used to install and manage software packages
+written in Python. Many packages can be found in the Python Package Index
+(PyPI). pip is a recursive acronym that can stand for either "Pip Installs
+Packages" or "Pip Installs Python".
 
-pip is meant to improve on easy_install.bulletin boards, etc.).
 
 %prep
 %setup -q -n %{srcname}-%{version}
-%{__sed} -i '1d' pip/__init__.py
+%patch0 -p1
+%patch1 -p1
+
+# Remove ordereddict as it is only required for python <= 2.6
+#rm pip/_vendor/ordereddict.py
 
 %build
-%{__python} setup.py build
+%if %{without bootstrap}
+%py_build_wheel
+%else
+%py_build
+%endif
+
+%if %{with python3}
+%if %{without bootstrap}
+%py3_build_wheel
+%else
+%py3_build
+%endif
+%endif # with python3
+
 
 %install
 %{__rm} -rf %{buildroot}
-%{__python} setup.py install -O1 --skip-build --root %{buildroot}
-%{__rm} -rf %{buildroot}%{_bindir}/pip-*
-#mv %{buildroot}%{_bindir}/pip %{buildroot}%{_bindir}/pip-python
+
+%if %{with python3}
+%if %{without bootstrap}
+%py3_install_wheel %{python3_wheelname}
+%else
+%py3_install
+%endif
+
+# TODO: we have to remove this by hand now, but it'd be nice if we wouldn't have  to
+# (pip install wheel doesn't overwrite)
+rm %{buildroot}%{_bindir}/pip
+%endif # with python3
+
+%if %{without bootstrap}
+%py_install_wheel %{python_wheelname}
+%else
+%py_install
+%endif
+
 
 %clean
 %{__rm} -rf %{buildroot}
 
 %files
 %defattr(-,root,root,-)
-%doc PKG-INFO docs
+%license LICENSE.txt
+%doc README.rst docs
 %attr(755,root,root) %{_bindir}/pip
 %attr(755,root,root) %{_bindir}/pip2*
 %{python_sitelib}/pip*
 
+%files -n python3-pip
+%defattr(-,root,root,-)
+%license LICENSE.txt
+%doc README.rst docs
+%attr(755,root,root) %{_bindir}/pip3*
+%{python3_sitelib}/pip*
+
 %changelog
+* Mon Dec 18 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.1-1
+- new upstream release.
+- made to use python{,3}-rpm-macros.
+- added a sub-package for python3.
+
 * Sat Jul 26 2014 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.5.6-1
 - new upstream release
 - didn't rename pip to python-pip