From 3047b38b8accb9149028c4c5746b370d773b5e42 Mon Sep 17 00:00:00 2001 From: Carl George Date: Dec 04 2018 21:06:26 +0000 Subject: Cleanup --- diff --git a/.gitignore b/.gitignore index 3674b47..8f369eb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -/setuptools-19.2.tar.gz -/setuptools-19.6.2.tar.gz +setuptools-*.tar.gz diff --git a/python3-setuptools.spec b/python3-setuptools.spec index a421507..dcc5321 100644 --- a/python3-setuptools.spec +++ b/python3-setuptools.spec @@ -11,13 +11,17 @@ %global build_wheel 0 %endif +%bcond_without python3_other + %global srcname setuptools %if 0%{?build_wheel} %global python3_wheelname %{srcname}-%{version}-py2.py3-none-any.whl %global python3_record %{python3_sitelib}/%{srcname}-%{version}.dist-info/RECORD +%if %{with python3_other} +%global python3_other_record %{python3_other_sitelib}/%{srcname}-%{version}.dist-info/RECORD +%endif %endif -%bcond_without python3_other %if %{with python3_other} && (0%{?build_wheel} || 0%{?with_check}) %{error:Not supported} %endif @@ -29,8 +33,8 @@ Summary: Easily build and distribute Python 3 packages # Licensing is in flux, see https://bitbucket.org/pypa/setuptools/issues/132/missing-license License: MIT and ASL 2.0 -URL: https://pypi.python.org/pypi/%{srcname} -Source0: https://pypi.python.org/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz +URL: https://github.com/pypa/setuptools +Source0: %pypi_source # ASL 2.0 Source1: http://www.apache.org/licenses/LICENSE-2.0 @@ -68,6 +72,7 @@ This package also contains the runtime components of setuptools, necessary to execute the software that requires pkg_resources.py. +%if %{with python3_other} %package -n python%{python3_other_pkgversion}-setuptools Summary: Easily build and distribute Python %{python3_other_pkgversion} packages Group: Applications/System @@ -81,6 +86,7 @@ have dependencies on other packages. This package also contains the runtime components of setuptools, necessary to execute the software that requires pkg_resources.py. +%endif %prep @@ -103,43 +109,52 @@ find setuptools -name \*.py | xargs sed -i -e '1 {/^#!\//d}' # Remove bundled exes rm -f setuptools/*.exe # These tests require internet connection -rm setuptools/tests/test_integration.py +rm setuptools/tests/test_integration.py %build %if 0%{?build_wheel} -%{__python3} setup.py bdist_wheel +%py3_build_wheel %else +%py3_build +%endif + %if %{with python3_other} +%if 0%{?build_wheel} +%py3_other_build_wheel +%else %py3_other_build %endif -%py3_build %endif %install %if 0%{?build_wheel} -pip%{python3_version} install -I dist/%{python3_wheelname} --root %{buildroot} --strip-file-prefix %{buildroot} - +%py3_install_wheel %{python3_wheelname} sed -i '/\/usr\/bin\/easy_install,/d' %{buildroot}%{python3_record} %else -%if %{with python3_other} -%py3_other_install -%endif %py3_install %endif -rm %{buildroot}%{_bindir}/easy_install - rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests + %if %{with python3_other} +%if 0%{?build_wheel} +%py3_other_install_wheel %{python3_wheelname} +sed -i '/\/usr\/bin\/easy_install,/d' %{buildroot}%{python3_other_record} +%else +%py3_other_install +%endif rm -rf %{buildroot}%{python3_other_sitelib}/setuptools/tests %endif + +rm %{buildroot}%{_bindir}/easy_install + %if 0%{?build_wheel} sed -i '/^setuptools\/tests\//d' %{buildroot}%{python3_record} %endif install -p -m 0644 %{SOURCE1} asl.txt -find %{buildroot}%{python3_sitelib} -name '*.exe' | xargs rm -f +find %{buildroot}%{python3_sitelib} -type f -name '*.exe' -print -delete %if %{with python3_other} find %{buildroot}%{python3_other_sitelib} -type f -name '*.exe' -print -delete %endif @@ -158,10 +173,11 @@ LANG=en_US.utf8 PYTHONPATH=$(pwd) py.test-%{python3_version} %license asl.txt %doc docs/* %{python3_sitelib}/easy_install.py -%{python3_sitelib}/_markerlib/ -%{python3_sitelib}/pkg_resources/ -%{python3_sitelib}/setuptools*/ -%{python3_sitelib}/__pycache__/* +%{python3_sitelib}/__pycache__/easy_install.cpython-%{python3_version_nodots}*.py* +%{python3_sitelib}/_markerlib +%{python3_sitelib}/pkg_resources +%{python3_sitelib}/setuptools +%{python3_sitelib}/setuptools-%{version}-py%{python3_version}.egg-info %{_bindir}/easy_install-%{python3_version} @@ -170,10 +186,11 @@ LANG=en_US.utf8 PYTHONPATH=$(pwd) py.test-%{python3_version} %license asl.txt %doc docs/* %{python3_other_sitelib}/easy_install.py -%{python3_other_sitelib}/_markerlib/ -%{python3_other_sitelib}/pkg_resources/ -%{python3_other_sitelib}/setuptools*/ -%{python3_other_sitelib}/__pycache__/* +%{python3_other_sitelib}/__pycache__/easy_install.cpython-%{python3_version_nodots}*.py* +%{python3_other_sitelib}/_markerlib +%{python3_other_sitelib}/pkg_resources +%{python3_other_sitelib}/setuptools +%{python3_other_sitelib}/setuptools-%{version}-py%{python3_version}.egg-info %{_bindir}/easy_install-%{python3_other_version} %endif