You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

200 lines
3.5 KiB

  1. # Copyright 1999-2021 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="7"
  4. USE_RUBY="ruby25 ruby26 ruby27 ruby30"
  5. RUBY_OPTIONAL="yes"
  6. inherit autotools java-pkg-opt-2 perl-functions ruby-ng
  7. DESCRIPTION="a full-text search system for communities"
  8. HOMEPAGE="https://fallabs.com/hyperestraier/"
  9. SRC_URI="https://fallabs.com/${PN}/${P}.tar.gz"
  10. LICENSE="LGPL-2.1"
  11. KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ppc ppc64 sparc x86"
  12. SLOT="0"
  13. IUSE="bzip2 debug java lzo mecab perl ruby static-libs +zlib"
  14. RDEPEND="dev-db/qdbm
  15. bzip2? ( app-arch/bzip2 )
  16. java? ( >=virtual/jre-1.4:* )
  17. lzo? ( dev-libs/lzo )
  18. mecab? ( app-text/mecab )
  19. perl? ( dev-lang/perl )
  20. ruby? ( $(ruby_implementations_depend) )
  21. zlib? ( sys-libs/zlib )"
  22. DEPEND="${RDEPEND}
  23. java? ( >=virtual/jdk-1.4:* )"
  24. BDEPEND="virtual/pkgconfig"
  25. S="${WORKDIR}/all/${P}"
  26. PATCHES=(
  27. "${FILESDIR}"/${PN}-configure.patch
  28. "${FILESDIR}"/${PN}-perl.patch
  29. "${FILESDIR}"/${PN}-ruby19.patch
  30. )
  31. HTML_DOCS=( doc/. )
  32. AT_NOELIBTOOLIZE="yes"
  33. pkg_setup() {
  34. java-pkg-opt-2_pkg_setup
  35. use ruby && ruby-ng_pkg_setup
  36. }
  37. he_foreach_api() {
  38. local u d
  39. for u in java perl ruby; do
  40. if ! use "${u}"; then
  41. continue
  42. fi
  43. if [[ "${u}" != "ruby" ]]; then
  44. for d in ${u}native ${u}pure; do
  45. if [[ ! -d "${d}" ]]; then
  46. continue
  47. fi
  48. einfo "${EBUILD_PHASE} ${d}"
  49. cd "${d}"
  50. case "${EBUILD_PHASE}" in
  51. prepare)
  52. mv configure.{in,ac}
  53. eautoreconf
  54. ;;
  55. configure)
  56. econf
  57. ;;
  58. compile)
  59. emake
  60. ;;
  61. test)
  62. if [[ "${d}" == "${u}native" ]]; then
  63. emake check
  64. fi
  65. ;;
  66. install)
  67. if [[ "${u}" != "java" ]]; then
  68. emake DESTDIR="${D}" install
  69. else
  70. java-pkg_dojar *.jar
  71. if [[ "${d}" == "${u}native" ]]; then
  72. dolib.so lib*.so*
  73. fi
  74. fi
  75. ;;
  76. esac
  77. cd - >/dev/null
  78. done
  79. else
  80. PATCHES= ruby-ng_src_${EBUILD_PHASE}
  81. fi
  82. done
  83. }
  84. he_foreach_ruby_api() {
  85. local d
  86. for d in rubynative rubypure; do
  87. cd "${d}"
  88. case "${EBUILD_PHASE}" in
  89. prepare)
  90. sed -i \
  91. -e "/RUBY=/cRUBY=\"${RUBY}\"" \
  92. -e "/=\`.*ruby/s|ruby|${RUBY}|" \
  93. configure.in
  94. mv configure.{in,ac}
  95. eautoreconf
  96. ;;
  97. configure)
  98. econf
  99. ;;
  100. compile)
  101. emake
  102. ;;
  103. test)
  104. if [[ "${d}" == "${u}native" ]]; then
  105. emake check
  106. fi
  107. ;;
  108. install)
  109. emake DESTDIR="${D}" install
  110. ;;
  111. esac
  112. cd - >/dev/null
  113. done
  114. }
  115. src_prepare() {
  116. default
  117. java-pkg-opt-2_src_prepare
  118. sed -i \
  119. -e "/^CFLAGS/s|$| ${CFLAGS}|" \
  120. -e "/^JAVACFLAGS/s|$| ${JAVACFLAGS}|" \
  121. -e '/^LDENV/d' \
  122. -e 's/make\( \|$\)/$(MAKE)\1/g' \
  123. Makefile.in {java,perl,ruby}*/Makefile.in
  124. mv configure.{in,ac}
  125. eautoreconf
  126. he_foreach_api # prepare
  127. }
  128. all_ruby_prepare() {
  129. sed -i "/^RUNENV /s|\.\.|${WORKDIR}/all/${P}|" ruby*/Makefile.in
  130. sed -i "s|\.\./\.\.|${WORKDIR}/all/${P}|" rubynative/src/extconf.rb
  131. }
  132. each_ruby_prepare() {
  133. he_foreach_ruby_api
  134. }
  135. src_configure() {
  136. econf \
  137. $(use_enable bzip2 bzip) \
  138. $(use_enable debug) \
  139. $(use_enable lzo) \
  140. $(use_enable mecab) \
  141. $(use_enable zlib)
  142. he_foreach_api
  143. }
  144. each_ruby_configure() {
  145. he_foreach_ruby_api
  146. }
  147. src_compile() {
  148. default
  149. he_foreach_api
  150. }
  151. each_ruby_compile() {
  152. he_foreach_ruby_api
  153. }
  154. src_test() {
  155. default
  156. he_foreach_api
  157. }
  158. each_ruby_test() {
  159. he_foreach_ruby_api
  160. }
  161. src_install() {
  162. emake DESTDIR="${D}" MYDOCS= install
  163. einstalldocs
  164. he_foreach_api
  165. use static-libs || find "${ED}" -name '*.a' -delete || die
  166. if use perl; then
  167. perl_delete_module_manpages
  168. perl_fix_packlist
  169. fi
  170. rm -f "${D}"/usr/bin/*test
  171. }
  172. each_ruby_install() {
  173. he_foreach_ruby_api
  174. }