dictd-1.12.1-r2.ebuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils readme.gentoo systemd user
  5. DESCRIPTION="Dictionary Client/Server for the DICT protocol"
  6. HOMEPAGE="http://www.dict.org/ https://sourceforge.net/projects/dict/"
  7. SRC_URI="mirror://sourceforge/dict/${P}.tar.gz"
  8. SLOT="0"
  9. # We install rfc so - ISOC-rfc
  10. LICENSE="GPL-2 ISOC-rfc"
  11. KEYWORDS="alpha amd64 ~arm ~hppa ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris"
  12. IUSE="dbi judy minimal"
  13. # <gawk-3.1.6 makes tests fail.
  14. RDEPEND="
  15. sys-libs/zlib
  16. dev-libs/libmaa
  17. dbi? ( dev-db/libdbi )
  18. judy? ( dev-libs/judy )
  19. >=sys-apps/coreutils-6.10
  20. "
  21. DEPEND="${RDEPEND}
  22. >=sys-apps/gawk-3.1.6
  23. virtual/yacc
  24. "
  25. DOC_CONTENTS="
  26. To start and use ${PN} you need to emerge at least one dictionary from
  27. the app-dicts category with the package name starting with 'dictd-'.
  28. To install all available dictionaries, emerge app-dicts/dictd-dicts.
  29. ${PN} will NOT start without at least one dictionary.\n
  30. \nIf you are running systemd, you will need to review the instructions
  31. explained in /etc/dict/dictd.conf comments.
  32. "
  33. pkg_setup() {
  34. enewgroup dictd # used in src_test()
  35. enewuser dictd -1 -1 -1 dictd
  36. }
  37. src_prepare() {
  38. epatch "${FILESDIR}"/dictd-1.10.11-colorit-nopp-fix.patch
  39. epatch "${FILESDIR}"/dictd-1.12.0-build.patch
  40. [[ ${CHOST} == *-darwin* ]] && \
  41. sed -i -e 's:libtool:glibtool:g' Makefile.in
  42. }
  43. src_configure() {
  44. econf \
  45. $(use_with dbi plugin-dbi) \
  46. $(use_with judy plugin-judy) \
  47. --sysconfdir="${EPREFIX}"/etc/dict
  48. }
  49. src_compile() {
  50. if use minimal; then
  51. emake dictfmt dictzip dictzip
  52. else
  53. emake
  54. fi
  55. }
  56. src_test() {
  57. use minimal && return 0 # All tests are for dictd which we don't build...
  58. if [[ ${EUID} -eq 0 ]]; then
  59. # If dictd is run as root user (-userpriv) it drops its privileges to
  60. # dictd user and group. Give dictd group write access to test directory.
  61. chown :dictd "${WORKDIR}" "${S}/test"
  62. chmod 770 "${WORKDIR}" "${S}/test"
  63. fi
  64. emake test
  65. }
  66. src_install() {
  67. if use minimal; then
  68. emake DESTDIR="${D}" install.dictzip install.dict install.dictfmt
  69. else
  70. emake DESTDIR="${D}" install
  71. dodoc doc/{dicf.ms,rfc.ms,rfc.sh,rfc2229.txt}
  72. dodoc doc/{security.doc,toc.ms}
  73. newdoc examples/dictd1.conf dictd.conf.example
  74. # conf files. For dict.conf see below.
  75. insinto /etc/dict
  76. for f in dictd.conf site.info colorit.conf; do
  77. doins "${FILESDIR}/1.10.11/${f}"
  78. done
  79. # startups for dictd
  80. newinitd "${FILESDIR}/1.10.11/dictd.initd" dictd
  81. newconfd "${FILESDIR}/1.10.11/dictd.confd" dictd
  82. systemd_dounit "${FILESDIR}"/${PN}.service
  83. fi
  84. insinto /etc/dict
  85. doins "${FILESDIR}/1.10.11/dict.conf"
  86. # Install docs
  87. dodoc README TODO ChangeLog ANNOUNCE NEWS
  88. readme.gentoo_create_doc
  89. }