#2 Remove python2-mglob, move /usr/bin/mglob to python3-mglob
Merged 4 years ago by churchyard. Opened 4 years ago by churchyard.
rpms/ churchyard/python-mglob nopy2  into  master

file modified
+17 -55
@@ -1,10 +1,6 @@ 

- %if 0%{?fedora} > 15

- %global with_python3 1

- %endif

- 

  Name:           python-mglob

  Version:        0.4

- Release:        27%{?dist}

+ Release:        28%{?dist}

  Summary:        Enhanced file name globbing module

  

  License:        MIT
@@ -14,14 +10,9 @@ 

  Patch0:         mglob-0.4-built-in-set.patch

  

  BuildArch:      noarch

- BuildRequires:  python2-devel

- BuildRequires:  python2-setuptools

- 

- %if 0%{?with_python3}

  BuildRequires:  /usr/bin/2to3

  BuildRequires:  python3-devel

  BuildRequires:  python3-setuptools

- %endif

  

  %global _description\

  Usable as stand-alone utility (for xargs, backticks etc.), or as a globbing\
@@ -30,78 +21,49 @@ 

  

  %description %_description

  

- %package -n python2-mglob

- Summary: %summary

- %{?python_provide:%python_provide python2-mglob}

- 

- %description -n python2-mglob %_description

  

- %if 0%{?with_python3}

  %package -n python3-mglob

  Summary: %summary

  %{?python_provide:%python_provide python3-mglob}

+ # %%{_bindir}/mglob has moved from here:

+ Obsoletes: python2-mglob < 0.4-27

  

  %description -n python3-mglob %_description

- %endif

+ 

  

  %prep

  %setup -q -n mglob-%{version}

  %patch0

  sed -i -e '/^#!\//, 1d' mglob.py

  

- %if 0%{?with_python3}

- rm -rf %{py3dir}

- cp -a . %{py3dir}

- find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'

- 

- 2to3 --write --nobackups %{py3dir}

- %endif # with_python3

- 

- find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'

+ find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'

+ 2to3 --write --nobackups .

  

  

  %build

- %if 0%{?with_python3}

- pushd %{py3dir}

-     %py3_build

- popd

- %endif # with_python3

- 

- %py2_build

+ %py3_build

  

  

  %install

- # Must do the python3 install first because the scripts in /usr/bin are

- # overwritten with every setup.py install (and we want the python2 version

- # to be the default for now).

- %if 0%{?with_python3}

- pushd %{py3dir}

-     %py3_install

-     mv %{buildroot}%{_bindir}/mglob %{buildroot}%{_bindir}/python3-mglob

- popd

- %endif # with_python3

- 

- %py2_install

-  

+ %py3_install

  

- %files -n python2-mglob

- # upstream has no docs

- %doc

- %{_bindir}/mglob

- %{python2_sitelib}/mglob.py*

- %{python2_sitelib}/mglob-%{version}-py?.?.egg-info

+ # backwards compatibility link

+ ln -s ./mglob %{buildroot}%{_bindir}/python3-mglob

+  

  

- %if 0%{with_python3}

  %files -n python3-mglob

  # upstream has no docs

- %doc

+ %{_bindir}/mglob

  %{_bindir}/python3-mglob

  %{python3_sitelib}/__pycache__/mglob.cpython*

  %{python3_sitelib}/mglob.py*

- %{python3_sitelib}/mglob-%{version}-py?.?.egg-info

- %endif # with_python3

+ %{python3_sitelib}/mglob-%{version}-py%{python3_version}.egg-info/

+ 

  

  %changelog

+ * Tue Sep 10 2019 Miro Hrončok <mhroncok@redhat.com> - 0.4-28

+ - Remove python2-mglob, move /usr/bin/mglob to python3-mglob

+ 

  * Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.4-27

  - Rebuilt for Python 3.8

  

Pull-Request has been merged by churchyard

4 years ago
Metadata