OpenNTPD daemon with OpenSSL implementation & flexible configurability
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
4.9 KiB

  1. # Maintainer: Pekka Helenius <fincer89[at]hotmail[dot]com>
  2. # Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org>
  3. # Contributor: Vesa Kaihlavirta <vegai@iki.fi>
  4. # Contributor: Mark Rosenstand <mark@borkware.net>
  5. # Contributor: Giorgio Lando <patroclo7@gmail.com> (adjtimex patch)
  6. # Contributor: Alexander Rødseth <rodseth@gmail.com>
  7. pkgname=openntpd-git
  8. _pkgname=openntpd
  9. pkgver=223.cc32929
  10. pkgrel=1
  11. pkgdesc='Free, easy to use implementation of the Network Time Protocol (Git version)'
  12. url='http://www.openntpd.org/'
  13. arch=('any')
  14. license=('BSD')
  15. provides=('openntpd')
  16. conflicts=('openntpd')
  17. replaces=('openntpd')
  18. makedepends=('bison' 'make' 'autoconf' 'openssl') # 'libressl'
  19. optdepends=(
  20. 'openssl: HTTPS constraint support'
  21. # 'libressl: HTTPS constraint support'
  22. )
  23. conflicts=('ntp')
  24. backup=('etc/ntpd.conf')
  25. source=(
  26. # For patch compatibility reasons. Feature freeze alike.
  27. ${_pkgname}::git+https://github.com/openntpd-portable/openntpd-portable.git#commit=cc3292981b83f7d691e96dc5e5a5d30af6f98454
  28. openntpd.sysusers
  29. openntpd.service
  30. )
  31. patches=(
  32. 1-patch_better-logs.patch
  33. 2-patch_ntpctl-sensors-tolowercase.patch
  34. 3-patch_unhardcode-ports.patch
  35. 4-patch_peercount-init.patch
  36. 5-patch_debugmode-fix.patch
  37. 6-patch_unhardcode-conf.patch
  38. 7-patch_implement-openssl.patch
  39. 8-patch_update-conf.patch
  40. 9-patch_add-constraint-useragent.patch
  41. 10-patch-peer-constraint-logs.patch
  42. 11-patch-fix-constraint-time-overflow-32bit.patch
  43. )
  44. source=(${source[@]} ${patches[@]})
  45. sha512sums=('SKIP'
  46. 'b6bb4f39eb435ce6c3314ea4a31430a1f8b70898d17d1fe07fa487bec0e79c022b004d3c11366f0f994546f454e5418caf5b3d7e6e1a205598d2bc8140417f7a'
  47. 'c58d48de67cd1ce0df7ea60def26db38b9d7409b64d097639a4cde3f4774a4bcc1159f993f37c5c61781cab1e2d1b8a35005030b28b0c9f0f6e0f81053586dfa'
  48. '3d94330459528f2209e3a203e632b774def35b2518674ef858ba0680a03aadfe1c647b474f7f27eb57056ac25f9c79727614b23a8961102622d4b0f4fbafae5d'
  49. '1a7737f1ea2741c58950e7b4da0267ce608163367d7d9092254290340791d2ba3a94c686f3c6d0b2288e16b619efbafb56cccea003a96f6df11b8d75e69c2ce7'
  50. 'ceb83ddf153834d2be8eda247751f5dab565009b3b484b21c5c1b0d0172930bf8a3a719d488faa638dee1c86691eacf4660faefdc1443df073bd3eef1d6255ab'
  51. '55306ef131d372a055563716cc005d97c7081ad92bcd46c807882fad535cc4434f30efcfedbeb0f59aeb021992c9c634e920109e18a59c556630bbac49c92e65'
  52. '4d44b53d1edfb207e72ca3bcd3206565742511f9ba85f5aede781d5e21ae297dba45a0ba64d7c379c619e2e3f1ee892f74e24f33551b2e718194d8ce6aca889d'
  53. '8866b2abec092148c604c7cf0e972a39c72ae26dd7376ea120423468430246d257656f9de50cebd7b73ea895719392d4a41acff53dd8538e87ad87423ee001a3'
  54. '4e2dd7367235ae9ba29a953b2a031cffa9a42e7edcd82ae63bc2a1215dc30bcfd2c8c53b15f548de27291a233325d086e5b84100e1a6c3fab029dbbda6051904'
  55. '4fc3834ed3ce60ab151c278c34e055f00bd7b981359bf17380b33a7b47d806b23d239a2200a883f0b8cb2fe6392dbb4d117df758ad9ebb5958af3fe91d5d61c2'
  56. 'cd7066b68b28fa52c90f9dd5030c78c2783c44e0c863470c1a5d2e25b27b46c3c79aff966c0a38f2dc15af2275f0e7ff5774e88e0b9025cb17b34eb5dd5160de'
  57. '3ae3501a41ee50519b19074bf9e532718e365e6b45a9af4a9fba81d4276df98244cd5aac7acc9f6cd7d7a2bf460b4714e79e2676f826859fe4ad43b67046c709'
  58. '4c2839f337a74afa5051391e038c7801c6560714072839713b870868609f7823beb1de2253a569b6d58872fd03bbb096f47a38472b1e6a13e965f5976270ac08')
  59. validpgpkeys=('A1EB079B8D3EB92B4EBD3139663AF51BD5E4D8D5') # Brent Cook <bcook@openbsd.org>
  60. pkgver() {
  61. cd ${_pkgname}
  62. if [[ $(git describe) ]]; then
  63. git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
  64. else
  65. echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
  66. fi
  67. }
  68. prepare() {
  69. cd ${_pkgname}
  70. # For patch compatibility reasons. Feature freeze alike.
  71. sed -r -i 's/openntpd-portable(\/openntpd-openbsd.git)/Fincer\1/' ./update.sh
  72. ./update.sh
  73. # Keep patch order!
  74. for p in ${patches[@]}; do
  75. patch -Np1 -i ../${p}
  76. done
  77. autoreconf -fiv
  78. }
  79. build() {
  80. cd ${_pkgname}
  81. CFLAGS+=' -fcommon -L/usr/lib/libressl/ -Wl,-rpath,/usr/lib/libressl/' ./configure \
  82. --prefix=/usr \
  83. --sysconfdir=/etc \
  84. --sbindir=/usr/bin \
  85. --with-privsep-user=ntp \
  86. --localstatedir=/var \
  87. --with-openssl=yes \
  88. --with-libressl=no
  89. make
  90. }
  91. package() {
  92. cd ${_pkgname}
  93. make DESTDIR="${pkgdir}" install
  94. rmdir "${pkgdir}/var/run"
  95. install -d "${pkgdir}/var/lib/ntp"
  96. install -Dm 644 COPYING -t "${pkgdir}/usr/share/licenses/${_pkgname}"
  97. install -Dm 644 "${srcdir}/openntpd.service" -t "${pkgdir}/usr/lib/systemd/system"
  98. install -Dm 644 "${srcdir}/openntpd.sysusers" "${pkgdir}/usr/lib/sysusers.d/openntpd.conf"
  99. install -Dm 644 "ntpd.conf" "${pkgdir}/etc/examples/ntpd.conf"
  100. install -d "${pkgdir}/usr/lib/systemd/ntp-units.d"
  101. echo ${_pkgname}.service > "${pkgdir}/usr/lib/systemd/ntp-units.d/${_pkgname}.list"
  102. }