summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjc_gargma <jc_gargma@iserlohn-fortress.net>2020-08-30 10:21:54 -0700
committerjc_gargma <jc_gargma@iserlohn-fortress.net>2020-08-30 10:21:54 -0700
commitc1a9dd9eeb80bd7009ef85216a6bb958cef0d287 (patch)
treeaa2582a8f4b5d2f1ae98d0ed369b5c6a7b126af7
parentRebuild with -fPIE (diff)
downloadchrony-c1a9dd9eeb80bd7009ef85216a6bb958cef0d287.tar.xz
Updated to 3.5.1
-rw-r--r--PKGBUILD47
-rw-r--r--fix-util-unit-test-for-NTP-era-split.patch38
2 files changed, 68 insertions, 17 deletions
diff --git a/PKGBUILD b/PKGBUILD
index ac39cd5..34440a6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,33 +13,36 @@
# Arch version uses /etc/chrony.conf instead of /etc/chrony/chrony.conf
pkgname=chrony
-pkgver=3.5
-pkgrel=2.4
+pkgver=3.5.1
+pkgrel=1
pkgdesc='Lightweight NTP client and server'
url='https://chrony.tuxfamily.org/'
arch=('x86_64')
license=('GPL2')
-depends=('glibc' 'nss' 'readline' 'libcap' 'libedit' 'libseccomp' 'nettle')
+depends=('glibc' 'nss' 'readline' 'libcap' 'libcap.so' 'libedit' 'libseccomp' 'libseccomp.so' 'nettle')
makedepends=('asciidoctor')
options=('!emptydirs')
backup=('etc/chrony/chrony.conf')
source=(https://download.tuxfamily.org/chrony/${pkgname}-${pkgver}.tar.gz
${pkgname}-${pkgver}.tar.gz.asc::https://download.tuxfamily.org/chrony/${pkgname}-${pkgver}-tar-gz-asc.txt
chrony.sysusers
- chrony.tmpfiles)
-sha256sums=('4e02795b1260a4ec51e6ace84149036305cc9fc340e65edb9f8452aa611339b5'
- 'SKIP'
- '56aa817638c8f959169d514f1e7fc727ef31e7d3beda4fca5165292c7602ee42'
- 'c0b52787f68f3ef365eef64f53f22b4fb0046a91f0e38923f9d16f1ca19c3f3a')
+ chrony.tmpfiles
+ fix-util-unit-test-for-NTP-era-split.patch)
+b2sums=('503402c0dd68a340eb5ecd8b57dcb83d90124f31e8deb6e20bd1e9ed19b5dc952fa7f40a697d0d0cb77c349c9f3297dcd32265d77670a71836ba8709dcc83053'
+ 'SKIP'
+ 'e310a05f95d84741f7ddbbc496c52a9f603bb79afc47e57d291a92ae02efb630a357fda378ab5a11875c3997d073e05019d88dce7bbf4377a0228f328ba78fec'
+ 'e709df2f97b523ef1c7a9dae3232ccbd235ac8f025eba866165272f8ba0372a0aba965d3aae1402395e43331bd629b9d8f3fbffd75fc254f4a7e5ecd47f73130'
+ '210e5c1e80c0a13b3c96369837d86d9ae5350b30baeac6f2e4dd2bc780c476a5e900270edfe75a7bd501a28194448d45491c2920c58f4ab7895f47af25858226')
validpgpkeys=('8B1F4A9ADA73D401E3085A0B5FF06F29BA1E013B') # Miroslav Lichvar <mlichvar@redhat.com> has a dsa1024 key *in the wild*
prepare() {
cd ${pkgname}-${pkgver}
+ patch -Np1 < ../fix-util-unit-test-for-NTP-era-split.patch
sed -i \
- -e 's|pool.ntp.org|3.arch.pool.ntp.org|g' \
- -e 's|server foo.example.net|server 0.arch.pool.ntp.org iburst|g' \
- -e 's|server bar.example.net|server 1.arch.pool.ntp.org iburst|g' \
- -e 's|server baz.example.net|server 2.arch.pool.ntp.org iburst|g' \
+ -e 's|pool pool.ntp.org|pool 2.arch.pool.ntp.org|g' \
+ -e 's|server foo.example.net|server 0.arch.pool.ntp.org|g' \
+ -e 's|server bar.example.net|server 1.arch.pool.ntp.org|g' \
+ -e 's|server baz.example.net|server 3.arch.pool.ntp.org|g' \
examples/chrony.conf.example*
}
@@ -54,10 +57,17 @@ build() {
--enable-ntp-signd \
--with-user=chrony \
--with-sendmail=/usr/bin/sendmail \
- --with-hwclockfile=/etc/adjtime
+ --with-hwclockfile=/etc/adjtime \
+ --sbindir=/usr/bin \
+ --with-pidfile=/run/chrony/chronyd.pid
make
}
+check() {
+ cd ${pkgname}-${pkgver}
+ make check
+}
+
package() {
cd ${pkgname}-${pkgver}
make DESTDIR="${pkgdir}" install install-docs
@@ -69,9 +79,12 @@ package() {
install -Dm 644 examples/* -t "${pkgdir}/usr/share/doc/${pkgname}/examples"
install -Dm 644 examples/chrony.conf.example3 "${pkgdir}/etc/chrony/chrony.conf"
- echo -e "\n# Enable kernel RTC sync\nrtcsync" >> "${pkgdir}/etc/chrony/chrony.conf"
- sed -i '/^! rtconutc$/ s/^! //' "${pkgdir}/etc/chrony/chrony.conf"
+ sed -i \
+ -e '/^! pool /s/^! //' \
+ -e '/^! leapsectz right\/UTC/s/^! //' \
+ -e '/^! makestep 1.0 3/s/^! //' \
+ -e '/^! rtcsync/s/^! //' \
+ "${pkgdir}/etc/chrony/chrony.conf"
- mv "${pkgdir}/usr/sbin/chronyd" "${pkgdir}/usr/bin"
- rmdir "${pkgdir}"{/usr/sbin,/var/lib/chrony,/var/lib}
+ rmdir "${pkgdir}"{/var/lib/chrony,/var/lib}
}
diff --git a/fix-util-unit-test-for-NTP-era-split.patch b/fix-util-unit-test-for-NTP-era-split.patch
new file mode 100644
index 0000000..28a6545
--- /dev/null
+++ b/fix-util-unit-test-for-NTP-era-split.patch
@@ -0,0 +1,38 @@
+From 2d9eb5b6fa5225a7300c8eed95712969249900fb Mon Sep 17 00:00:00 2001
+From: Miroslav Lichvar <mlichvar@redhat.com>
+Date: Fri, 3 Jan 2020 11:25:55 +0100
+Subject: [PATCH] test: fix util unit test for NTP era split
+
+The current default NTP era split passed the Unix epoch (~50 years ago),
+which means the epoch converted to an NTP timestamp and back ends up in
+the next NTP era (year 2106).
+
+Fix the test to take into account the era split.
+---
+ test/unit/util.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/test/unit/util.c b/test/unit/util.c
+index f4d9f33..af9e90c 100644
+--- a/test/unit/util.c
++++ b/test/unit/util.c
+@@ -100,11 +100,19 @@ void test_unit(void) {
+ ntp_ts.hi = htonl(JAN_1970);
+ ntp_ts.lo = 0xffffffff;
+ UTI_Ntp64ToTimespec(&ntp_ts, &ts);
++#if defined(HAVE_LONG_TIME_T) && NTP_ERA_SPLIT > 0
++ TEST_CHECK(ts.tv_sec == 0x100000000LL * (1 + (NTP_ERA_SPLIT - 1) / 0x100000000LL));
++#else
+ TEST_CHECK(ts.tv_sec == 0);
++#endif
+ TEST_CHECK(ts.tv_nsec == 999999999);
+
+ UTI_AddDoubleToTimespec(&ts, 1e-9, &ts);
++#if defined(HAVE_LONG_TIME_T) && NTP_ERA_SPLIT > 0
++ TEST_CHECK(ts.tv_sec == 1 + 0x100000000LL * (1 + (NTP_ERA_SPLIT - 1) / 0x100000000LL));
++#else
+ TEST_CHECK(ts.tv_sec == 1);
++#endif
+ TEST_CHECK(ts.tv_nsec == 0);
+
+ ntp_fuzz.hi = 0;