Blob Blame History Raw
Name:           GeographicLib
Version:        1.38
Release:        2%{?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 submitted upstream
Patch0:         %{name}-1.37-python.patch
# Add an option to disable rpath on installed binaries
# Not submitted upstream
Patch1:         %{name}-1.37-rpath.patch
# Install cmake files to datadir/prooject/cmake
# Not submitted upstream
Patch2:         %{name}-1.38-cmakeinstall.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

%prep
%setup -q
%patch0 -p0 -b .python
%patch1 -p0 -b .rpath
%patch2 -p0 -b .cmakeinstall

%build
mkdir build; pushd build;
%cmake .. \
  -DGEOGRAPHICLIB_DATA="%{_datadir}/%{name}" \
  -DCOMMON_INSTALL_PATH=ON \
  -DGEOGRAPHICLIB_DOCUMENTATION=ON \
  -DUSE_RPATH=OFF
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}

%check
make -C build test

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

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

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

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

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

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