File GeographicLib.spec of Package GeographicLib

#
# spec file for package 
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define git_rev 4a99e5f3

Name:           GeographicLib
Version:        2.6
Release:	0
License:	X11
Summary:	Programs for geographic transformations
Url:		http://geographiclib.sourceforge.net/html/index.html
Group:		System/Libraries
Source:		http://sf.net/projects/geographiclib/files/distrib/geographiclib-%{git_rev}.tar.bz2
Source1:	http://sf.net/projects/geographiclib/files/geoids-distrib/egm84-30.tar.bz2
Source2:	http://sf.net/projects/geographiclib/files/geoids-distrib/egm84-15.tar.bz2
Source3:	http://sf.net/projects/geographiclib/files/geoids-distrib/egm96-15.tar.bz2
Source4:	http://sf.net/projects/geographiclib/files/geoids-distrib/egm96-5.tar.bz2
Source5:	http://sf.net/projects/geographiclib/files/geoids-distrib/egm2008-5.tar.bz2
Source6:	http://sf.net/projects/geographiclib/files/geoids-distrib/egm2008-2_5.tar.bz2
Source7:	http://sf.net/projects/geographiclib/files/geoids-distrib/egm2008-1.tar.bz2
BuildRequires:	gcc-c++
BuildRequires:	perl
BuildRequires:	doxygen
BuildRequires:	cmake
BuildRequires:	fdupes
BuildRequires:  pkg-config
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

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

%package -n libGeographicLib26
Summary:	Libarary for geographic transformations
Group:		System/Libraries
Requires:	EMG

%description -n libGeographicLib26
This package contains the libraries needed by GeographicLib and others.

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.

%package data
Summary:	EGM data file needed by libGeographic
Group:		System/Libraries
Provides:	EMG = 84
Provides:	EMG = 96
Provides:	EMG = 2008
Provides:	EMG84
Provides:	EMG96
Provides:	EMG2008
Provides:	egm2008-1.pgm
Provides:	egm2008-2_5.pgm
Provides:	egm2008-5.pgm
Provides:	egm84-15.pgm
Provides:	egm84-30.pgm
Provides:	egm96-15.pgm
Provides:	egm96-5.pgm
BuildArch:      noarch

%description data
This package contains the EMG 84,96,2008 data files needed by libGeographic.

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.

%package docs
Summary:        Documentation for GeographicLib
Group:          System/Libraries
BuildArch:      noarch

%description docs
This package contains the documentation related to GeographicLib-devel.

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.

%package devel
Summary:	Development files for libGeographic
Requires:	libGeographicLib26 = %version
Group:          Development/Sources

%description devel
Development files for libGeographic.

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.

%prep
%setup -q -n geographiclib-%{git_rev}

%build
%cmake \
	-D GEOGRAPHICLIB_DATA="%{_datadir}/%{name}" \
	-D CMAKEDIR="%{_datadir}/cmake/%{name}" \
	-D PKGDIR="%{_libdir}/pkgconfig" \
	-D DOCDIR="%{_docdir}/%{name}-docs" \
	-D EXAMPLEDIR="%{_docdir}/%{name}-docs/examples" \
	-D GEOGRAPHICLIB_PRECISION="3" \
	-D BUILD_DOCUMENTATION="ON"
%cmake_build

%install
%cmake_install

mkdir -p %{buildroot}/%{_datadir}/%{name}
cd %{buildroot}/%{_datadir}/%{name}
tar -xf %{SOURCE1}
tar -xf %{SOURCE2}
tar -xf %{SOURCE3}
tar -xf %{SOURCE4}
tar -xf %{SOURCE5}
tar -xf %{SOURCE6}
tar -xf %{SOURCE7}

%fdupes %buildroot/%{_docdir}/%{name}

%post -n libGeographicLib26
/sbin/ldconfig

%postun -n libGeographicLib26
/sbin/ldconfig

%files
%defattr(-,root,root)
%doc NEWS LICENSE.txt AUTHORS
%{_bindir}/*
%{_sbindir}/*
%dir %{_datadir}/%{name}
%{_mandir}/man1/*
%{_mandir}/man8/*

%files -n libGeographicLib26
%defattr(-,root,root)
%doc NEWS LICENSE.txt AUTHORS
%{_libdir}/libGeographicLib.so.*

%files data
%defattr(-,root,root)
%license LICENSE.txt
%{_datadir}/%{name}/geoids

%files docs
%doc NEWS LICENSE.txt AUTHORS
%doc %{_docdir}/%{name}-docs

%files devel
%defattr(-,root,root)
%doc NEWS LICENSE.txt AUTHORS
%{_includedir}/%{name}
%{_libdir}/libGeographicLib.so
%{_libdir}/pkgconfig/geographiclib.pc
%{_datadir}/cmake/%{name}

%changelog

openSUSE Build Service is sponsored by