Blob Blame History Raw
Name:      spatialindex
Version:   1.7.1
Release:   3%{?dist}
Summary:   Spatial index library 
Group:     System Environment/Libraries
License:   LGPLv2+
URL:       http://libspatialindex.github.com
Source0:   http://download.osgeo.org/lib%{name}/%{name}-src-%{version}.tar.bz2

# Create proper soname symlinks and versioned libspatialindex_c
# https://github.com/libspatialindex/libspatialindex/issues/9
# https://github.com/libspatialindex/libspatialindex/issues/6
Patch0:    %{name}-1.7.1-soname-includedir.patch

BuildRequires:    cmake


%description
Spatialindex provides a general framework for developing spatial indices.
Currently it defines generic interfaces, provides simple main memory and
disk based storage managers and a robust implementation of an R*-tree,
an MVR-tree and a TPR-tree.

%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}

%description devel
Development files for %{name}.


%prep
%setup -qn %{name}-src-%{version}
%patch0 -p1 -b .soname-includedir~

# Correct FSF postal address
# https://github.com/libspatialindex/libspatialindex/issues/5
for f in $(find . \( -name "*.h" -o -name "*.cc" -o -name COPYING \)); do
    sed -e 's/59 Temple Place, Suite 330/51 Franklin Street, Fifth Floor/' \
    -e 's/02111-1307/02110-1301/' $f > $f.tmp \
    && touch -r $f $f.tmp \
    && mv $f.tmp $f
done


%build
%cmake .
make %{?_smp_mflags}


%install
make install DESTDIR=%{buildroot}

# https://github.com/libspatialindex/libspatialindex/issues/6
# Upstream changed the include dir but forgot to update the include directive
#sed -i 's|#include <spatialindex/tools/Tools.h>|#include <libspatialindex/tools/Tools.h>|' include/spatialindex/Point.h
#mv %{buildroot}%{_includedir}/lib%{name} %{buildroot}%{_includedir}/%{name} 

# Tests must be run manually and seemingly are not built yet
# See changelog 2011-10-11


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files 
%doc AUTHORS ChangeLog COPYING README
%{_libdir}/lib%{name}*.so.*

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


%changelog
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Mon Apr  9 2012 Volker Fröhlich <volker27@gmx.at> - 1.7.1-2
- Patch build system to install to the expected include dir
  and produce proper soname symlinks and fully versioned C
  API library

* Sun Apr  8 2012 Volker Fröhlich <volker27@gmx.at> - 1.7.1-1
- Update for new release
- Drop 64 bit patch
- Header permissions are correct now
- Move header files to spatialindex sub-directory
- Correct FSF address in all files
- Update URL
- Upstream switched to Cmake
- No more issues with rpath, libtool archives or undefined symbols

* Tue Feb 28 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.1-5
- Rebuilt for c++ ABI breakage

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Thu Aug 04 2011 Volker Fröhlich <volker27@gmx.at> - 1.6.1-3
- Preserve timestamps by using install -p

* Thu Aug 04 2011 Volker Fröhlich <volker27@gmx.at> - 1.6.1-2
- Generalized file list to avoid specifying so-version
- Adapt Require in sub-package to guidelines
- Removed BR chrpath; using approach from
  http://fedoraproject.org/wiki/Packaging:Guidelines#Removing_Rpath
- Correct FSF postal address

* Thu Jun 02 2011 Volker Fröhlich <volker27@gmx.at> - 1.6.1-1
- Initial packaging