0b350af
#global commit 2a6ccdf99f9b580aff4ef4725720172235fa9da0
0b350af
#global shortcommit %(c=%{commit}; echo ${c:0:7})
0b350af
0b350af
%if 0%{?commit:1}
0b350af
%global source_folder geographiclib-code-%{commit}
0b350af
%else
0b350af
%global source_folder %{name}-%{version}
0b350af
%endif
0b350af
Orion Poplawski 2df5bad
# For octave scriptlets
Orion Poplawski 2df5bad
%global octpkg geographiclib
Orion Poplawski 2df5bad
23eb00f
Name:           GeographicLib
bb36f5d
Version:        1.52
4d5918a
Release:        8%{?commit:.git%{shortcommit}}%{?dist}
9b7572b
Summary:        Library for geographic coordinate transformations
23eb00f
23eb00f
License:        MIT
23eb00f
URL:            http://geographiclib.sourceforge.net/
0b350af
%if 0%{?commit:1}
0b350af
Source0:        https://sourceforge.net/code-snapshots/git/g/ge/geographiclib/code.git/geographiclib-code-%{commit}.zip
0b350af
%else
9b7572b
Source0:        http://downloads.sourceforge.net/geographiclib/%{name}-%{version}.tar.gz
0b350af
%endif
0b350af
# Bundle MATLAB scripts into octave packages
e738d99
# Not yet submitted upstream
0b350af
Patch1:         %{name}-1.48-octave.patch
0b350af
# Install nodejs files to arch-independent path
0b350af
Patch2:         %{name}-1.48-nodejs.patch
e775077
# Adapt test conditions to handle some cases -0.000
0b350af
Patch3:         %{name}-1.48-test.patch
23eb00f
23eb00f
BuildRequires:  cmake
23eb00f
BuildRequires:  doxygen
0b350af
BuildRequires:  gcc-c++
2abb307
BuildRequires:  make
0b350af
BuildRequires:  nodejs-packaging
0b350af
BuildRequires:  octave-devel
83c6037
BuildRequires:  python3-devel
92a21fa
BuildRequires:  python3-setuptools
23eb00f
564ee78
BuildRequires:  mingw32-filesystem >= 95
564ee78
BuildRequires:  mingw32-gcc-c++
564ee78
BuildRequires:  mingw32-python3
564ee78
BuildRequires:  mingw32-python3-setuptools
564ee78
564ee78
BuildRequires:  mingw64-filesystem >= 95
564ee78
BuildRequires:  mingw64-gcc-c++
564ee78
BuildRequires:  mingw64-python3
564ee78
BuildRequires:  mingw64-python3-setuptools
564ee78
23eb00f
%description
23eb00f
GeographicLib is a small set of C++ classes for performing conversions 
23eb00f
between geographic, UTM, UPS, MGRS, geocentric, and local Cartesian 
23eb00f
coordinates, for gravity (e.g., EGM2008), geoid height and geomagnetic 
23eb00f
field (e.g., WMM2010) calculations, and for solving geodesic problems. 
23eb00f
The emphasis is on returning accurate results with errors close to round-off 
23eb00f
(about 5–15 nanometers). New accurate algorithms for Geodesics on an 
23eb00f
ellipsoid of revolution and Transverse Mercator projection have been 
23eb00f
developed for this library. The functionality of the library can be accessed 
23eb00f
from user code, from the Utility programs provided, or via the 
23eb00f
Implementations in other languages.
23eb00f
0b350af
23eb00f
%package devel
0b350af
Summary:        Development files and libraries for %{name}
0b350af
Requires:       %{name}%{?_isa} = %{version}-%{release}
0b350af
Requires:       cmake
23eb00f
23eb00f
%description devel
23eb00f
This package contains the header files and libraries
23eb00f
for %{name}. If you like to develop programs using %{name},
23eb00f
you will need to install %{name}-devel.
23eb00f
0b350af
23eb00f
%package doc
0b350af
Summary:        Development documentation for %name
0b350af
BuildArch:      noarch
23eb00f
23eb00f
%description doc
23eb00f
This package contains doxygen-generated html API documentation for
23eb00f
the %{name} library.
23eb00f
23eb00f
83c6037
%package -n python3-%{name}
0b350af
Summary:        Python 3 implementation of %{name}
0b350af
BuildArch:      noarch
83c6037
83c6037
%description -n python3-%{name}
83c6037
A translation of the GeographicLib::Geodesic class to Python 3
23eb00f
0b350af
e738d99
%package -n octave-%{name}
0b350af
Summary:        Octave implementation of %{name}
0b350af
BuildArch:      noarch
e738d99
Requires:         octave >= 3.4
e738d99
Requires(post):   octave
9b7572b
Requires(postun): octave
e738d99
e738d99
%description -n octave-%{name}
e738d99
A translation of some of the GeographicLib C++ functionality to Octave
e738d99
0b350af
0b350af
%package -n nodejs-%{name}
0b350af
Summary:        NodeJS implementation of %{name}
0b350af
BuildArch:      noarch
0b350af
Requires:       nodejs
0b350af
0b350af
%description -n nodejs-%{name}
0b350af
A translation of some of the GeographicLib C++ functionality to NodeJS
0b350af
564ee78
%package -n mingw32-%{name}
564ee78
Summary:       MinGW Windows %{name} library
4343f68
BuildArch:     noarch
564ee78
564ee78
%description -n mingw32-%{name}
564ee78
MinGW Windows %{name} library.
564ee78
564ee78
564ee78
%package -n mingw32-python3-%{name}
564ee78
Summary:       MinGW Windows %{name} python 3 bindings
4343f68
BuildArch:     noarch
564ee78
564ee78
%description -n mingw32-python3-%{name}
564ee78
MinGW Windows %{name} python 3 bindings.
564ee78
564ee78
564ee78
%package -n mingw64-%{name}
564ee78
Summary:       MinGW Windows %{name} library
4343f68
BuildArch:     noarch
564ee78
564ee78
%description -n mingw64-%{name}
564ee78
MinGW Windows %{name} library.
564ee78
564ee78
564ee78
%package -n mingw64-python3-%{name}
564ee78
Summary:       MinGW Windows %{name} python 3 bindings
4343f68
BuildArch:     noarch
564ee78
564ee78
%description -n mingw64-python3-%{name}
564ee78
MinGW Windows %{name} python 3 bindings.
564ee78
564ee78
564ee78
%{?mingw_debug_package}
564ee78
0b350af
23eb00f
%prep
0b350af
%autosetup -p1 -n %{source_folder}
53bf605
# Use python macros to install python lib so that egg-info is also installed
53bf605
# rhbz#1724031
53bf605
sed -i "s|add_subdirectory (python/geographiclib)||" CMakeLists.txt
23eb00f
564ee78
23eb00f
%build
564ee78
# Native build
9b7572b
%cmake \
23eb00f
  -DGEOGRAPHICLIB_DATA="%{_datadir}/%{name}" \
23eb00f
  -DCOMMON_INSTALL_PATH=ON \
23eb00f
  -DGEOGRAPHICLIB_DOCUMENTATION=ON \
e738d99
  -DUSE_RPATH=OFF \
564ee78
  -DCMAKE_SKIP_INSTALL_RPATH=ON
9b7572b
%cmake_build
53bf605
pushd python
53bf605
%py3_build
564ee78
mv build build_native
564ee78
popd
564ee78
564ee78
# MinGW build
564ee78
%mingw_cmake \
564ee78
  -DCOMMON_INSTALL_PATH=ON \
564ee78
  -DUSE_RPATH=OFF \
564ee78
  -DCMAKE_SKIP_INSTALL_RPATH=ON
564ee78
%mingw_make_build
564ee78
pushd python
564ee78
%mingw32_py3_build
564ee78
%mingw64_py3_build
53bf605
popd
0b350af
564ee78
23eb00f
%install
564ee78
# Native build
9b7572b
%cmake_install
53bf605
pushd python
564ee78
ln -s build_native build
53bf605
%py3_install
564ee78
rm build
53bf605
popd
53bf605
23eb00f
rm -rf %{buildroot}/%{_datadir}/doc
23eb00f
rm -rf %{buildroot}/%{_libexecdir}
e738d99
mkdir -p %{buildroot}%{_datadir}/%{name}
e738d99
564ee78
# MinGW build
564ee78
%mingw_make_install
564ee78
pushd python
564ee78
%mingw32_py3_install
564ee78
%mingw64_py3_install
564ee78
popd
564ee78
564ee78
rm -rf %{buildroot}%{mingw32_datadir}/{matlab,octave}
564ee78
rm -rf %{buildroot}%{mingw64_datadir}/{matlab,octave}
564ee78
rm -rf %{buildroot}%{mingw32_mandir}
564ee78
rm -rf %{buildroot}%{mingw64_mandir}
564ee78
rm -rf %{buildroot}%{mingw32_docdir}
564ee78
rm -rf %{buildroot}%{mingw64_docdir}
564ee78
rm -rf %{buildroot}%{mingw32_libdir}/node_modules
564ee78
rm -rf %{buildroot}%{mingw64_libdir}/node_modules
564ee78
564ee78
564ee78
%mingw_debug_install_post
564ee78
0b350af
23eb00f
%check
9b7572b
%ctest
23eb00f
0b350af
e738d99
%post -n octave-%{name}
e738d99
%octave_cmd pkg rebuild
e738d99
e738d99
%preun -n octave-%{name}
e738d99
%octave_pkg_preun
e738d99
e738d99
%postun -n octave-%{name}
e738d99
%octave_cmd pkg rebuild
e738d99
e738d99
23eb00f
%files
0b350af
%doc AUTHORS NEWS
0b350af
%license LICENSE.txt
0b350af
%{_bindir}/CartConvert
0b350af
%{_bindir}/ConicProj
0b350af
%{_bindir}/GeoConvert
0b350af
%{_bindir}/GeodSolve
0b350af
%{_bindir}/GeodesicProj
0b350af
%{_bindir}/GeoidEval
0b350af
%{_bindir}/Gravity
0b350af
%{_bindir}/MagneticField
0b350af
%{_bindir}/Planimeter
0b350af
%{_bindir}/RhumbSolve
0b350af
%{_bindir}/TransverseMercatorProj
0b350af
%{_sbindir}/geographiclib-get-geoids
0b350af
%{_sbindir}/geographiclib-get-gravity
0b350af
%{_sbindir}/geographiclib-get-magnetic
e775077
%{_libdir}/libGeographic.so.19*
e738d99
%{_datadir}/%{name}
23eb00f
%{_mandir}/man1/*.1.*
23eb00f
%{_mandir}/man8/*.8.*
23eb00f
23eb00f
%files devel
0b350af
%{_includedir}/%{name}/
0b350af
%{_libdir}/libGeographic.so
0b350af
%{_libdir}/cmake/GeographicLib
0b350af
%{_libdir}/pkgconfig/geographiclib.pc
23eb00f
23eb00f
%files doc
0b350af
%license LICENSE.txt
c796558
%doc %{__cmake_builddir}/doc/html
23eb00f
83c6037
%files -n python3-%{name}
0b350af
%license LICENSE.txt
0b350af
%{python3_sitelib}/geographiclib/
bb36f5d
%{python3_sitelib}/geographiclib-%{version}-py%{python3_version}.egg-info
23eb00f
e738d99
%files -n octave-%{name}
0b350af
%license LICENSE.txt
Orion Poplawski 2df5bad
%{_datadir}/octave/packages/%{octpkg}-%{version}/
0b350af
0b350af
%files -n nodejs-%{name}
0b350af
%license LICENSE.txt
0b350af
%{nodejs_sitelib}/geographiclib/
0b350af
564ee78
%files -n mingw32-%{name}
564ee78
%license LICENSE.txt
564ee78
%{mingw32_bindir}/CartConvert.exe
564ee78
%{mingw32_bindir}/ConicProj.exe
564ee78
%{mingw32_bindir}/GeoConvert.exe
564ee78
%{mingw32_bindir}/GeodSolve.exe
564ee78
%{mingw32_bindir}/GeodesicProj.exe
564ee78
%{mingw32_bindir}/GeoidEval.exe
564ee78
%{mingw32_bindir}/Gravity.exe
564ee78
%{mingw32_bindir}/MagneticField.exe
564ee78
%{mingw32_bindir}/Planimeter.exe
564ee78
%{mingw32_bindir}/RhumbSolve.exe
564ee78
%{mingw32_bindir}/TransverseMercatorProj.exe
564ee78
%{mingw32_bindir}/libGeographic.dll
564ee78
%{mingw32_includedir}/%{name}/
564ee78
%{mingw32_libdir}/libGeographic.dll.a
564ee78
%{mingw32_libdir}/cmake/GeographicLib/
564ee78
%{mingw32_libdir}/pkgconfig/geographiclib.pc
564ee78
564ee78
%files -n mingw32-python3-%{name}
564ee78
%license LICENSE.txt
564ee78
%{mingw32_python3_sitearch}/geographiclib/
564ee78
%{mingw32_python3_sitearch}/geographiclib-%{version}-py%{mingw32_python3_version}.egg-info
564ee78
564ee78
564ee78
%files -n mingw64-%{name}
564ee78
%license LICENSE.txt
564ee78
%{mingw64_bindir}/CartConvert.exe
564ee78
%{mingw64_bindir}/ConicProj.exe
564ee78
%{mingw64_bindir}/GeoConvert.exe
564ee78
%{mingw64_bindir}/GeodSolve.exe
564ee78
%{mingw64_bindir}/GeodesicProj.exe
564ee78
%{mingw64_bindir}/GeoidEval.exe
564ee78
%{mingw64_bindir}/Gravity.exe
564ee78
%{mingw64_bindir}/MagneticField.exe
564ee78
%{mingw64_bindir}/Planimeter.exe
564ee78
%{mingw64_bindir}/RhumbSolve.exe
564ee78
%{mingw64_bindir}/TransverseMercatorProj.exe
564ee78
%{mingw64_bindir}/libGeographic.dll
564ee78
%{mingw64_includedir}/%{name}/
564ee78
%{mingw64_libdir}/libGeographic.dll.a
564ee78
%{mingw64_libdir}/cmake/GeographicLib/
564ee78
%{mingw64_libdir}/pkgconfig/geographiclib.pc
564ee78
564ee78
%files -n mingw64-python3-%{name}
564ee78
%license LICENSE.txt
564ee78
%{mingw64_python3_sitearch}/geographiclib/
564ee78
%{mingw64_python3_sitearch}/geographiclib-%{version}-py%{mingw64_python3_version}.egg-info
564ee78
e738d99
23eb00f
%changelog
4d5918a
* Fri Mar 25 2022 Sandro Mani <manisandro@gmail.com> - 1.52-8
4d5918a
- Rebuild with mingw-gcc-12
4d5918a
4343f68
* Thu Feb 24 2022 Sandro Mani <manisandro@gmail.com> - 1.52-7
4343f68
- Make mingw subpackages noarch
4343f68
564ee78
* Thu Feb 24 2022 Sandro Mani <manisandro@gmail.com> - 1.52-6
564ee78
- Add mingw subpackages
564ee78
e0122c9
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.52-4
e0122c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
e0122c9
3767983
* Wed Aug 11 2021 Orion Poplawski <orion@nwra.com> - 1.52-3
3767983
- Rebuild for octave 6.3.0
3767983
61c6bff
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.52-2
61c6bff
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
61c6bff
bb36f5d
* Wed Jun 23 2021 Sandro Mani <manisandro@gmail.com> - 1.52-1
bb36f5d
- Update to 1.52
bb36f5d
ddf3ad9
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.51-3
ddf3ad9
- Rebuilt for Python 3.10
ddf3ad9
d391a3b
* Mon Jan 25 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.51-2
d391a3b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
d391a3b
637ccf5
* Sun Nov 22 2020 Sandro Mani <manisandro@gmail.com> - 1.51-1
637ccf5
- Update to 1.51
637ccf5
ac00a27
* Tue Aug 18 2020 Jeff Law <law@redhat.com> - 1.50.1-5
ac00a27
- Fix to work with C++17 (streamoff is in std:: not std::ios::)
ac00a27
16d292b
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.50.1-4
16d292b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
16d292b
9350d14
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.50.1-3
9350d14
- Rebuilt for Python 3.9
9350d14
6a08416
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.50.1-2
6a08416
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
6a08416
4245af4
* Thu Dec 12 2019 Sandro Mani <manisandro@gmail.com> - 1.50.1-1
4245af4
- Update to 1.50.1
4245af4
e775077
* Fri Sep 27 2019 Sandro Mani <manisandro@gmail.com> - 1.50-1
e775077
- Update to 1.50
e775077
73cad9e
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.49-11
73cad9e
- Rebuilt for Python 3.8
73cad9e
0d471e0
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.49-10
0d471e0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
0d471e0
53bf605
* Thu Jun 27 2019 Rich Mattes <richmattes@gmail.com> - 1.49-9
53bf605
- Use setup.py to install python library (rhbz#1724031)
53bf605
14f2ec7
* Sun Jun 16 2019 Orion Poplawski <orion@nwra.com> - 1.49-8
14f2ec7
- Rebuild for octave 5.1
14f2ec7
150a0c2
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.49-7
150a0c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
150a0c2
647a94d
* Tue Jan 15 2019 Miro Hrončok <mhroncok@redhat.com> - 1.49-6
647a94d
- Subpackage python2-GeographicLib has been removed
647a94d
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
647a94d
Orion Poplawski 3706e4b
* Wed Nov 14 2018 Orion Poplawski <orion@cora.nwra.com> - 1.49-5
Orion Poplawski 3706e4b
- Rebuild for octave 4.4
Orion Poplawski 3706e4b
7171062
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.49-4
7171062
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
7171062
58dbccb
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.49-3
58dbccb
- Rebuilt for Python 3.7
58dbccb
076775b
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.49-2
076775b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
076775b
0cc6cfb
* Sun Oct 08 2017 Sandro Mani <manisandro@gmail.com> - 1.49-1
0cc6cfb
- Update to 1.49
0cc6cfb
f59fc26
* Mon Aug 07 2017 Björn Esser <besser82@fedoraproject.org> - 1.48-5
f59fc26
- Rebuilt for AutoReq cmake-filesystem
f59fc26
d982eba
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.48-4
d982eba
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
d982eba
226f1e2
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.48-3
226f1e2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
226f1e2
Orion Poplawski 2df5bad
* Thu Jun 15 2017 Orion Poplawski <orion@cora.nwra.com> - 1.48-2
Orion Poplawski 2df5bad
- Define %%octpkg for octave scriptlets
Orion Poplawski 2df5bad
0b350af
* Wed Jun 07 2017 Sandro Mani <manisandro@gmail.com> - 1.48-1
0b350af
- Update to 1.48
0b350af
0cf4403
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.43-9
0cf4403
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
0cf4403
3df10a2
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.43-8
3df10a2
- Rebuild for Python 3.6
3df10a2
Orion Poplawski c430018
* Wed Dec 07 2016 Orion Poplawski <orion@cora.nwra.com> - 1.43-7
Orion Poplawski c430018
- Rebuild for octave 4.2
Orion Poplawski c430018
5d7114a
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.43-6
5d7114a
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
5d7114a
266a25f
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.43-5
266a25f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
266a25f
fe9ab93
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.43-4
fe9ab93
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
fe9ab93
83c6037
* Fri Jul 3 2015 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.43-3
83c6037
- Add Python 3 subpackage
83c6037
271cd2c
* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.43-2
271cd2c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
271cd2c
cec39b8
* Fri May 22 2015 Rich Mattes <richmattes@gmail.com> - 1.43-1
cec39b8
- Update to release 1.43
cec39b8
e738d99
* Mon May 04 2015 Rich Mattes <richmattes@gmail.com> - 1.42-1
e738d99
- Update to release 1.42
e738d99
- Add octave subpackage
e738d99
257ef03
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 1.40-2
257ef03
- Rebuilt for GCC 5 C++11 ABI change
257ef03
1dbc9fd
* Fri Jan 02 2015 Rich Mattes <richmattes@gmail.com> - 1.40-1
1dbc9fd
- Update to release 1.40
1dbc9fd
23eb00f
* Sat Oct 04 2014 Rich Mattes <richmattes@gmail.com> - 1.38-2
23eb00f
- Fix cmake installation directory
23eb00f
23eb00f
* Sat Oct 04 2014 Rich Mattes <richmattes@gmail.com> - 1.38-1
23eb00f
- Update to 1.38
23eb00f
- Change BR from python2 to python2-devel
23eb00f
- Remove buildroot cleanup from install section
23eb00f
23eb00f
* Fri Sep 19 2014 Rich Mattes <richmattes@gmail.com> - 1.37-1
23eb00f
- Initial package