initial import
This commit is contained in:
89
openntpd/PKGBUILD
Normal file
89
openntpd/PKGBUILD
Normal file
@@ -0,0 +1,89 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
pkgname=openntpd
|
||||
pkgver=6.2p3
|
||||
_debver=$pkgver
|
||||
_debrel=4.2
|
||||
pkgrel=5
|
||||
pkgdesc="Free and libre, easy to use implementation of the Network Time Protocol"
|
||||
url='http://www.openntpd.org/'
|
||||
arch=('i686' 'x86_64')
|
||||
license=('ISC')
|
||||
depends=('libressl')
|
||||
makedepends=('quilt')
|
||||
conflicts=('ntp')
|
||||
backup=('etc/ntpd.conf'
|
||||
'etc/conf.d/ntpd')
|
||||
install=${pkgname}.install
|
||||
source=(https://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/${pkgname}-${pkgver}.tar.gz{,.asc}
|
||||
https://deb.debian.org/debian/pool/main/o/openntpd/openntpd_$_debver-$_debrel.debian.tar.xz
|
||||
ntpd.confd
|
||||
ntpd.initd
|
||||
ntpd.conf
|
||||
ntpd.run
|
||||
ntpd.conf.libre
|
||||
ntp-user.patch)
|
||||
sha512sums=('56a04bfd8b161b365607673ac80086ff53ae943938fa49bf52edbc541432eca30730a46a4af581fe26ce3bbceb144cb25982a38959b7a3f9304c727fe60f9f50'
|
||||
'SKIP'
|
||||
'a973a440c9b8273c472e3c88775b22eb5cb4e2ecf4ccfd1a23b44a6d853ffcd903e6eb636125acee4a43ab24c9b3d65d8d596df66833718f97422eff9c61b97c'
|
||||
'016094e0ac80817c8c1eb8a52a527c8a673b3ee904f2c04bef0304b5dfe1c778a34a2d5321cc5540a1dfe2e14dc878c44a1e54fd0263aca3917600827c6d9059'
|
||||
'b13a2ac8f89b14ca3db03809ebb8b90662e1473dc26f4dca05047238030983e94409d18c6743c74c85e1d839b8270a4af176f5d2436fb22c6355994d8dee5a6c'
|
||||
'ba479ae90dd8853ae7a2d18728322524c3af1cc0d2728c21e63c866e330d00dbee34c06ee6348c8422bd10f886bd20781d147e640807fa23aad9ed8d4b6b3bb3'
|
||||
'8fdd6707ba72c289de129e406cbeecc05959786bd0e83e7489006189be16a9258a74395aaf62c0c748d4cf5ada95f99c9210615ef5d10ef1fdf4534a6f7e3d71'
|
||||
'257d5047ac2d831225359fc7b05c9cf8d9efc58eb0273bf74ad5d5c1bec409abe5999db48305c3bac516cc03e0180afcd4b555bf9388231c0de8f86e68ec9070'
|
||||
'cade7fcc50a77a4e28e8442f6426e959722a2b4fd2a5411d2baa9efe8956f902e789376544c3185368f845dfc69719808cb948193a6584c95ce0be31c21779fe')
|
||||
validpgpkeys=('A1EB079B8D3EB92B4EBD3139663AF51BD5E4D8D5') # Brent Cook <bcook@openbsd.org>
|
||||
|
||||
prepare() {
|
||||
cd ${pkgname}-${pkgver}
|
||||
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
|
||||
# Debian patches
|
||||
export QUILT_PATCHES=debian/patches
|
||||
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
|
||||
export QUILT_DIFF_ARGS='--no-timestamps'
|
||||
|
||||
mv "$srcdir"/debian .
|
||||
|
||||
# Doesn't apply
|
||||
rm -v debian/patches/01-use-debian-ntp-pool.patch || true
|
||||
rm -v debian/patches/03-kfreebsd.patch || true
|
||||
rm -v debian/patches/04-ntpd-manpage.patch || true
|
||||
rm -v debian/patches/fix_gcc-10.patch || true
|
||||
|
||||
quilt push -av
|
||||
fi
|
||||
patch -Np1 -i $srcdir/ntp-user.patch
|
||||
autoreconf -vif
|
||||
}
|
||||
|
||||
build() {
|
||||
cd ${pkgname}-${pkgver}
|
||||
autoreconf -fi
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--with-privsep-user=ntp \
|
||||
--localstatedir=/var \
|
||||
--with-adjtimex
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd ${pkgname}-${pkgver}
|
||||
make DESTDIR="${pkgdir}" install
|
||||
|
||||
install -d "$pkgdir"/var/empty
|
||||
|
||||
rm "${pkgdir}/etc/ntpd.conf"
|
||||
install -Dm 644 "${srcdir}/ntpd.conf.libre" "${pkgdir}/etc/ntpd.conf"
|
||||
|
||||
rmdir "${pkgdir}/var/run"
|
||||
install -d "${pkgdir}/var/lib/ntp"
|
||||
install -Dm 644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
|
||||
|
||||
install -Dm 644 "${srcdir}/ntpd.confd" "${pkgdir}/etc/conf.d/ntpd"
|
||||
install -Dm 755 "${srcdir}/ntpd.initd" "${pkgdir}/etc/init.d/ntpd"
|
||||
|
||||
install -D -m 755 "$srcdir/ntpd.run" "$pkgdir/etc/sv/ntpd/run"
|
||||
install -D -m 644 "$srcdir/ntpd.conf" "$pkgdir/etc/sv/ntpd/conf"
|
||||
}
|
||||
13
openntpd/ntp-user.patch
Normal file
13
openntpd/ntp-user.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/src/ntpd.h b/src/ntpd.h
|
||||
index 39b8e7bf..8c271e82 100644
|
||||
--- a/src/ntpd.h
|
||||
+++ b/src/ntpd.h
|
||||
@@ -36,7 +36,7 @@
|
||||
#define MAXIMUM(a, b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
#ifndef NTPD_USER
|
||||
-#define NTPD_USER "_ntp"
|
||||
+#define NTPD_USER "ntp"
|
||||
#endif
|
||||
|
||||
#ifndef SYSCONFDIR
|
||||
5
openntpd/ntpd.conf
Normal file
5
openntpd/ntpd.conf
Normal file
@@ -0,0 +1,5 @@
|
||||
# See ntpd(8) man page ... some popular options:
|
||||
# -s Set the time immediately at startup
|
||||
# (Note: may cause up to a 15 second startup delay
|
||||
# if ntp servers not reachable)
|
||||
NTPD_OPTS="-d -s"
|
||||
6
openntpd/ntpd.conf.libre
Normal file
6
openntpd/ntpd.conf.libre
Normal file
@@ -0,0 +1,6 @@
|
||||
# $OpenBSD: ntpd.conf,v 1.14 2015/07/15 20:28:37 ajacoutot Exp $
|
||||
#
|
||||
# See ntpd.conf(5) and /etc/examples/ntpd.conf
|
||||
|
||||
servers pool.ntp.org
|
||||
sensor *
|
||||
7
openntpd/ntpd.confd
Normal file
7
openntpd/ntpd.confd
Normal file
@@ -0,0 +1,7 @@
|
||||
# /etc/conf.d/ntpd: config file for openntpd's ntpd
|
||||
|
||||
# See ntpd(8) man page ... some popular options:
|
||||
# -s Set the time immediately at startup
|
||||
# (Note: may cause up to a 15 second startup delay
|
||||
# if ntp servers not reachable)
|
||||
NTPD_OPTS=""
|
||||
18
openntpd/ntpd.initd
Normal file
18
openntpd/ntpd.initd
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
name="OpenNTPD"
|
||||
command="/usr/sbin/ntpd"
|
||||
pidfile="/run/ntpd.pid"
|
||||
command_args="-p ${pidfile} ${NTPD_OPTS}"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
after ntp-client
|
||||
use dns logger
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath --directory --owner root:ntp --mode 0755 /var/lib/ntp
|
||||
}
|
||||
3
openntpd/ntpd.run
Normal file
3
openntpd/ntpd.run
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
[ -r conf ] && . ./conf
|
||||
exec ntpd ${NTPD_OPTS} 2>&1
|
||||
15
openntpd/openntpd.install
Normal file
15
openntpd/openntpd.install
Normal file
@@ -0,0 +1,15 @@
|
||||
post_install() {
|
||||
getent group ntp &>/dev/null || groupadd -g 87 ntp >/dev/null
|
||||
getent passwd ntp &>/dev/null || useradd -u 87 -g ntp -d /var/lib/ntp \
|
||||
-c 'Network Time Protocol' -s /bin/nologin ntp >/dev/null
|
||||
ntp_shell=$(getent passwd ntp | cut -d: -f7)
|
||||
if [ "$ntp_shell" != '/bin/nologin' ]; then
|
||||
chsh -s /bin/nologin ntp &>/dev/null
|
||||
fi
|
||||
# fix /var/db/ntpd.drift is empty
|
||||
echo "0.0" > /var/db/ntpd.drift
|
||||
}
|
||||
|
||||
post_upgrade(){
|
||||
post_install
|
||||
}
|
||||
Reference in New Issue
Block a user