chrony-2.3.ebuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils systemd toolchain-funcs
  5. DESCRIPTION="NTP client and server programs"
  6. HOMEPAGE="http://chrony.tuxfamily.org/"
  7. SRC_URI="http://download.tuxfamily.org/${PN}/${P/_/-}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~alpha amd64 ~arm hppa ~mips ppc ppc64 ~sparc x86"
  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. sys-apps/texinfo
  23. "
  24. RDEPEND="
  25. ${CDEPEND}
  26. selinux? ( sec-policy/selinux-chronyd )
  27. "
  28. RESTRICT=test
  29. S="${WORKDIR}/${P/_/-}"
  30. src_prepare() {
  31. sed -i \
  32. -e 's:/etc/chrony\.:/etc/chrony/chrony.:g' \
  33. -e 's:/var/run:/run:g' \
  34. conf.c chrony.texi.in examples/* || die
  35. }
  36. src_configure() {
  37. tc-export CC
  38. local CHRONY_EDITLINE
  39. # ./configure legend:
  40. # --disable-readline : disable line editing entirely
  41. # --without-readline : do not use sys-libs/readline (enabled by default)
  42. # --without-editline : do not use dev-libs/libedit (enabled by default)
  43. if ! use readline && ! use libedit; then
  44. CHRONY_EDITLINE='--disable-readline'
  45. else
  46. CHRONY_EDITLINE+=" $(usex readline '' --without-readline)"
  47. CHRONY_EDITLINE+=" $(usex libedit '' --without-editline)"
  48. fi
  49. # not an autotools generated script
  50. local CHRONY_CONFIGURE="
  51. ./configure \
  52. $(usex caps '' --disable-linuxcaps) \
  53. $(usex cmdmon '' --disable-cmdmon) \
  54. $(usex ipv6 '' --disable-ipv6) \
  55. $(usex ntp '' --disable-ntp) \
  56. $(usex phc '' --disable-phc) \
  57. $(usex pps '' --disable-pps) \
  58. $(usex rtc '' --disable-rtc) \
  59. $(usex refclock '' --disable-refclock) \
  60. $(usex adns '' --disable-asyncdns) \
  61. ${CHRONY_EDITLINE} \
  62. ${EXTRA_ECONF} \
  63. --docdir=/usr/share/doc/${PF} \
  64. --chronysockdir=/run/chrony \
  65. --infodir=/usr/share/info \
  66. --mandir=/usr/share/man \
  67. --prefix=/usr \
  68. --sysconfdir=/etc/chrony \
  69. --disable-sechash \
  70. --without-nss \
  71. --without-tomcrypt
  72. "
  73. # print the ./configure call to aid in future debugging
  74. einfo ${CHRONY_CONFIGURE}
  75. bash ${CHRONY_CONFIGURE} || die
  76. }
  77. src_compile() {
  78. emake all docs
  79. }
  80. src_install() {
  81. default
  82. doinfo chrony.info*
  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. dodoc examples/*.example*
  88. keepdir /var/{lib,log}/chrony
  89. insinto /etc/logrotate.d
  90. newins "${FILESDIR}"/chrony-2.2.logrotate chrony
  91. systemd_newunit "${FILESDIR}"/chronyd.service-r2 chronyd.service
  92. systemd_enable_ntpunit 50-chrony chronyd.service
  93. }