Blob Blame History Raw
%global testcommit 54c45802006274caf88f8451c03f7cb90768757d

Name:           libosmium
Version:        2.2.0
Release:        7%{?dist}
Summary:        Fast and flexible C++ library for working with OpenStreetMap data

License:        Boost
URL:            http://osmcode.org/libosmium/
Source0:        https://github.com/osmcode/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        https://github.com/osmcode/osm-testdata/archive/%{testcommit}/osm-testdata-%{testcommit}.tar.gz

BuildRequires:  cmake
BuildRequires:  doxygen graphviz xmlstarlet
BuildRequires:  ruby spatialite-tools

BuildRequires:  boost-devel
BuildRequires:  protobuf-devel protobuf-lite-devel
BuildRequires:  osmpbf-devel
BuildRequires:  expat-devel
BuildRequires:  zlib-devel
BuildRequires:  bzip2-devel
BuildRequires:  sparsehash-devel
BuildRequires:  gdal-devel
BuildRequires:  geos-devel
BuildRequires:  proj-devel proj-epsg

%description
A fast and flexible C++ library for working with OpenStreetMap data.

%package        devel
Summary:        Development files for %{name}
Provides:       %{name}-static = %{version}-%{release}

Requires:       boost-devel
Requires:       protobuf-devel protobuf-lite-devel protobuf-compiler
Requires:       osmpbf-devel
Requires:       expat-devel
Requires:       zlib-devel
Requires:       bzip2-devel
Requires:       sparsehash-devel
Requires:       gdal-devel
Requires:       geos-devel
Requires:       proj-devel

%description    devel
This package contains libraries and header files for
developing applications that use %{name}.

%package        doc
Summary:        Documentation for %{name}
BuildArch:      noarch

%description    doc
This package contains documentation for developing
applications that use %{name}.


%prep
%setup -q -c -T -a 0 -a 1
mv %{name}-%{version} %{name}
mv osm-testdata-%{testcommit} osm-testdata
rm -f libosmium/include/boost_unicode_iterator.hpp
mkdir libosmium/build


%build
cd libosmium/build
%cmake .. -DBUILD_HEADERS=ON -DBUILD_DATA_TESTS=ON
%make_build
%make_build doc


%install
cd libosmium/build
%make_install
rm -rf %{buildroot}%{_docdir}


%check
cd libosmium/build
ctest -V


%files devel
%doc libosmium/README.md
%license libosmium/LICENSE.txt
%{_includedir}/osmium


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


%changelog
* Tue Jul 21 2015 Tom Hughes <tom@compton.nu> - 2.2.0-7
- Rebuild for boost 1.58.0

* Tue Jul 21 2015 Tom Hughes <tom@compton.nu> - 2.2.0-6
- Enable data tests

* Sat Jul 18 2015 Tom Hughes <tom@compton.nu> - 2.2.0-5
- Add license to doc subpackage

* Thu Jul 16 2015 Tom Hughes <tom@compton.nu> - 2.2.0-4
- Remove bundled header

* Thu Jul 16 2015 Tom Hughes <tom@compton.nu> - 2.2.0-3
- Use %%cmake

* Wed Jul 15 2015 Tom Hughes <tom@compton.nu> - 2.2.0-2
- Make devel subpackage an arched package
- Move documentation to doc subpackage

* Sun Jul 12 2015 Tom Hughes <tom@compton.nu> - 2.2.0-1
- Update to 2.2.0 upstream release

* Mon Jun  8 2015 Tom Hughes <tom@compton.nu> - 2.1.0-1
- Initial build