chrony-9999.ebuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit eutils git-r3 systemd toolchain-funcs
  5. DESCRIPTION="NTP client and server programs"
  6. HOMEPAGE="http://chrony.tuxfamily.org/"
  7. EGIT_REPO_URI="git://git.tuxfamily.org/gitroot/chrony/chrony.git"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS=""
  11. IUSE="caps +cmdmon ipv6 libedit +ntp +phc pps readline +refclock +rtc selinux +adns"
  12. REQUIRED_USE="
  13. ?? ( libedit readline )
  14. "
  15. CDEPEND="
  16. caps? ( sys-libs/libcap )
  17. libedit? ( dev-libs/libedit )
  18. readline? ( >=sys-libs/readline-4.1-r4:= )
  19. "
  20. DEPEND="
  21. ${CDEPEND}
  22. dev-ruby/asciidoctor
  23. pps? ( net-misc/pps-tools )
  24. "
  25. RDEPEND="
  26. ${CDEPEND}
  27. selinux? ( sec-policy/selinux-chronyd )
  28. "
  29. RESTRICT=test
  30. S="${WORKDIR}/${P/_/-}"
  31. src_prepare() {
  32. sed -i \
  33. -e 's:/etc/chrony\.:/etc/chrony/chrony.:g' \
  34. -e 's:/var/run:/run:g' \
  35. conf.c doc/*.adoc examples/* || die
  36. default
  37. }
  38. src_configure() {
  39. tc-export CC
  40. local CHRONY_EDITLINE
  41. # ./configure legend:
  42. # --disable-readline : disable line editing entirely
  43. # --without-readline : do not use sys-libs/readline (enabled by default)
  44. # --without-editline : do not use dev-libs/libedit (enabled by default)
  45. if ! use readline && ! use libedit; then
  46. CHRONY_EDITLINE='--disable-readline'
  47. else
  48. CHRONY_EDITLINE+=" $(usex readline '' --without-readline)"
  49. CHRONY_EDITLINE+=" $(usex libedit '' --without-editline)"
  50. fi
  51. # not an autotools generated script
  52. local CHRONY_CONFIGURE="
  53. ./configure \
  54. $(usex caps '' --disable-linuxcaps) \
  55. $(usex cmdmon '' --disable-cmdmon) \
  56. $(usex ipv6 '' --disable-ipv6) \
  57. $(usex ntp '' --disable-ntp) \
  58. $(usex phc '' --disable-phc) \
  59. $(usex pps '' --disable-pps) \
  60. $(usex rtc '' --disable-rtc) \
  61. $(usex refclock '' --disable-refclock) \
  62. $(usex adns '' --disable-asyncdns) \
  63. ${CHRONY_EDITLINE} \
  64. ${EXTRA_ECONF} \
  65. --docdir=/usr/share/doc/${PF} \
  66. --chronysockdir=/run/chrony \
  67. --mandir=/usr/share/man \
  68. --prefix=/usr \
  69. --sysconfdir=/etc/chrony \
  70. --disable-sechash \
  71. --without-nss \
  72. --without-tomcrypt
  73. "
  74. # print the ./configure call to aid in future debugging
  75. einfo ${CHRONY_CONFIGURE}
  76. bash ${CHRONY_CONFIGURE} || die
  77. }
  78. src_compile() {
  79. emake all docs
  80. }
  81. src_install() {
  82. default
  83. newinitd "${FILESDIR}"/chronyd.init-r1 chronyd
  84. newconfd "${FILESDIR}"/chronyd.conf chronyd
  85. insinto /etc/${PN}
  86. newins examples/chrony.conf.example1 chrony.conf
  87. docinto examples
  88. dodoc examples/*.example*
  89. docinto html
  90. dodoc doc/*.html
  91. keepdir /var/{lib,log}/chrony
  92. insinto /etc/logrotate.d
  93. newins "${FILESDIR}"/chrony-2.4-r1.logrotate chrony
  94. systemd_newunit "${FILESDIR}"/chronyd.service-r2 chronyd.service
  95. systemd_enable_ntpunit 50-chrony chronyd.service
  96. }