Generally “modernize” packaging (by EPEL7 standards)
This commit is contained in:
parent
36ed902e1e
commit
962fd669cf
1 changed files with 74 additions and 62 deletions
|
|
@ -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 <code@musicinmybrain.net> - 0.9.0-2
|
||||
- Generally “modernize” packaging (by EPEL7 standards)
|
||||
|
||||
* Sat Jun 13 2015 Volker Fröhlich <volker27@gmx.at> - 0.9.0-1
|
||||
- New upstream release
|
||||
- Add Python 3 sub-package
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue