Blob Blame History Raw
# For octave scriptlets
%global octpkg geographiclib

Name:           GeographicLib
Version:        1.43
Release:        10%{?dist}
Summary:        Library for geographic coordinate transformations 

License:        MIT
URL:            http://geographiclib.sourceforge.net/
Source0:        http://downloads.sourceforge.net/geographiclib/%{name}-%{version}.tar.gz 
# Use PythonInterp to set the python version for installation directory,
# and install python lib to arch-independent path
# Not yet submitted upstream
Patch0:         %{name}-1.37-python.patch
# Bundle MATLAB scripts into octave patckages
# Not yet submitted upstream
Patch1:         %{name}-1.42-octave.patch

BuildRequires:  cmake
BuildRequires:  doxygen
BuildRequires:  python2-devel
BuildRequires:  python3-devel

%description
GeographicLib is a small set of C++ classes for performing conversions 
between geographic, UTM, UPS, MGRS, geocentric, and local Cartesian 
coordinates, for gravity (e.g., EGM2008), geoid height and geomagnetic 
field (e.g., WMM2010) calculations, and for solving geodesic problems. 
The emphasis is on returning accurate results with errors close to round-off 
(about 5–15 nanometers). New accurate algorithms for Geodesics on an 
ellipsoid of revolution and Transverse Mercator projection have been 
developed for this library. The functionality of the library can be accessed 
from user code, from the Utility programs provided, or via the 
Implementations in other languages.

%package devel
Summary: Development files and libraries for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}

%description devel
This package contains the header files and libraries
for %{name}. If you like to develop programs using %{name},
you will need to install %{name}-devel.

%package doc
Summary: Development documentation for %name
BuildArch: noarch

%description doc
This package contains doxygen-generated html API documentation for
the %{name} library.

%package -n python-%{name}
Summary:   Python 2 implementation of %{name}
BuildArch: noarch

%description -n python-%{name}
A translation of the GeographicLib::Geodesic class to Python 2

%package -n python3-%{name}
Summary:   Python 3 implementation of %{name}
BuildArch: noarch

%description -n python3-%{name}
A translation of the GeographicLib::Geodesic class to Python 3

%package -n octave-%{name}
Summary:   Octave implementation of %{name}
BuildArch: noarch
BuildRequires:    octave-devel
Requires:         octave >= 3.4
Requires(post):   octave
Requires(postun): octave 

%description -n octave-%{name}
A translation of some of the GeographicLib C++ functionality to Octave

%prep
%setup -q
%patch0 -p0 -b .python
%patch1 -p0 -b .octave

%build
mkdir build; pushd build;
%cmake .. \
  -DGEOGRAPHICLIB_DATA="%{_datadir}/%{name}" \
  -DCOMMON_INSTALL_PATH=ON \
  -DGEOGRAPHICLIB_DOCUMENTATION=ON \
  -DUSE_RPATH=OFF \
  -DCMAKE_SKIP_INSTALL_RPATH=ON
popd
make -C build %{?_smp_mflags}

mkdir build_python3; pushd build_python3;
%cmake .. \
  -DGEOGRAPHICLIB_DATA="%{_datadir}/%{name}" \
  -DCOMMON_INSTALL_PATH=ON \
  -DGEOGRAPHICLIB_DOCUMENTATION=ON \
  -DUSE_RPATH=OFF \
  -DCMAKE_SKIP_INSTALL_RPATH=ON \
  -DPython_ADDITIONAL_VERSIONS=3
popd

%install
%make_install -C build
%make_install -C build_python3/python/geographiclib
rm -f %{buildroot}/%{_libdir}/*.la
rm -f %{buildroot}/%{_libdir}/*.a
rm -rf %{buildroot}/%{_datadir}/doc
rm -rf %{buildroot}/%{_libexecdir}

mkdir -p %{buildroot}%{_datadir}/%{name}

%check
make -C build test

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%post -n octave-%{name}
%octave_cmd pkg rebuild

%preun -n octave-%{name}
%octave_pkg_preun

%postun -n octave-%{name}
%octave_cmd pkg rebuild


%files
%license LICENSE.txt
%doc AUTHORS NEWS
%{_datadir}/%{name}
%{_bindir}/*
%{_sbindir}/*
%{_libdir}/*.so.*
%{_mandir}/man1/*.1.*
%{_mandir}/man8/*.8.*

%files devel
%{_includedir}/%{name}
%{_libdir}/*.so
%{_libdir}/cmake

%files doc
%license LICENSE.txt
%doc build/doc/html

%files -n python-%{name}
%license LICENSE.txt
%{python2_sitelib}/geographiclib

%files -n python3-%{name}
%license LICENSE.txt
%{python3_sitelib}/geographiclib

%files -n octave-%{name}
%license LICENSE.txt
%{_datadir}/octave/packages/%{octpkg}-%{version}

%changelog
* Sat Jun 17 2017 Rich Mattes <richmattes@gmail.com> - 1.43-10
- Add %%octpkg definition for octave macros

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.43-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.43-8
- Rebuild for Python 3.6

* Wed Dec 07 2016 Orion Poplawski <orion@cora.nwra.com> - 1.43-7
- Rebuild for octave 4.2

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.43-6
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.43-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.43-4
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Fri Jul 3 2015 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.43-3
- Add Python 3 subpackage

* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.43-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri May 22 2015 Rich Mattes <richmattes@gmail.com> - 1.43-1
- Update to release 1.43

* Mon May 04 2015 Rich Mattes <richmattes@gmail.com> - 1.42-1
- Update to release 1.42
- Add octave subpackage

* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 1.40-2
- Rebuilt for GCC 5 C++11 ABI change

* Fri Jan 02 2015 Rich Mattes <richmattes@gmail.com> - 1.40-1
- Update to release 1.40

* Sat Oct 04 2014 Rich Mattes <richmattes@gmail.com> - 1.38-2
- Fix cmake installation directory

* Sat Oct 04 2014 Rich Mattes <richmattes@gmail.com> - 1.38-1
- Update to 1.38
- Change BR from python2 to python2-devel
- Remove buildroot cleanup from install section

* Fri Sep 19 2014 Rich Mattes <richmattes@gmail.com> - 1.37-1
- Initial package