paludis-2.6.0.ebuild 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 )
  5. # matching profile defaults for now
  6. RUBY_VER=2.1
  7. inherit bash-completion-r1 eutils python-single-r1 user
  8. DESCRIPTION="paludis, the other package mangler"
  9. HOMEPAGE="http://paludis.exherbo.org/"
  10. SRC_URI="http://paludis.exherbo.org/download/${P}.tar.bz2"
  11. IUSE="doc pbins pink python ruby search-index test +xml"
  12. LICENSE="GPL-2 vim"
  13. SLOT="0"
  14. KEYWORDS="~alpha amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86"
  15. COMMON_DEPEND="
  16. >=app-admin/eselect-1.2.13
  17. >=app-shells/bash-3.2:0
  18. dev-libs/libpcre[cxx]
  19. sys-apps/file
  20. pbins? ( >=app-arch/libarchive-3.1.2 )
  21. python? (
  22. ${PYTHON_DEPS}
  23. >=dev-libs/boost-1.41.0[python,${PYTHON_USEDEP}] )
  24. ruby? ( dev-lang/ruby:${RUBY_VER} )
  25. search-index? ( >=dev-db/sqlite-3 )
  26. xml? ( >=dev-libs/libxml2-2.6 )"
  27. DEPEND="${COMMON_DEPEND}
  28. >=app-text/asciidoc-8.6.3
  29. app-text/htmltidy
  30. app-text/xmlto
  31. >=sys-devel/gcc-4.7
  32. doc? (
  33. app-doc/doxygen
  34. python? ( dev-python/sphinx[${PYTHON_USEDEP}] )
  35. ruby? ( dev-ruby/syntax[ruby_targets_ruby${RUBY_VER/./}] )
  36. )
  37. virtual/pkgconfig
  38. test? ( >=dev-cpp/gtest-1.6.0-r1 )"
  39. RDEPEND="${COMMON_DEPEND}
  40. sys-apps/sandbox"
  41. PDEPEND="app-eselect/eselect-package-manager"
  42. REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
  43. RESTRICT="!test? ( test )"
  44. pkg_pretend() {
  45. if [[ ${MERGE_TYPE} != buildonly ]]; then
  46. if id paludisbuild >/dev/null 2>/dev/null ; then
  47. if ! groups paludisbuild | grep --quiet '\<tty\>' ; then
  48. eerror "The 'paludisbuild' user is now expected to be a member of the"
  49. eerror "'tty' group. You should add the user to this group before"
  50. eerror "upgrading Paludis."
  51. die "Please add paludisbuild to tty group"
  52. fi
  53. fi
  54. fi
  55. }
  56. pkg_setup() {
  57. enewgroup "paludisbuild"
  58. enewuser "paludisbuild" -1 -1 "/var/tmp/paludis" "paludisbuild,tty"
  59. use python && python-single-r1_pkg_setup
  60. }
  61. src_prepare() {
  62. # Fix the script shebang on Ruby scripts.
  63. # https://bugs.gentoo.org/show_bug.cgi?id=439372#c2
  64. sed -i -e "1s/ruby/&${RUBY_VER/./}/" ruby/demos/*.rb || die
  65. epatch_user
  66. }
  67. src_configure() {
  68. local myconf=(
  69. --htmldir=/usr/share/doc/${PF}/html
  70. $(use_enable doc doxygen)
  71. $(use_enable test gtest)
  72. $(use_enable pbins)
  73. $(use_enable pink)
  74. $(use_enable python)
  75. $(use python && use_enable doc python-doc)
  76. $(use_enable ruby)
  77. $(use ruby && use_enable doc ruby-doc)
  78. --with-ruby-version="${RUBY_VER}"
  79. $(use_enable search-index)
  80. $(use_enable xml)
  81. --enable-vim
  82. --with-config-framework=eselect
  83. --with-environments=default,portage
  84. --with-vim-install-dir=/usr/share/vim/vimfiles
  85. )
  86. econf "${myconf[@]}"
  87. }
  88. src_install() {
  89. default
  90. prune_libtool_files
  91. dobashcomp bash-completion/cave
  92. insinto /usr/share/zsh/site-functions
  93. doins zsh-completion/_cave
  94. }
  95. src_test() {
  96. # Work around Portage bugs
  97. local -x PALUDIS_DO_NOTHING_SANDBOXY="portage sucks"
  98. local -x BASH_ENV=/dev/null
  99. if [[ ${EUID} == 0 ]] ; then
  100. # hate
  101. local -x PALUDIS_REDUCED_UID=0
  102. local -x PALUDIS_REDUCED_GID=0
  103. fi
  104. if ! nonfatal emake -k check ; then
  105. eerror "Tests failed. Looking for files for you to add to your bug report..."
  106. find "${S}" -type f -name '*.epicfail' -or -name '*.log' | while read a ; do
  107. eerror " $a"
  108. done
  109. die "Make check failed"
  110. fi
  111. }
  112. pkg_postinst() {
  113. local pm
  114. if [[ -f ${ROOT}/etc/env.d/50package-manager ]] ; then
  115. pm=$( source "${ROOT}"/etc/env.d/50package-manager ; echo "${PACKAGE_MANAGER}" )
  116. fi
  117. if [[ ${pm} != paludis ]] ; then
  118. elog "If you are using paludis or cave as your primary package manager,"
  119. elog "you should consider running:"
  120. elog " eselect package-manager set paludis"
  121. fi
  122. }