Blob Blame History Raw
Name:           GeographicLib
Version:        1.43
Release:        1%{?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

%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 implementation of %{name}
BuildArch: noarch

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

%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}


%install
%make_install -C build
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
%doc AUTHORS LICENSE.txt NEWS
%{_datadir}/%{name}
%{_bindir}/*
%{_sbindir}/*
%{_libdir}/*.so.*
%{_mandir}/man1/*.1.*
%{_mandir}/man8/*.8.*

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

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

%files -n python-%{name}
%doc LICENSE.txt
%{python_sitelib}/geographiclib

%files -n octave-%{name}
%{_datadir}/octave/packages/*

%changelog
* 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