c9a2fcd
# note: PROJ_MIN_VERSION is defined in the setup.py file of pyproj
c9a2fcd
# a compatibility matrix is also provided in docs/installation.rst
0580115
%global minimal_needed_proj_version 8.2.0
bcb10b5
66a96f4
Name:           pyproj
0580115
Version:        3.4.0
0580115
Release:        1%{?dist}
66a96f4
Summary:        Cython wrapper to provide python interfaces to Proj
66a96f4
License:        MIT
66a96f4
URL:            https://github.com/jswhit/%{name}
66a96f4
Source0:        https://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
8688e98
# the old source url still works, but if need be it can be replaced
8688e98
# with: https://files.pythonhosted.org/packages/source/p/%%{name}/%%{name}-%%{version}.tar.gz
41deeb1
652f1a9
BuildRequires:  make
66a96f4
BuildRequires:  gcc
66a96f4
BuildRequires:  proj-devel >= %{minimal_needed_proj_version}
66a96f4
BuildRequires:  proj >= %{minimal_needed_proj_version}
66a96f4
574c050
BuildRequires:  python3-setuptools
66a96f4
BuildRequires:  python3-devel
66a96f4
BuildRequires:  python3-numpy
66a96f4
BuildRequires:  python3-Cython
9a23bab
BuildRequires:  python3-certifi
f4415ee
f4415ee
# needed to run the tests
66a96f4
BuildRequires:  python3-pytest
9a23bab
BuildRequires:  python3-pandas
66a96f4
BuildRequires:  python3-shapely
9a23bab
BuildRequires:  python3-xarray
c806a2a
9883186
# needed to remove the hardcoded rpath '/usr/lib' from the _proj.so file
66a96f4
BuildRequires:  chrpath
41deeb1
f9f2c06
# needed to build the documentation
66a96f4
BuildRequires:  python3-sphinx
9a23bab
BuildRequires:  python3-sphinx-argparse
66a96f4
BuildRequires:  python3-sphinx_rtd_theme
f9f2c06
6fd5b99
%global _description \
6fd5b99
Cython wrapper to provide python interfaces to Proj. \
6fd5b99
Performs cartographic transformations between geographic (Lat/Lon) \
6fd5b99
and map projection (x/y) coordinates. Can also transform directly \
6fd5b99
from one map projection coordinate system to another. \
6fd5b99
Coordinates can be given as numpy arrays, python arrays, lists or scalars. \
41deeb1
Optimized for numpy arrays.
41deeb1
6fd5b99
%description %_description
6fd5b99
41deeb1
%package -n python3-%{name}
41deeb1
6fd5b99
Summary: %summary
41deeb1
66a96f4
Requires:  proj >= %{minimal_needed_proj_version}
c806a2a
6fd5b99
# ensure python provides are provided when python3 becomes the default runtime
6fd5b99
%{?python_provide:%python_provide python3-%{name}}
6fd5b99
6fd5b99
%description -n python3-%{name} %_description
41deeb1
f9f2c06
%package -n python3-%{name}-doc
f9f2c06
f9f2c06
Summary:    Documentation and example code
f9f2c06
BuildArch:  noarch
f9f2c06
f9f2c06
%description -n python3-%{name}-doc
f9f2c06
This package contains the html documentation for the pyproj module.
41deeb1
41deeb1
%prep
66a96f4
%autosetup -p1
41deeb1
66a96f4
# remove use of /usr/bin/env in docs/conf.py
66a96f4
sed -i -e 's/^#!\/usr\/bin\/env python3/#!\/usr\/bin\/python3/g' docs/conf.py
f9f2c06
41deeb1
%build
41deeb1
export PROJ_DIR="%{_usr}/"
646a50e
779e8f0
%py3_build
41deeb1
f9f2c06
# generate documentation
f9f2c06
cd docs
f9f2c06
f4415ee
# Need to point to the build dir so sphinx can import the module
f4415ee
# before it is installed.
b7c0a85
# Note that the new Python macros have %%{pyproject_build_lib} for this,
b7c0a85
# but this package uses the old macros, so we need to replicate the behavior manually.
b7c0a85
# The path has changed in setuptools 62.4.0, see https://bugzilla.redhat.com/2097115
b7c0a85
%global py_build_libdir_old %{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-%{python3_version}
b7c0a85
%global py_build_libdir_new %{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-cpython-%{python3_version_nodots}
b7c0a85
0580115
# NOTE: need to add %%{_builddir}/%%{buildsubdir} as well to the path
0580115
# since sphinx needs to be able to find the PKG-INFO file
0580115
# before it will generate the documentation,
0580115
# and this is the only place where it is available before installation.
0580115
# (see: https://github.com/python/importlib_metadata/issues/364)
0580115
export PYTHONPATH=%{py_build_libdir_old}:%{py_build_libdir_new}:%{_builddir}/%{buildsubdir}
0580115
0580115
# default theme is now "furo" which is not available in fedora
0580115
# (see BZ #1910798 and https://github.com/pyproj4/pyproj/discussions/1134)
0580115
# so fall back to the previous theme:
0580115
export PYPROJ_HTML_THEME=sphinx_rtd_theme
0580115
b7c0a85
make html
b7c0a85
make man
652f1a9
652f1a9
# rpmlint complains many times with the rather cryptic warning:
652f1a9
#     "a special character is not allowed in a name"
652f1a9
# Actually for this man page this indicates a syntax error, since
652f1a9
# it does not have a space after ".B" in many places.
652f1a9
# (it is not clear to me where this originates, from the sphinx tool
652f1a9
#  or the input sources.)
652f1a9
# This sed command corrects for this problem.
652f1a9
sed -i -e 's/^\.B\\-/\.B \\-/g' %{_builddir}/%{name}-%{version}/docs/_build/man/pyproj.1
652f1a9
 
41deeb1
%install
bf51713
export PROJ_DIR="%{_usr}/"
41deeb1
779e8f0
%py3_install
41deeb1
f9f2c06
# ensure the autogenerated hidden .buildinfo file is not included
f9f2c06
# since rpmlint does not like hidden files in the documentation
f9f2c06
%{__rm} %{_builddir}/%{name}-%{version}/docs/_build/html/.buildinfo
f9f2c06
ceb4255
# move html documentation to datadir/doc
f9f2c06
mkdir -p %{buildroot}%{_datadir}/doc/%{name}
ceb4255
mv %{_builddir}/%{name}-%{version}/docs/_build/html \
ceb4255
   %{buildroot}%{_datadir}/doc/%{name}/html
f9f2c06
652f1a9
# copy pyproj man page
652f1a9
mkdir -p %{buildroot}/%{_mandir}/man1
652f1a9
cp %{_builddir}/%{name}-%{version}/docs/_build/man/pyproj.1 \
652f1a9
   %{buildroot}/%{_mandir}/man1/
652f1a9
ceb4255
# remove the documentation sources and generated doctrees
ceb4255
# since they dont belong in the main package
ceb4255
%{__rm} -rf %{_builddir}/%{name}-%{version}/docs
ceb4255
41deeb1
# correct wrong write permission for group
c393164
%{__chmod} 755 %{buildroot}/%{python3_sitearch}/%{name}/*.so
41deeb1
6e2e453
# remove the rpath setting from _proj.so
6e2e453
chrpath -d %{buildroot}/%{python3_sitearch}/%{name}/*.so
6e2e453
41deeb1
ff7206e
%check
5d37884
d35d592
# follow the hint given in pyproj github issue
d35d592
# https://github.com/pyproj4/pyproj/issues/647
d35d592
# i.e. take the test folder outside the build folder
d35d592
# to prevent the
d35d592
#    cannot import name '_datadir' from partially initialized module
d35d592
#    'pyproj' (most likely due to a circular import) 
d35d592
# error.
9883186
# (probably this is not needed anymore but it doesn't hurt to leave this in)
d35d592
cd ..
d35d592
mkdir pyproj-test-folder
d35d592
cd pyproj-test-folder
d35d592
cp -r ../pyproj-%{version}/test .
652f1a9
cp -r ../pyproj-%{version}/pytest.ini .
d35d592
0580115
PATH="%{buildroot}%{_bindir}:$PATH" \
0580115
PYTHONPATH="%{buildroot}%{python3_sitearch}" \
5d90861
py.test-3 -m "not network and not grid"
5d90861
#py.test-3 -m "not network"
0580115
# some notes on the test suite:
0580115
# not network ==> deselects 24 tests
0580115
# not cli     ==> deselects 22 tests
0580115
# not grid    ==> deselects 11 tests
0580115
#
0580115
# network: 24 failures and errors for f36, f37
0580115
# cli:        works fine on all fedora versions
0580115
# grid:     1 failure for f36, f37 (test/test_transformer.py), fixed in rawhide
0580115
41deeb1
41deeb1
%files -n python3-%{name}
ceb4255
%doc README.md
9a23bab
%{_bindir}/%{name}
7dddf7b
%{python3_sitearch}/%{name}/
7dddf7b
%{python3_sitearch}/%{name}-*-py*.egg-info/
652f1a9
%{_mandir}/man1/pyproj*
41deeb1
f9f2c06
%files -n python3-%{name}-doc
f9f2c06
%doc %{_datadir}/doc/%{name}/
f9f2c06
646a50e
41deeb1
%changelog
0580115
* Sat Sep 10 2022 Jos de Kloe <josdekloe@gmail.com> 3.4.0-1
0580115
- Update to 3.4.0
0580115
aa099be
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.1-3
aa099be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
aa099be
0580115
* Sat Jun 25 2022 Jos de Kloe <josdekloe@gmail.com> 3.3.1-2
3ddf23a
- Adjust py_build_libdir to let sphinx build the documentation
3ddf23a
  with the latest setuptools version (62.4.0)
3ddf23a
81d9550
* Sun Apr 24 2022 Jos de Kloe <josdekloe@gmail.com> 3.3.1-1
81d9550
- Update to 3.3.1
81d9550
df29ed0
* Wed Mar 09 2022 Sandro Mani <manisandro@gmail.com> - 3.3.0-3
df29ed0
- Rebuild for proj-9.0.0
df29ed0
d9fd56b
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.0-2
d9fd56b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
d9fd56b
5993245
* Thu Nov 18 2021 Jos de Kloe <josdekloe@gmail.com> 3.3.0-1
5993245
- Update to 3.3.0
5993245
e0b8603
* Sat Sep 18 2021 Jos de Kloe <josdekloe@gmail.com> 3.2.1-1
e0b8603
- Update to 3.2.1
e0b8603
ceb4255
* Wed Sep 08 2021 Jos de Kloe <josdekloe@gmail.com> 3.2.0-2
ceb4255
- Move documentation in stead of copying it to prevent providing it twice.
ceb4255
9883186
* Sun Sep 05 2021 Jos de Kloe <josdekloe@gmail.com> 3.2.0-1
9883186
- Update to 3.2.0
9883186
10751e2
* Wed May 26 2021 Jos de Kloe <josdekloe@gmail.com> 3.1.0-2
10751e2
- Patch a problem in pyproj/enum.py found during python3.10.0b1 COPR testing
10751e2
f489eed
* Tue May 25 2021 Jos de Kloe <josdekloe@gmail.com> 3.1.0-1
f489eed
- Update to 3.1.0
f489eed
6919f50
* Mon May 10 2021 Jos de Kloe <josdekloe@gmail.com> 3.0.1-3
6919f50
- Fix rawhide build after proj was upgraded to v8.0.1
6919f50
9fe70cb
* Wed Mar 10 2021 Sandro Mani <manisandro@gmail.com> - 3.0.1-2
9fe70cb
- Rebuild (proj)
9fe70cb
652f1a9
* Tue Mar 09 2021 Jos de Kloe <josdekloe@gmail.com> 3.0.1-1
652f1a9
- Update to 3.0.1
652f1a9
- Add man page for standalone pyproj tool
652f1a9
041f6c6
* Sun Mar 07 2021 Sandro Mani <manisandro@gmail.com> - 3.0.0.post1-3
041f6c6
- Rebuild (proj)
041f6c6
fbb928e
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0.post1-2
fbb928e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
fbb928e
9a23bab
* Thu Nov 05 2020 Sandro Mani <manisandro@gmail.com> - 3.0.0.post1-1
9a23bab
- Update to 3.0.0 for proj-7.2.0 compatibility
9a23bab
aceb662
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1.post1-3
aceb662
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
aceb662
b774322
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.6.1.post1-2
233b14e
- Rebuilt for Python 3.9
233b14e
d35d592
* Thu May 21 2020 Jos de Kloe <josdekloe@gmail.com> 2.6.1.post1-1
d35d592
- Update to 2.6.1.post1
d35d592
1ce2bcd
* Thu Mar 19 2020 Jos de Kloe <josdekloe@gmail.com> 2.6.0-1
1ce2bcd
- Update to 2.6.0
1ce2bcd
3d909e7
* Sat Feb 29 2020 Jos de Kloe <josdekloe@gmail.com> 2.5.0-1
3d909e7
- Update to 2.5.0
4226673
c9a2fcd
* Sun Dec 01 2019 Jos de Kloe <josdekloe@gmail.com> 2.4.2.post1-1
c9a2fcd
- Update to 2.4.2.post1 and remove patch (fix was included upstream)
c9a2fcd
66a96f4
* Sat Nov 23 2019 Jos de Kloe <josdekloe@gmail.com> 2.4.1-2
66a96f4
- Patch bug that caused 6 failing tests on i686 architecture
66a96f4
  and clean up some no longer needed fixes
66a96f4
f4415ee
* Sat Nov 9 2019 Jos de Kloe <josdekloe@gmail.com> 2.4.1-1
f4415ee
- Update to 2.4.1
f4415ee
f9f2c06
* Sun Sep 08 2019 Jos de Kloe <josdekloe@gmail.com> 2.3.1-2
f9f2c06
- add documentation generation, fix python usage in it and add a doc subpackage
f9f2c06
b774322
* Wed Sep 4 2019 Devrim Günduz <devrim@gunduz.org> - 2.3.1-1
c393164
- Update to 2.3.1
c393164
b774322
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.9.6-4
a4d2a03
- Rebuilt for Python 3.8
a4d2a03
d767420
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.6-3
d767420
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
d767420
b774322
* Mon Feb 25 2019 Miro Hrončok <mhroncok@redhat.com> - 1.9.6-2
63f3afd
- Subpackage python2-pyproj has been removed
63f3afd
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
63f3afd
646a50e
* Sun Feb 17 2019 Jos de Kloe <josdekloe@gmail.com> 1.9.6-1
646a50e
- update to version 1.9.6, remove python2 sub-package for Fedora 30+
646a50e
- remove use of py3dir macro when building python3 sub-package
646a50e
2a09821
* Tue Feb 12 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.9.5.1-18
2a09821
- Rebuilt for updated Proj
2a09821
59ae6cd
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.5.1-17
59ae6cd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
59ae6cd
3f26f20
* Fri Aug 17 2018 Jos de Kloe <josdekloe@gmail.com> 1.9.5.1-16
b774322
- merge with cython patch by Miro Hrončok <pagure@pkgs.fedoraproject.org>
3f26f20
  (there is no more cython3 command; Cython behaves the same on both Pythons)
3f26f20
- remove the no_inv_hammer_test patch
3f26f20
576fbe9
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.5.1-15
576fbe9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
576fbe9
b774322
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.9.5.1-14
3e688f4
- Rebuilt for Python 3.7
3e688f4
8688e98
* Sat Feb 24 2018 Jos de Kloe <josdekloe@gmail.com> 1.9.5.1-13
8688e98
- Add explicit BuildRequires for gcc
8688e98
1c87cdd
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.5.1-12
1c87cdd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
1c87cdd
b76ed66
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.5.1-11
b76ed66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
b76ed66
900a139
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.5.1-10
900a139
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
900a139
Igor Gnatenko b7d99f4
* Fri Jul 07 2017 Igor Gnatenko <ignatenko@redhat.com> - 1.9.5.1-9
Igor Gnatenko b7d99f4
- Rebuild due to bug in RPM (RHBZ #1468476)
Igor Gnatenko b7d99f4
b774322
* Thu Jul 06 2017 Björn Esser <besser82@fedoraproject.org> - 1.9.5.1-8
c806a2a
- move package specific (Build)Requires in the correspondig sub-packages
c806a2a
b774322
* Thu Jul 06 2017 Björn Esser <besser82@fedoraproject.org> - 1.9.5.1-7
bcb10b5
- setup filtering for private libs correctly
bcb10b5
6fd5b99
* Fri Jun 30 2017 Jos de Kloe <josdekloe@gmail.com> 1.9.5.1-6
6fd5b99
- rename pyproj to python2-pyproj following the new package naming scheme
6fd5b99
b6163d9
* Wed Feb 01 2017 Jos de Kloe <josdekloe@gmail.com> 1.9.5.1-5
b6163d9
- force rebuild after libproj soname jump
b6163d9
b774322
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.9.5.1-4
3053776
- Rebuild for Python 3.6
3053776
ca3244a
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.5.1-3
ca3244a
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
ca3244a
402cbd7
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.5.1-2
402cbd7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
402cbd7
bf51713
* Thu Jan 14 2016 Jos de Kloe <josdekloe@gmail.com> 1.9.5.1-1
bf51713
- update to new upstream version
bf51713
- remove the inverse hammer test
bf51713
498e00c
* Thu Nov 12 2015 Jos de Kloe <josdekloe@gmail.com> 1.9.4-4
6e2e453
- apply patch to fix a bug in _proj.pyx that surfaced in cython 0.23
6e2e453
- apply chrpath to fix binary-or-shlib-defines-rpath error reported by rpmlint
6e2e453
2db8799
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.4-3
2db8799
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
2db8799
ef7eafa
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.4-2
ef7eafa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
ef7eafa
ff7206e
* Thu Mar 12 2015 Jos de Kloe <josdekloe@gmail.com> 1.9.4-1
ff7206e
- update to version 1.9.4
ff7206e
- replace python_sitearch macro with python2_sitearch
ff7206e
- replace the deprecated macro __python by __python3
ff7206e
- activate the check section
4544c32
ace7009
* Sat Jan 11 2014 Jos de Kloe <josdekloe@gmail.com> 1.9.2-8.20120712svn300
ace7009
- replace the deprecated macro __python by __python2
ace7009
- require proj-epsg to solve bug #1022238
ace7009
bd4353c
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.2-7.20120712svn300
bd4353c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
bd4353c
74369d0
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.2-6.20120712svn300
74369d0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
74369d0
ace7009
* Thu Jul 12 2012 Jos de Kloe <josdekloe@gmail.com> 1.9.2-5.20120712svn300
ace7009
- adapted version number format to comply to the Snapshot packages 
ace7009
  guidelines, and move to svn revision 300.
ace7009
41deeb1
* Wed Jun 20 2012 Jos de Kloe <josdekloe@gmail.com> 1.9.2-4.r298
ace7009
- Added proj-nad as explicit Requirement since it contains data files needed
ace7009
  to run the module, and bumped the version number to the one mentioned in 
ace7009
  the setup-proj.py script
ace7009
41deeb1
* Fri Jun 15 2012 Jos de Kloe <josdekloe@gmail.com> 1.9.0-3.r298
ace7009
- Adapted to build with python3
ace7009
ace7009
* Thu May 31 2012 Jos de Kloe <josdekloe@gmail.com> 1.9.0-2.r298
ace7009
- Adapted to svn revision r298 which has some modifications
ace7009
  to allow building without using the included proj sources
ace7009
b774322
* Mon Apr 23 2012 Volker Fröhlich <volker27@gmx.at> - 1.9.0-1
ace7009
- Initial package for Fedora