pgrouting-2.0.0.ebuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. POSTGRES_COMPAT=( 9.{0,1,2,3,4} )
  5. inherit eutils cmake-utils
  6. DESCRIPTION="pgRouting extends PostGIS and PostgreSQL with geospatial routing functionality."
  7. HOMEPAGE="http://pgrouting.org/index.html"
  8. LICENSE="GPL-2 MIT Boost-1.0"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. SRC_URI="https://github.com/pgRouting/pgrouting/archive/v${PV}.tar.gz -> ${PN}-${PV}.tar.gz"
  12. IUSE="+drivingdistance doc pdf html"
  13. REQUIRED_USE="html? ( doc ) pdf? ( doc )"
  14. RDEPEND="
  15. || (
  16. dev-db/postgresql:9.4[server]
  17. dev-db/postgresql:9.3[server]
  18. dev-db/postgresql:9.2[server]
  19. dev-db/postgresql:9.1[server]
  20. dev-db/postgresql:9.0[server]
  21. )
  22. >=dev-db/postgis-2.0
  23. dev-libs/boost
  24. drivingdistance? ( sci-mathematics/cgal )
  25. "
  26. DEPEND="
  27. doc? ( >=dev-python/sphinx-1.1 )
  28. pdf? ( >=dev-python/sphinx-1.1[latex] )
  29. "
  30. # Needs a running psql instance, doesn't work out of the box
  31. RESTRICT="test"
  32. postgres_check_slot() {
  33. if ! declare -p POSTGRES_COMPAT &>/dev/null; then
  34. die 'POSTGRES_COMPAT not declared.'
  35. fi
  36. # Don't die because we can't run postgresql-config during pretend.
  37. [[ "$EBUILD_PHASE" = "pretend" \
  38. && -z "$(which postgresql-config 2> /dev/null)" ]] && return 0
  39. local res=$(echo ${POSTGRES_COMPAT[@]} \
  40. | grep -c $(postgresql-config show 2> /dev/null) 2> /dev/null)
  41. if [[ "$res" -eq "0" ]] ; then
  42. eerror "PostgreSQL slot must be set to one of: "
  43. eerror " ${POSTGRES_COMPAT[@]}"
  44. return 1
  45. fi
  46. return 0
  47. }
  48. pkg_pretend() {
  49. postgres_check_slot || die
  50. }
  51. pkg_setup() {
  52. postgres_check_slot || die
  53. }
  54. src_prepare() {
  55. epatch "${FILESDIR}/no-contrib-when-use-extension.patch"
  56. }
  57. src_configure() {
  58. local mycmakeargs=(
  59. $(cmake-utils_use_with drivingdistance DD)
  60. $(cmake-utils_use_with doc DOC)
  61. $(cmake-utils_use_build doc MAN)
  62. $(cmake-utils_use_build html HTML)
  63. $(cmake-utils_use_build pdf LATEX)
  64. )
  65. cmake-utils_src_configure
  66. }
  67. src_compile() {
  68. local make_opts
  69. use doc && make_opts="all doc"
  70. cmake-utils_src_make ${make_opts}
  71. }
  72. src_install() {
  73. use doc && doman "${BUILD_DIR}"/doc/man/en/pgrouting.7
  74. use html && dohtml -r "${BUILD_DIR}"/doc/html/*
  75. use pdf && dodoc "${BUILD_DIR}"/doc/latex/en/*.pdf
  76. dodoc README* VERSION
  77. cmake-utils_src_install
  78. }