nsd-4.1.15.ebuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit user systemd
  5. DESCRIPTION="An authoritative only, high performance, open source name server"
  6. HOMEPAGE="http://www.nlnetlabs.nl/projects/nsd"
  7. # version voodoo needed only for non-release tarballs: 4.0.0_rc1 => 4.0.0rc1
  8. MY_PV=${PV/_rc/rc}
  9. MY_PV=${MY_PV/_beta/b}
  10. MY_P=${PN}-${MY_PV}
  11. S="${WORKDIR}/${MY_P}"
  12. SRC_URI="http://www.nlnetlabs.nl/downloads/${PN}/${MY_P}.tar.gz"
  13. LICENSE="BSD"
  14. SLOT="0"
  15. KEYWORDS="~amd64 ~x86"
  16. IUSE="bind8-stats ipv6 libevent minimal-responses mmap munin +nsec3 ratelimit root-server runtime-checks ssl libressl"
  17. RDEPEND="
  18. virtual/yacc
  19. libevent? ( dev-libs/libevent )
  20. ssl? (
  21. !libressl? ( dev-libs/openssl:0= )
  22. libressl? ( dev-libs/libressl:= )
  23. )
  24. munin? ( net-analyzer/munin )
  25. "
  26. DEPEND="
  27. ${RDEPEND}
  28. sys-devel/flex
  29. "
  30. src_prepare() {
  31. # Fix the paths in the munin plugin to match our install
  32. eapply "${FILESDIR}"/nsd_munin_.patch
  33. eapply_user
  34. }
  35. src_configure() {
  36. local myeconfargs=(
  37. --enable-pie
  38. --enable-relro-now
  39. --enable-largefile
  40. --with-logfile="${EPREFIX}"/var/log/nsd.log
  41. --with-pidfile="${EPREFIX}"/run/nsd/nsd.pid
  42. --with-dbfile="${EPREFIX}"/var/db/nsd/nsd.db
  43. --with-xfrdir="${EPREFIX}"/var/db/nsd
  44. --with-xfrdfile="${EPREFIX}"/var/db/nsd/xfrd.state
  45. --with-zonelistfile="${EPREFIX}"/var/db/nsd/zone.list
  46. --with-zonesdir="${EPREFIX}"/var/lib/nsd
  47. $(use_enable bind8-stats)
  48. $(use_enable bind8-stats zone-stats)
  49. $(use_enable ipv6)
  50. $(use_enable minimal-responses)
  51. $(use_enable mmap)
  52. $(use_enable nsec3)
  53. $(use_enable ratelimit)
  54. $(use_enable root-server)
  55. $(use_enable runtime-checks checking)
  56. $(use_with libevent)
  57. $(use_with ssl)
  58. )
  59. econf "${myeconfargs[@]}"
  60. }
  61. src_install() {
  62. emake DESTDIR="${D}" install
  63. dodoc doc/{ChangeLog,CREDITS,NSD-4-features,NSD-FOR-BIND-USERS,README,RELNOTES,REQUIREMENTS}
  64. newinitd "${FILESDIR}"/nsd.initd-r1 nsd
  65. # install munin plugin and config
  66. if use munin ; then
  67. exeinto /usr/libexec/munin/plugins
  68. doexe contrib/nsd_munin_
  69. insinto /etc/munin/plugin-conf.d
  70. newins "${FILESDIR}"/nsd.munin-conf nsd_munin
  71. fi
  72. systemd_dounit "${FILESDIR}"/nsd.service
  73. # remove the /run directory that usually resides on tmpfs and is
  74. # being taken care of by the nsd init script anyway (checkpath)
  75. rm -r "${ED}"/run || die "Failed to remove /run"
  76. }
  77. pkg_postinst() {
  78. # Do this in postinst to ensure the uid/gid is consistent for binpkgs
  79. enewgroup nsd
  80. enewuser nsd -1 -1 -1 nsd
  81. # database directory, writable by nsd for database updates and zone transfers
  82. install -d -m 750 -o nsd -g nsd "${EROOT%/}"/var/db/nsd
  83. # zones directory, writable by nsd for zone file updates (nsd-control write)
  84. install -d -m 750 -o nsd -g nsd "${EROOT%/}"/var/lib/nsd
  85. }