From 962fd669cf1e1a5eeae12fd22483fd15feebb170 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 8 Mar 2023 07:29:46 -0500 Subject: [PATCH] =?UTF-8?q?Generally=20=E2=80=9Cmodernize=E2=80=9D=20packa?= =?UTF-8?q?ging=20(by=20EPEL7=20standards)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python-OWSLib.spec | 136 ++++++++++++++++++++++++--------------------- 1 file changed, 74 insertions(+), 62 deletions(-) diff --git a/python-OWSLib.spec b/python-OWSLib.spec index 3bcac9e..9f53b68 100644 --- a/python-OWSLib.spec +++ b/python-OWSLib.spec @@ -1,98 +1,110 @@ # Works with either ElementTree or python-lxml -%global modname OWSLib %global with_python3 0%{?fedora} -Name: python-%{modname} +Name: python-OWSLib Version: 0.9.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Client library for OGC web services + License: BSD URL: http://geopython.github.io/OWSLib -Source0: http://pypi.python.org/packages/source/O/%{modname}/%{modname}-%{version}.tar.gz +Source0: %{pypi_source OWSLib} BuildArch: noarch +%global common_description %{expand: +Package for client programming with Open Geospatial Consortium (OGC) web +service (hence OWS) interface standards, and their related content models.} + +%description %{common_description} + + +%package -n python2-OWSLib +Summary: %{summary} + +%{?python_provide:%python_provide python2-OWSLib} + BuildRequires: python2-devel -BuildRequires: python-setuptools -Requires: python-dateutil -Requires: python-requests -Requires: pytz +BuildRequires: python2-setuptools + +BuildRequires: python2-dateutil +BuildRequires: python2-requests +BuildRequires: python2-pytz + +Requires: python2-dateutil +Requires: python2-requests +Requires: python2-pytz + +%description -n python2-OWSLib %{common_description} + %if 0%{?with_python3} -BuildRequires: python3-devel -BuildRequires: python3-setuptools +%package -n python%{python3_pkgversion}-OWSLib +Summary: %{summary} + +%{?python_provide:%python_provide python%{python3_pkgversion}-OWSLib} + +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools + +BuildRequires: python%{python3_pkgversion}-dateutil +BuildRequires: python%{python3_pkgversion}-requests +BuildRequires: python%{python3_pkgversion}-pytz + +Requires: python%{python3_pkgversion}-dateutil +Requires: python%{python3_pkgversion}-requests +Requires: python%{python3_pkgversion}-pytz + +%description -n python%{python3_pkgversion}-OWSLib %{common_description} %endif # if with_python3 -%description -Package for client programming with Open Geospatial Consortium (OGC) web -service (hence OWS) interface standards, and their related content models. - -%if 0%{?with_python3} -%package -n python3-OWSLib -Summary: Client library for OGC web services - -Requires: python3-dateutil -Requires: python3-requests -Requires: python3-pytz - -%description -n python3-OWSLib -Package for client programming with Open Geospatial Consortium (OGC) web -service (hence OWS) interface standards, and their related content models. -%endif # if with_python3 %prep -%setup -qc -n %{modname}-%{version} -rm -rf %{modname}-%{version}/%{modname}.egg-info -mv %{modname}-%{version} python2 +%autosetup -n OWSLib-%{version} +rm -rf OWSLib.egg-info -%if 0%{?with_python3} -cp -a python2 python3 -find python3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' -%endif # with_python3 - -find python2 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' - -pushd python2 -cp -pr LICENSE.txt README.txt CHANGES.txt CREDITS.txt ../ -popd +# Remove shebangs from non-script sources. The find-then-modify pattern +# preserves mtimes on sources that did not need to be modified. +find 'owslib' -type f -name '*.py' \ + -exec gawk '/^#!/ { print FILENAME }; { nextfile }' '{}' '+' | + xargs -r sed -r -i '1{/^#!/d}' %build -pushd python2 -%{__python2} setup.py build -popd - +%py2_build %if 0%{?with_python3} -pushd python3 -%{__python3} setup.py build -popd -%endif # if with_python3 +%py3_build +%endif %install -pushd python2 -%{__python2} setup.py install --skip-build --root %{buildroot} -popd - +%py2_install %if 0%{?with_python3} -pushd python3 -%{__python3} setup.py install --skip-build --root %{buildroot} -popd +%py3_install %endif # if with_python3 -%files -%doc LICENSE.txt README.txt CHANGES.txt CREDITS.txt -%{python_sitelib}/owslib -%{python_sitelib}/%{modname}-%{version}-py*.egg-info +%files -n python2-OWSLib +%license LICENSE.txt +%doc README.txt CHANGES.txt CREDITS.txt + +%{python2_sitelib}/owslib/ +%{python2_sitelib}/OWSLib-%{version}-py%{python2_version}.egg-info + %if 0%{?with_python3} -%files -n python3-OWSLib -%doc LICENSE.txt README.txt CHANGES.txt CREDITS.txt -%{python3_sitelib}/owslib -%{python3_sitelib}/%{modname}-%{version}-py*.egg-info +%files -n python%{python3_pkgversion}-OWSLib +%license LICENSE.txt +%doc README.txt CHANGES.txt CREDITS.txt + +%{python3_sitelib}/owslib/ +%{python3_sitelib}/OWSLib-%{version}-py%{python3_version}.egg-info %endif # if with_python3 + %changelog +* Wed Mar 08 2023 Benjamin A. Beasley - 0.9.0-2 +- Generally “modernize” packaging (by EPEL7 standards) + * Sat Jun 13 2015 Volker Fröhlich - 0.9.0-1 - New upstream release - Add Python 3 sub-package