pdns-recursor-4.0.4.ebuild 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="6"
  4. inherit toolchain-funcs flag-o-matic eutils versionator
  5. DESCRIPTION="The PowerDNS Recursor"
  6. HOMEPAGE="https://www.powerdns.com/"
  7. SRC_URI="https://downloads.powerdns.com/releases/${P/_/-}.tar.bz2"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="amd64 ~arm x86"
  11. IUSE="lua luajit protobuf systemd"
  12. REQUIRED_USE="?? ( lua luajit )"
  13. DEPEND="lua? ( >=dev-lang/lua-5.1:= )
  14. luajit? ( dev-lang/luajit:= )
  15. protobuf? (
  16. dev-libs/protobuf
  17. >=dev-libs/boost-1.42
  18. )
  19. systemd? ( sys-apps/systemd:0= )
  20. >=dev-libs/boost-1.35"
  21. RDEPEND="${DEPEND}
  22. !<net-dns/pdns-2.9.20-r1"
  23. DEPEND="${DEPEND}
  24. virtual/pkgconfig"
  25. S="${WORKDIR}"/${P/_/-}
  26. pkg_setup() {
  27. filter-flags -ftree-vectorize
  28. }
  29. src_configure() {
  30. econf \
  31. --sysconfdir=/etc/powerdns \
  32. $(use_enable systemd) \
  33. $(use_with lua) \
  34. $(use_with luajit) \
  35. $(use_with protobuf)
  36. }
  37. src_install() {
  38. default
  39. mv "${D}"/etc/powerdns/recursor.conf{-dist,}
  40. # set defaults: setuid=nobody, setgid=nobody
  41. sed -i \
  42. -e 's/^# set\([ug]\)id=$/set\1id=nobody/' \
  43. -e 's/^# quiet=$/quiet=on/' \
  44. -e 's/^# chroot=$/chroot=\/var\/lib\/powerdns/' \
  45. "${D}"/etc/powerdns/recursor.conf
  46. doinitd "${FILESDIR}"/pdns-recursor
  47. keepdir /var/lib/powerdns
  48. }
  49. pkg_postinst() {
  50. local old
  51. for old in ${REPLACING_VERSIONS}; do
  52. version_compare ${old} 4.0.0-r1
  53. [[ $? -eq 1 ]] || continue
  54. ewarn "Starting with 4.0.0-r1 the init script has been renamed from precursor"
  55. ewarn "to pdns-recursor, please update your runlevels accordingly."
  56. break
  57. done
  58. }