Skip to content

Commit

Permalink
New package: ntpd-rs-0.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
tranzystorekk committed Aug 24, 2023
1 parent 543e123 commit 99206dd
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
5 changes: 5 additions & 0 deletions srcpkgs/ntpd-rs/INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
case "${ACTION}" in
post)
setcap CAP_SYS_TIME=+ep usr/bin/ntp-daemon
;;
esac
4 changes: 4 additions & 0 deletions srcpkgs/ntpd-rs/files/ntpd-rs/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
exec 2>&1
[ ! -d /run/ntpd-rs ] && mkdir /run/ntpd-rs && chown _ntpd_rs:_ntpd_rs /run/ntpd-rs
exec chpst -u _ntpd_rs:_ntpd_rs ntp-daemon
16 changes: 16 additions & 0 deletions srcpkgs/ntpd-rs/patches/fix-musl-test.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/ntp-udp/src/hwtimestamp.rs b/ntp-udp/src/hwtimestamp.rs
index be5f870..66b3095 100644
--- a/ntp-udp/src/hwtimestamp.rs
+++ b/ntp-udp/src/hwtimestamp.rs
@@ -77,7 +77,10 @@ mod tests {
udp_socket.connect(("10.0.0.18", 9001))?;

if let Err(e) = get_hardware_timestamp(&udp_socket) {
- assert!(e.to_string().contains("Operation not supported"))
+ assert!(
+ e.to_string().contains("Operation not supported")
+ || e.to_string().contains("Not supported")
+ )
}

Ok(())
33 changes: 33 additions & 0 deletions srcpkgs/ntpd-rs/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Template file for 'ntpd-rs'
pkgname=ntpd-rs
version=0.3.7
revision=1
build_style=cargo
make_check_args="--
--skip algorithm::kalman::peer::tests::test_offset_steering_and_measurements
--skip keyexchange::tests::client_connection_refused
--skip interface_name::tests::find_interface_ipv6
--skip socket::tests::test_client_basic_ipv6
--skip socket::tests::test_server_basic_ipv6"
make_install_args="--path ntpd"
depends="libcap-progs"
short_desc="Full-featured implementation of the Network Time Protocol"
maintainer="Marcin Puc <tranzystorek.io@protonmail.com>"
license="Apache-2.0, MIT"
homepage="https://github.com/pendulum-project/ntpd-rs"
changelog="https://raw.githubusercontent.com/pendulum-project/ntpd-rs/main/CHANGELOG.md"
distfiles="https://github.com/pendulum-project/ntpd-rs/archive/refs/tags/v${version}.tar.gz"
checksum=e705447e61a4857875b136d5910b48f2db5dba91b77e59e430c0d651867429ad

system_accounts="_ntpd_rs"
conf_files="/etc/ntpd-rs/ntp.toml"
provides="ntp-daemon-0_1"
alternatives="
ntpd:ntpd:/usr/bin/ntp-daemon
ntpd:ntpd:/etc/sv/ntpd-rs"

post_install() {
vinstall ntp.toml 644 etc/ntpd-rs
vlicense LICENSE-MIT
vsv ntpd-rs
}

0 comments on commit 99206dd

Please sign in to comment.