diff --git a/net/chrony/Makefile b/net/chrony/Makefile index 68f89fcf6eae..7b2e1654d237 100644 --- a/net/chrony/Makefile +++ b/net/chrony/Makefile @@ -1,121 +1,110 @@ PORTNAME= chrony DISTVERSION= 4.8 PORTREVISION= 0 CATEGORIES= net MASTER_SITES= https://chrony-project.org/releases/ \ LOCAL/mandree # overridden in net/chrony-lite MAINTAINER?= mandree@FreeBSD.org COMMENT?= System clock synchronization client and server WWW= https://chrony-project.org/ LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING USES= cpe gmake libedit pkgconfig CPE_VENDOR= tuxfamily USE_RC_SUBR= chronyd HAS_CONFIGURE= yes CONFIGURE_ARGS= --chronyvardir=/var/db/${PORTNAME} \ --datarootdir=${DATADIR} \ --docdir=${DOCSDIR} \ --enable-ntp-signd \ --mandir=${PREFIX}/share/man \ --prefix=${PREFIX} \ --sysconfdir=${PREFIX}/etc \ --without-tomcrypt ALL_TARGET= all INSTALL_TARGET= install TEST_TARGET= check LDFLAGS+= -L${LOCALBASE}/lib CONFLICTS_INSTALL?= chrony-lite PORTDOCS= FAQ NEWS README PORTEXAMPLES= chrony.conf.example1 chrony.conf.example2 chrony.conf.example3 \ chrony.keys.example # XXX: there are also other potentially useful options worth looking into: # --disable-pps Disable PPS API support OPTIONS_DEFINE= DOCS EXAMPLES HTMLDOCS NTS USER OPTIONS_DEFAULT= NETTLE NTS USER OPTIONS_GROUP= SECHASH OPTIONS_GROUP_SECHASH= NETTLE NSS OPTIONS_SUB= yes HTMLDOCS_DESC= Build HTML docs (IMPLIES DOCS, needs ruby, asciidoctor) NETTLE_DESC= Nettle crypto library support for secure hash and NTS NSS_DESC= NSS-based support for more hashing algorithms NTS_DESC= Support Network Time Security (NTS, uses GnuTLS & Nettle) SECHASH_DESC= Support for secure hash functions USER_DESC= Run as user/group chronyd (unset: user/group ntpd) HTMLDOCS_IMPLIES= DOCS HTMLDOCS_BUILD_DEPENDS+= asciidoctor:textproc/rubygem-asciidoctor HTMLDOCS_ALL_TARGET= docs HTMLDOCS_INSTALL_TARGET= docs NETTLE_PREVENTS= NSS NETTLE_LIB_DEPENDS= libnettle.so:security/nettle NETTLE_CONFIGURE_OFF= --without-nettle NSS_LIB_DEPENDS= libfreebl3.so:security/nss NSS_CONFIGURE_OFF= --without-nss NTS_IMPLIES= NETTLE NTS_LIB_DEPENDS= libgnutls.so:security/gnutls NTS_CONFIGURE_OFF= --without-gnutls USER_CONFIGURE_ON= --with-user=chronyd USER_CONFIGURE_OFF= --with-user=ntpd USER_VARS= GROUPS=chronyd \ USERS=chronyd .include .if defined(WITH_DEBUG) CONFIGURE_ARGS+= --enable-debug .endif .if ${PORT_OPTIONS:MHTMLDOCS} PORTDOCS+= doc/*.html .endif post-patch: cd ${WRKSRC}/examples && \ ${REINPLACE_CMD} -e 's!%%PREFIX%%!${PREFIX}!g' \ -e 's!/var/lib!/var/db!g' \ ${PORTEXAMPLES:M*.conf.example*} -.if "4.8" == ${PORTVERSION} && empty(WITH_DEBUG) - # SCK_AcceptConnection sets the socket to non-blocking, - # and socket.test (built from socket.c and wildcarded) - # fails with EAGAIN; to see for yourself, build - # with WITH_DEBUG=yes set, so that you get --enable-debug - # for configure, and run test/unit/socket.test -d - # You can avoid that by running under truss, at least - # on FreeBSD 14.3 amd64. The same does not happen - # on Fedora Linux 42 x86_64 on the very same computer. - ${MV} ${WRKSRC}/test/unit/socket.c ${WRKSRC}/test/unit/socket.c.disabled -.endif post-install: ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/chronyc ${STRIP_CMD} ${STAGEDIR}${PREFIX}/sbin/chronyd ${INSTALL_DATA} ${WRKSRC}/examples/chrony.conf.example3 \ ${STAGEDIR}${PREFIX}/etc/chrony.conf.sample post-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR} ${RM} doc/installation.html cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR} post-install-EXAMPLES-on: ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} cd ${WRKSRC}/examples && \ ${INSTALL_DATA} ${PORTEXAMPLES} ${STAGEDIR}${EXAMPLESDIR} .include diff --git a/net/chrony/files/patch-test_unit_socket.c b/net/chrony/files/patch-test_unit_socket.c new file mode 100644 index 000000000000..fd9e71d17078 --- /dev/null +++ b/net/chrony/files/patch-test_unit_socket.c @@ -0,0 +1,30 @@ +commit 120bf44989391164c924e97d3142dc1352ab7970 +Author: Miroslav Lichvar +Date: Thu Aug 28 09:33:34 2025 +0200 + + test: fix socket unit test to use non-blocking accepted sockets + + SCK_AcceptConnection() always returns a non-blocking socket. Clear the + O_NONBLOCK flag in the socket unit test, which relies on blocking, to + avoid failures. + + Reported-by: Matthias Andree + +--- test/unit/socket.c.orig 2025-08-27 12:05:31 UTC ++++ test/unit/socket.c +@@ -191,6 +191,7 @@ test_unit(void) + s3 = SCK_AcceptConnection(s1, &sa2); + TEST_CHECK(UTI_CompareIPs(&sa1.ip_addr, &sa2.ip_addr, NULL) == 0); + ++ fcntl(s3, F_SETFL, fcntl(s3, F_GETFL) & ~O_NONBLOCK); + send_and_recv(SCK_ADDR_IP, 1, 1, s3, s2); + + SCK_ShutdownConnection(s2); +@@ -227,6 +228,7 @@ test_unit(void) + s3 = SCK_AcceptConnection(s1, &sa2); + TEST_CHECK(sa2.ip_addr.family == IPADDR_UNSPEC); + ++ fcntl(s3, F_SETFL, fcntl(s3, F_GETFL) & ~O_NONBLOCK); + send_and_recv(SCK_ADDR_UNIX, 1, i % 2, s3, s2); + + if (i % 4)