# Description: Network Time Protocol software # URL: https://www.ntp.org # Maintainer: Roman Oreshnikov, r dot oreshnikov at gmail dot com # Depends on: libcap libedit libmd # Required user: ntp 77 name=ntp version=4.2.8p18 release=3 source=(https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/$name-$version.tar.gz ntp-4.2.8.p18-fix-build.patch ntpd ntp.conf) build () { cd $name-$version patch -Np1 < ../ntp-4.2.8.p18-fix-build.patch echo ' 3667,3669c3667,3669 < MD5Update(&ctx, salt, sizeof(salt)); < MD5Update(&ctx, &ts_i, sizeof(ts_i)); < MD5Update(&ctx, &ts_f, sizeof(ts_f)); --- > MD5Update(&ctx, (const uint8_t *) salt, sizeof(salt)); > MD5Update(&ctx, (const uint8_t *) &ts_i, sizeof(ts_i)); > MD5Update(&ctx, (const uint8_t *) &ts_f, sizeof(ts_f)); 3671c3671 < MD5Update(&ctx, &SOCK_ADDR4(addr), sizeof(SOCK_ADDR4(addr))); --- > MD5Update(&ctx, (const uint8_t *) &SOCK_ADDR4(addr), sizeof(SOCK_ADDR4(addr))); 3673c3673 < MD5Update(&ctx, &SOCK_ADDR6(addr), sizeof(SOCK_ADDR6(addr))); --- > MD5Update(&ctx, (const uint8_t *) &SOCK_ADDR6(addr), sizeof(SOCK_ADDR6(addr))); 3675,3676c3675,3676 < MD5Update(&ctx, &NSRCPORT(addr), sizeof(NSRCPORT(addr))); < MD5Update(&ctx, salt, sizeof(salt)); --- > MD5Update(&ctx, (const uint8_t *) &NSRCPORT(addr), sizeof(NSRCPORT(addr))); > MD5Update(&ctx, (const uint8_t *) salt, sizeof(salt)); ' | patch ntpd/ntp_control.c autoreconf -fiv ./configure \ --prefix=/usr \ --without-{crypto,ntpsnmpd,net-snmp-config,gtest} \ --disable-{autokey,debugging,ipv6,nls,saveconfig,all-clocks} \ --enable-ntp-signd \ --enable-linuxcaps \ --enable-LOCAL-CLOCK make make DESTDIR=$PKG install mv $PKG/usr/bin/{ntpd,ntpq} $PKG/usr/sbin rm -r $PKG/usr/{bin,libexec,share/{doc,ntp}} for f in ntpd ntpq; do mv $PKG/usr/share/man/man1/$f.1 $PKG/usr/share/man/man8/$f.8 done rm -r $PKG/usr/share/man/man1 sed -i 's/^\(\.TH [^ ]*\) 1 \(.*\)User Commands$/\1 8 \2System Administration/' $PKG/usr/share/man/man8/* install -Dm644 $SRC/ntp.conf $PKG/etc/ntp.conf install -D $SRC/ntpd $PKG/etc/rc.d/ntpd install -d -o ntp -g ntp $PKG/var/lib/ntp install -m644 -o ntp -g ntp /dev/null $PKG/var/lib/ntp/ntp.drift }