%if %{?_dist_release} == "vl6" %bcond_with python3 %else %bcond_without python3 %endif %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %if %{with python3} %{!?python3_sitelib: %global python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python3_version: %global python3_version %(python3 -c "import sys; sys.stdout.write(sys.version[:3])")} %endif Name: python-setuptools Version: 25.1.1 Release: 1%{?_dist_release} Summary: Download, build, install, upgrade, and uninstall Python packages Summary(ja): Python パッケージのダウンロード、ビルド、インストール、アップグレードおよびアンインストール用ツール Group: Development/Tools License: PSFL/ZPL URL: https://pypi.python.org/pypi/setuptools Source0: https://pypi.python.org/packages/source/s/setuptools/setuptools-%{version}.tar.gz Source1: psfl.txt Source2: zpl.txt Patch0: add-setter-for-test_args.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root Requires(post): alternatives BuildArch: noarch BuildRequires: python-devel %description setuptools is a collection of enhancements to the Python distutils that allow you to more easily build and distribute Python packages, especially ones that have dependencies on other packages. %description -l ja setuptools は Python distutils の拡張機能を集めたツールです。 このツールにより Python パッケージの構築や配布が簡単に行えるように なります。特に他のパッケージに依存しているパッケージを扱う際に便利 です。 %if %{with python3} %package -n python3-setuptools Summary: Download, build, install, upgrade, and uninstall Python3 packages Summary(ja): Python3 パッケージのダウンロード、ビルド、インストール、アップグレードおよびアンインストール用ツール Group: Development/Tools BuildRequires: python3-devel Requires(post): alternatives %description -n python3-setuptools setuptools is a collection of enhancements to the Python distutils that allow you to more easily build and distribute Python packages, especially ones that have dependencies on other packages. %description -n python3-setuptools -l ja setuptools は Python distutils の拡張機能を集めたツールです。 このツールにより Python パッケージの構築や配布が簡単に行えるように なります。特に他のパッケージに依存しているパッケージを扱う際に便利 です。 %endif %prep %setup -T -c -n setuptools-%{version} mkdir py2 pushd py2 tar xvf %{SOURCE0} pushd setuptools-%{version} %patch0 -p1 #find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|' cp *.rst ../../ popd popd %if %{with python3} cp -a py2 py3 %endif %build pushd py2/setuptools-%{version} CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build popd %if %{with python3} pushd py3/setuptools-%{version} CFLAGS="$RPM_OPT_FLAGS" python3 setup.py build popd %endif %install rm -rf $RPM_BUILD_ROOT pushd py2/setuptools-%{version} %{__python} setup.py install -O1 --skip-build \ --root $RPM_BUILD_ROOT \ --single-version-externally-managed install -p -m 0644 %{SOURCE1} %{SOURCE2} . find $RPM_BUILD_ROOT%{python_sitelib} -name '*.exe' | xargs rm -f # for alternatives %__rm -f $RPM_BUILD_ROOT%{_bindir}/easy_install popd %if %{with python3} pushd py3/setuptools-%{version} python3 setup.py install -O1 --skip-build \ --root $RPM_BUILD_ROOT \ --single-version-externally-managed install -p -m 0644 %{SOURCE1} %{SOURCE2} . find $RPM_BUILD_ROOT%{python3_sitelib} -name '*.exe' | xargs rm -f # for alternatives %__rm -f $RPM_BUILD_ROOT%{_bindir}/easy_install popd %endif %clean rm -rf $RPM_BUILD_ROOT %pre if [ ! -L %{_bindir}/easy_install ]; then rm -f %{_bindir}/easy_install fi %post update-alternatives --install %{_bindir}/easy_install easy_install \ %{_bindir}/easy_install-%{python_version} 30 %triggerpostun -- python-setuptools < 5.4.2-2 update-alternatives --auto easy_install %preun if [ "$1" = "0" ] then update-alternatives --remove easy_install %{_bindir}/easy_install-%{python_version} fi %if %{with python3} %pre -n python3-setuptools if [ ! -L %{_bindir}/easy_install ]; then rm -f %{_bindir}/easy_install fi %post -n python3-setuptools update-alternatives --install %{_bindir}/easy_install easy_install \ %{_bindir}/easy_install-%{python3_version} 20 %preun -n python3-setuptools if [ "$1" = "0" ] then update-alternatives --remove easy_install %{_bindir}/easy_install-%{python3_version} fi %endif %files %defattr(-,root,root,-) %doc *.rst %{_bindir}/easy_install-%{python_version} %{python_sitelib}/* %if %{with python3} %files -n python3-setuptools %defattr(-,root,root,-) %doc *.rst %{_bindir}/easy_install-%{python3_version} %{python3_sitelib}/* %endif %changelog * Sat Jul 30 2016 Tomohiro "Tomo-p" KATO - 25.1.1-1 - new upstream release. - enable to build on Vine6. * Tue Jun 28 2016 Yoji TOYODA - 18.5-3 - rebuild with python3-3.5.2 * Thu Dec 24 2015 Tomohiro "Tomo-p" KATO - 18.5-2 - added a subpackage: python3-setuptools. * Sun Nov 15 2015 Tomohiro "Tomo-p" KATO - 18.5-1 - new upstream release. - imported patch0 from rawhide. * Mon Mar 9 2015 IWAI, Masaharu - 5.4.2-2 - alternatives for easy_install * Fri Aug 08 2014 Toshiharu Kudoh 5.4.2-1 - new upstream release * Sat Jul 26 2014 Toshiharu Kudoh 5.4.1-1 - new upstream release * Sun Jul 06 2014 Toshiharu Kudoh 5.4-1 - new upstream release * Sat Apr 26 2014 Toshiharu Kudoh 3.4.4-1 - new upstream release * Sun Feb 19 2012 Yoji TOYODA 0.6c11-2 - rebuild with python-2.7.2 * Tue Feb 02 2010 Shu KONNO 0.6c11-1 - new upstream release * Tue Feb 02 2010 Shu KONNO 0.6c9-2 - rebuild with python-2.6 * Sun Dec 07 2008 Kazutaka HARADA 0.6c9-1 - new upstream release - add japanese summary and description * Mon Jul 21 2008 Shu KONNO - 0.6c3-1vl5 - rebuilt with python-2.5.2 - applied new versioning policy * Sat Nov 25 2006 Ryoichi INAGAKI - 0.6c3-1vl2 - rebuilt for Vine Linux 4.0 - changed Group to Development/Tools * Wed Nov 15 2006 Susumu Tanimura - Refurbished for VineLinux3.2 * Tue Sep 12 2006 Konstantin Ryabitsev - 0.6c2-1 - Upstream 0.6c2 - Ghostbusting * Mon Jul 31 2006 Konstantin Ryabitsev - 0.6c1-2 - Set perms on license files (#200768) * Sat Jul 22 2006 Konstantin Ryabitsev - 0.6c1-1 - Version 0.6c1 * Wed Jun 28 2006 Konstantin Ryabitsev - 0.6b3-1 - Taking over from Ignacio - Version 0.6b3 - Ghost .pyo files in sitelib - Add license files - Remove manual python-abi, since we're building FC4 and up - Kill .exe files * Wed Feb 15 2006 Ignacio Vazquez-Abrams 0.6a10-1 - Upstream update * Mon Jan 16 2006 Ignacio Vazquez-Abrams 0.6a9-1 - Upstream update * Sat Dec 24 2005 Ignacio Vazquez-Abrams 0.6a8-1 - Initial RPM release