aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andree <mandree@FreeBSD.org>2020-04-05 21:20:10 +0000
committerMatthias Andree <mandree@FreeBSD.org>2020-04-05 21:20:10 +0000
commitd1043619385edfe4ed466f46544778bd48099a07 (patch)
tree9d047c68985e4bee1b633ad540a829585223d078
parente306253d4a4fae53c045ae66433c303015d2fa8f (diff)
downloadports-d1043619385edfe4ed466f46544778bd48099a07.tar.gz
ports-d1043619385edfe4ed466f46544778bd48099a07.zip
net/chrony: make NETTLE build robust, improve rc script, re-enable NSS
Changes by Colin T.: * Always require pkgconfig instead of only requiring it for NSS, because otherwise chrony does not link reliably to nettle. [1] * Add pidfile to rc.d script to stop it from complaining when stopping chronyd. [1] * Document chronyd_* options in rc.d script. [1] Changes by Matthias Andree: * Move USES line up to please portlint. * Add HTMLDOCS option, to build and install HTML docs. IMPLIES DOCS. Needs textproc/asciidoctor (rubygem) as build requisite. * Turn CRYPTLIB into a _RADIO to choose at most one from NSS + NETTLE. * Under WITH_DEBUG, add --enable-debug to CONFIGURE_ARGS. * Remove @ (silent) from Makefile commands. * Remove NSS_BROKEN, chrony 3.5 appears to work with NSS. Updates [3]. PR: 244534 [1] PR: 242510 [2] PR: 223840 [3] Submitted by: Colin T. <bugzilla@nulldir.e4ward.com> [1] Reported by: Matt Smith <freebsd@xtaz.uk> [2] Approved by: maintainer timeout (yonas@fizk.net, 36 days)
Notes
Notes: svn path=/head/; revision=530840
-rw-r--r--net/chrony/Makefile37
-rw-r--r--net/chrony/files/chronyd.in21
-rw-r--r--net/chrony/pkg-plist5
3 files changed, 51 insertions, 12 deletions
diff --git a/net/chrony/Makefile b/net/chrony/Makefile
index bec2ac3675a2..aee4d9d2e3ab 100644
--- a/net/chrony/Makefile
+++ b/net/chrony/Makefile
@@ -3,6 +3,7 @@
PORTNAME= chrony
PORTVERSION= 3.5
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= http://download.tuxfamily.org/chrony/
@@ -12,10 +13,10 @@ COMMENT= System clock synchronization client and server
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
+USES= cpe gmake libedit pkgconfig
USERS= chronyd
GROUPS= chronyd
-USES= cpe gmake libedit
CPE_VENDOR= tuxfamily
HAS_CONFIGURE= yes
CONFIGURE_ARGS= --prefix=${PREFIX} \
@@ -34,22 +35,39 @@ PORTEXAMPLES= chrony.conf.example1 chrony.conf.example2 \
# XXX: there are also other potentially useful options worth looking into:
# --disable-pps Disable PPS API support
-OPTIONS_DEFINE= DOCS EXAMPLES IPV6 NETTLE NSS
+OPTIONS_DEFINE= DOCS HTMLDOCS EXAMPLES IPV6
OPTIONS_DEFAULT= NETTLE
+OPTIONS_RADIO= CRYPTLIB
+OPTIONS_RADIO_CRYPTLIB= NETTLE NSS
+HTMLDOCS_IMPLIES= DOCS
+OPTIONS_SUB= yes
+HTMLDOCS_DESC= Build HTML docs (IMPLIES DOCS, needs ruby, asciidoctor)
NETTLE_DESC= Nettle crypto library support
-NSS_DESC= Add support for more hashing algorithms
+NSS_DESC= NSS-based support for more hashing algorithms
IPV6_CONFIGURE_OFF= --disable-ipv6
NETTLE_CONFIGURE_OFF= --without-nettle
NETTLE_LIB_DEPENDS= libnettle.so:security/nettle
-NSS_BROKEN= Crashes on startup with NSS. See https://bugs.freebsd.org/223840
NSS_CONFIGURE_OFF= --without-nss
NSS_LIB_DEPENDS= libfreebl3.so:security/nss
-NSS_USES= pkgconfig
+
+HTMLDOCS_BUILD_DEPENDS+=asciidoctor:textproc/rubygem-asciidoctor
+HTMLDOCS_ALL_TARGET= docs
+HTMLDOCS_INSTALL_TARGET=docs
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_DEBUG)
+CONFIGURE_ARGS+= --enable-debug
+.endif
+
+.if ${PORT_OPTIONS:MHTMLDOCS}
+PORTDOCS+= doc/*.html
+.endif
post-patch:
- @cd ${WRKSRC}/examples && \
+ cd ${WRKSRC}/examples && \
${REINPLACE_CMD} -e 's!%%PREFIX%%!${PREFIX}!g' ${PORTEXAMPLES}
post-install:
@@ -59,12 +77,13 @@ post-install:
${STAGEDIR}${PREFIX}/etc/chrony.conf.sample
post-install-DOCS-on:
- @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${RM} doc/installation.html
cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
post-install-EXAMPLES-on:
- @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+ ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
cd ${WRKSRC}/examples && \
${INSTALL_DATA} ${PORTEXAMPLES} ${STAGEDIR}${EXAMPLESDIR}
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/net/chrony/files/chronyd.in b/net/chrony/files/chronyd.in
index 55f1053c5f61..b16d21b1aea6 100644
--- a/net/chrony/files/chronyd.in
+++ b/net/chrony/files/chronyd.in
@@ -4,17 +4,32 @@
#
# PROVIDE: chronyd
# REQUIRE: DAEMON
+# KEYWORD: nojail shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# chronyd_enable (bool): Set it to "YES" to enable chronyd
+# Default is "NO"
+# chronyd_config (str): Set full path to configuration file.
+# Default is "%%PREFIX%%/etc/chrony.conf"
+# chronyd_flags (str): Flags passed to chronyd(8)
+# Default is ""
#
. /etc/rc.subr
name=chronyd
rcvar=chronyd_enable
-command=%%PREFIX%%/sbin/${name}
-rc_flags="${chronyd_flags}"
load_rc_config ${name}
-: ${chronyd_enable="NO"}
+: ${chronyd_enable:="NO"}
+: ${chronyd_config:="%%PREFIX%%/etc/chrony.conf"}
+
+command=%%PREFIX%%/sbin/${name}
+command_args="-f ${chronyd_config}"
+pidfile=/var/run/chrony/${name}.pid
+required_files=${chronyd_config}
run_rc_command "$1"
diff --git a/net/chrony/pkg-plist b/net/chrony/pkg-plist
index 400d0099252f..da2579e0b05a 100644
--- a/net/chrony/pkg-plist
+++ b/net/chrony/pkg-plist
@@ -5,3 +5,8 @@ man/man5/chrony.conf.5.gz
man/man8/chronyd.8.gz
sbin/chronyd
@dir(chronyd,chronyd) /var/db/chrony
+%%HTMLDOCS%%%%DOCSDIR%%/chrony.conf.html
+%%HTMLDOCS%%%%DOCSDIR%%/chronyc.html
+%%HTMLDOCS%%%%DOCSDIR%%/chronyd.html
+%%HTMLDOCS%%%%DOCSDIR%%/faq.html
+%%HTMLDOCS%%%%DOCSDIR%%/installation.html