summaryrefslogtreecommitdiff
path: root/user/sntpd
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2019-08-05 23:44:14 +0000
committerSamuel Holland <samuel@sholland.org>2019-10-03 23:28:06 -0500
commit878c4ffc7e6837e63d308f18348a52584f323f4c (patch)
tree9589d7041c2f06fa143ff248e08c8b4a1249db15 /user/sntpd
parent92393a6f0b3dae968cde38a6b686e2304c4f8d10 (diff)
downloadpackages-878c4ffc7e6837e63d308f18348a52584f323f4c.tar.gz
packages-878c4ffc7e6837e63d308f18348a52584f323f4c.tar.bz2
packages-878c4ffc7e6837e63d308f18348a52584f323f4c.tar.xz
packages-878c4ffc7e6837e63d308f18348a52584f323f4c.zip
user/sntpd: New package
Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'user/sntpd')
-rw-r--r--user/sntpd/APKBUILD47
-rw-r--r--user/sntpd/select.patch12
2 files changed, 59 insertions, 0 deletions
diff --git a/user/sntpd/APKBUILD b/user/sntpd/APKBUILD
new file mode 100644
index 000000000..d15fbff92
--- /dev/null
+++ b/user/sntpd/APKBUILD
@@ -0,0 +1,47 @@
+# Maintainer: Samuel Holland <samuel@sholland.org>
+pkgname=sntpd
+pkgver=3.0_git20190119
+_commit=7e372536855687f0af3c7ddde5fcb965b93d5d1e
+pkgrel=0
+pkgdesc="A small SNTP client for UNIX systems, implementing RFC 1305 and RFC 4330"
+url="https://github.com/troglobit/sntpd"
+arch="all"
+license="GPL-2.0-only"
+depends=""
+makedepends="autoconf automake"
+subpackages="$pkgname-doc"
+source="$pkgname-$pkgver.tar.gz::https://github.com/troglobit/sntpd/archive/$_commit.tar.gz
+ select.patch
+ "
+builddir="$srcdir/$pkgname-$_commit"
+
+prepare() {
+ default_prepare
+ autoreconf -vif
+}
+
+build() {
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var \
+ --disable-debug \
+ --enable-replay \
+ --without-systemd
+ make
+}
+
+check() {
+ make check
+}
+
+package() {
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="49a9d16c2aef82c3d009f3e5678763d440764c67e4d7b27b07deac71ae9cb6d3b64a0991d3a79904b397441d9ce480287bb022d5e466fc99bbc393dc9d79b2a5 sntpd-3.0_git20190119.tar.gz
+09ddc920bdbb00480859a8e9cd7b06bcfe73a6d51d070dde6bf78038bae11092fff9c72a401e1a3d7e3e6f6dcd1bdb6cec3b025ccc07608a8feb0ddaa854c678 select.patch"
diff --git a/user/sntpd/select.patch b/user/sntpd/select.patch
new file mode 100644
index 000000000..00121d80b
--- /dev/null
+++ b/user/sntpd/select.patch
@@ -0,0 +1,12 @@
+select(3) does not modify its timeout in musl, as permitted by POSIX
+--- sntpd-7e372536855687f0af3c7ddde5fcb965b93d5d1e/src/sntpd.c
++++ sntpd-7e372536855687f0af3c7ddde5fcb965b93d5d1e/src/sntpd.c
+@@ -686,7 +686,7 @@ static void primary_loop(int usd, struct ntp_control *ntpc)
+ ERR(errno, "Failed select()");
+ continue;
+ }
+- if (to.tv_sec == 0) {
++ if (1) {
+ if (probes_sent >= ntpc->probe_count && ntpc->probe_count != 0)
+ break;
+