pkubat / rpms / pgRouting

Forked from rpms/pgRouting 5 years ago
Clone
Blob Blame History Raw
# Downstream ELGIS has gaul
%global with_gaul 0

%global tarname pgrouting

Name:		pgRouting
Version:	1.05
Release:	1%{?dist}
Summary:	Provides routing functionality to PostGIS/PostgreSQL
Group:		Applications/Databases

# shooting_star* are under the latter license
License:	GPLv2+ and Boost
URL:		http://pgrouting.org
Source0:    http://download.osgeo.org/%{tarname}/source/%{tarname}-%{version}.tar.gz

# Removes the preset CFLAGS and CXXFLAGS
# https://github.com/pgRouting/pgrouting/issues/64
Patch1:	    %{tarname}-1.05-flags.patch	

BuildRequires:	boost-devel
BuildRequires:	CGAL-devel
BuildRequires:	cmake
BuildRequires:	postgresql-devel
BuildRequires:	proj-devel

%if 0%{with_gaul}
BuildRequires:	gaul-devel
%endif

Requires:	postgis

%description
pgRouting extends the PostGIS / PostgreSQL geospatial database to provide
geospatial routing functionality.

It provides functions for:

- Shortest Path Dijkstra: routing algorithm without heuristics
- Shortest Path A-Star: routing for large datasets (with heuristics)
- Shortest Path Shooting-Star: routing with turn restrictions (with heuristics)
%if 0%{with_gaul}
- Traveling Salesperson Problem (TSP)
%endif
- Driving Distance calculation (Isolines)


%prep
%setup -qn %{tarname}-%{version}
%patch1 -p1 -b .flags~

# Correct FSF address
# https://github.com/pgRouting/pgrouting/issues/63
# Corrected for 2.0
find . \( -name *.cpp -o -name *.c -o -name *.h -o -name *.sql \) -print | xargs -i \
    sed -i 's/59 Temple Place\(, \| - \)Suite 330/51 Franklin Street, Fifth Floor/;s/02111-1307/02110-1301/' {}

# Fix boost property_map files path
# Corrected for releases after 1.05
sed -i "s|boost/vector_property_map.hpp|boost/property_map/vector_property_map.hpp|" \
    core/src/shooting_star_boost_wrapper.cpp

sed -i "s|boost/property_map.hpp|boost/property_map/property_map.hpp|" \
    core/src/shooting_star_relax.hpp \
    core/src/edge_visitors.hpp

# https://github.com/pgRouting/pgrouting/issues/45
# fix to avoid deprecated "boost/graph/detail/is_same.hpp" file
sed -i "s|boost/graph/detail/is_same.hpp|boost/type_traits/is_same.hpp|" core/src/edge_visitors.hpp


%build
# This is a custom flag, hardcoded and removed by patch1
export CFLAGS=$CFLAGS" -frounding-math"
export CXXLAGS=$CXXFLAGS" -frounding-math"
install -d build
cd build

# TSP requires libgaul http://sourceforge.net/projects/gaul
# Last update there was in 2006 and we don't have a package
%cmake .. \
	-DWITH_DD=ON \
%if 0%{with_gaul}
	-DWITH_TSP=ON
%endif

make VERBOSE=1 %{?_smp_mflags}


%install
make -C build install DESTDIR=%{buildroot}


%files
%doc README.routing COPYING authors.txt BOOST_LICENSE_1_0.txt RELEASE_NOTES
%{_libdir}/pgsql/*.so
%{_datadir}/postlbs

%changelog
* Wed Aug 15 2012 Volker Fröhlich <volker27@gmx.at> - 1.05-1
- Update to 1.05
- Update URL
- Update description
- Correct FSF address
- Retire patch0
- Introduce macros with_gaul and tarname; create conditionals based on the first
- Update flags patch and manually add custom flag
- Replace make macros with the command
- Remove unnecessary BR geos-devel
- Remove unnecessary R postgresql; Postgis takes care of that
- Drop rm for buildroot before install
- Drop ldconfig, because libs are in sub-directory
- Drop version requirements in BRs and Requires.
  All shipped versions are new enough in Fedora
- Enable DD option and added BR CGAL-devel
- Simplify attr and drop defattr in files section

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.03-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sun Nov 14 2010 Viji Nair <viji [AT] fedoraproject DOT org> - 1.03-3
- Fixed patch naming conventions.
- Added backup option for files being patched with suffix.
- Changed the package name from postgresql-pgrouting to pgRouting

* Sun Nov 14 2010 Viji Nair <viji [AT] fedoraproject DOT org> - 1.03-2
- Changed the license to GPLv2+ and Boost.
- Removed the override of CMAKE_INSTALL_PREFIX.
- Removed test for %%{?_lib}.
- Added VERBOSE=1 and %%{?_smp_mflags} for make.
- Patch for removing the preset CFLAGS.
- Removed gcc-c++ from BuildRequires.

* Thu Nov 11 2010 Viji Nair <viji [AT] fedoraproject DOT org> - 1.03-1
- Initial import.