diff --git a/net/ntpa/Makefile b/net/ntpa/Makefile index 2368637448ea..58b4c191dea4 100644 --- a/net/ntpa/Makefile +++ b/net/ntpa/Makefile @@ -1,61 +1,61 @@ # Created by: Carsten Larsen # $FreeBSD$ PORTNAME= ntpa -PORTVERSION= 0.7.6 +PORTVERSION= 0.7.10 CATEGORIES= net MASTER_SITES= http://dist.innolan.net/ MAINTAINER= cs@innolan.dk COMMENT= NTP data collection and charting LICENSE= MIT BSD3CLAUSE PostgreSQL GPLv2 LICENSE_COMB= multi USES= mono pkgconfig autoreconf gmake GNU_CONFIGURE= yes NO_ARCH= yes OPTIONS_SUB= yes USE_RC_SUBR= ntpa USERS= ntpa GROUPS= ntpa SUB_FILES= ntpad ntpav ntpac ntpag OPTIONS_DEFINE= WEBFILES GRAPH WEBFILES_DESC= Install web files GRAPH_DESC= Graph generation (requires Cairo) GRAPH_BUILD_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/NPlot.pc:graphics/nplot GRAPH_RUN_DEPENDS= nplot>=0:graphics/nplot CONFIGURE_ARGS+= --libdir=${LOCALBASE}/libexec --bindir=${LOCALBASE}/libexec/ntpa .include .if ! ${PORT_OPTIONS:MGRAPH} CONFIGURE_ENV+= NPLOT_CFLAGS=" " NPLOT_LIBS="-r:../packages/NPlot.0.9.10.0/lib/net20/NPlot.dll" .endif post-install-WEBFILES-on: ${MKDIR} ${STAGEDIR}${WWWDIR} (cd ${WRKSRC}/html && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR}) post-install: ${INSTALL_SCRIPT} ${WRKDIR}/ntpad ${STAGEDIR}${PREFIX}/sbin/ntpa ${INSTALL_SCRIPT} ${WRKDIR}/ntpav ${STAGEDIR}${PREFIX}/sbin ${INSTALL_SCRIPT} ${WRKDIR}/ntpag ${STAGEDIR}${PREFIX}/sbin ${INSTALL_SCRIPT} ${WRKDIR}/ntpac ${STAGEDIR}${PREFIX}/sbin ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/examples/graph.conf ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/examples/ntpd.conf ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/examples/openntp.conf ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/examples/small.conf ${STAGEDIR}${EXAMPLESDIR} ${MKDIR} ${STAGEDIR}${PREFIX}/etc/ntpa/ ${INSTALL_DATA} ${WRKSRC}/examples/ntpa.conf ${STAGEDIR}${PREFIX}/etc/ntpa/ntpa.conf.sample ${INSTALL_MAN} ${WRKSRC}/docs/ntpa.1 ${STAGEDIR}${PREFIX}/man/man1 ${MKDIR} ${STAGEDIR}/var/log/ntpa ${MKDIR} ${STAGEDIR}/var/run/ntpa .include diff --git a/net/ntpa/distinfo b/net/ntpa/distinfo index 4327963e66f8..7e4eb3834669 100644 --- a/net/ntpa/distinfo +++ b/net/ntpa/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1481372685 -SHA256 (ntpa-0.7.6.tar.gz) = 0c24c2640dc78edf8bdcb405df02f81835e6938eb5c4ca2780106091d057bfb5 -SIZE (ntpa-0.7.6.tar.gz) = 3245250 +TIMESTAMP = 1481972002 +SHA256 (ntpa-0.7.10.tar.gz) = 43784b81a98dcbf685fc9ea9b85864a4c06b74bcb148deb6ff67304020821867 +SIZE (ntpa-0.7.10.tar.gz) = 2565305 diff --git a/net/ntpa/files/ntpa.in b/net/ntpa/files/ntpa.in index 0c477ae2df64..adaba01d0028 100644 --- a/net/ntpa/files/ntpa.in +++ b/net/ntpa/files/ntpa.in @@ -1,115 +1,115 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: ntpa # REQUIRE: networking # KEYWORD: shutdown # # Add these lines to /etc/rc.conf to enable ntpa: # # ntpa_enable (bool): Set to NO by default. # Set it to YES to enable ntpa. # ntpa_config (path): Set to %%PREFIX%%/etc/ntpa/ntpa.conf # by default. # ntpa_tempdir (path): Set to /tmp by default. # ntpa_user (user): Set to ntpa by default. # # Run additional instances of ntpa with: # ln -s ntpa ntpa_name # . /etc/rc.subr # taken from security/openvpn. name="$file" ; case "$0" in /etc/rc*) # during boot (shutdown) $0 is /etc/rc (/etc/rc.shutdown), # so get the name of the script from $_file name="$_file" ;; */service) # do not use this as $0 ;; *) name="$0" ;; esac # default name to "ntpa" if guessing failed # Trailing semicolon for service(8)'s benefit: name="${name:-ntpa}" ; name="${name##*/}" desc="Monitors NTP daemon" rcvar=${name}_enable start_cmd=ntpa_start stop_cmd=ntpa_stop reload_cmd=ntpa_reload configtest_cmd=ntpa_configtest extra_commands="reload configtest" load_rc_config ${name} eval ": \${${name}_enable:=\"NO\"}" eval ": \${${name}_config:=\"%%PREFIX%%/etc/ntpa/${name}.conf\"}" eval ": \${${name}_tempdir:=\"/tmp/\"}" eval ": \${${name}_user:=\"ntpa\"}" config="$(eval echo \${${name}_config})" tempdir="$(eval echo \${${name}_tempdir})" ntpauser="$(eval echo \${${name}_user})" pid_dir=/var/run/ntpa pidfile="$pid_dir/${name}.pid" ntpa_start() { if [ ! -d "$pid_dir" ]; then install -m 0775 -g $ntpauser -o $ntpauser -d "$pid_dir" fi if [ -f ${pidfile} ]; then rc_pid=`cat ${pidfile}` echo 1>&2 "${name} already running? (pid=$rc_pid)." return 1 else echo "Starting ${name}." su -m ${ntpauser} -c "sh -c '%%PREFIX%%/sbin/ntpa --config ${config} --writepid ${pidfile} --temp ${tempdir} --daemon ${name} &'" fi } ntpa_configtest() { su -m ${ntpauser} -c "sh -c '%%PREFIX%%/sbin/ntpav -v ${config}'" } ntpa_reload() { if [ ! -f ${pidfile} ]; then _run_rc_notrunning return 1 else - echo "Reloading ${name}." + echo "Reloading ${name} configuration." rc_pid=`cat ${pidfile}` kill -USR1 $rc_pid fi } ntpa_stop() { if [ ! -f ${pidfile} ]; then _run_rc_notrunning return 1 else echo "Stopping ${name}." rc_pid=`cat ${pidfile}` kill -TERM $rc_pid wait_for_pids ${rc_pid} fi } run_rc_command "$1" diff --git a/net/ntpa/pkg-deinstall b/net/ntpa/pkg-deinstall new file mode 100644 index 000000000000..9de39eba00f9 --- /dev/null +++ b/net/ntpa/pkg-deinstall @@ -0,0 +1,32 @@ +#! /bin/sh + +delnewsyslog() { + tmp="/etc/#ntpa$$" + sed -e '/^\/var\/log\/ntpa\/ntpa.log /d' /etc/newsyslog.conf >${tmp} + cat ${tmp} > /etc/newsyslog.conf + rm ${tmp} +} + +newsyslog() { + ENTRY=`grep /var/log/ntpa/ntpa.log /etc/newsyslog.conf` + DEFAULT='/var/log/ntpa/ntpa.log root:ntpa 660 10 * @T00 C /var/run/ntpa/ntpa.pid SIGUSR2' + if [ -z "$ENTRY" ]; then + exit 0 + elif [ "$ENTRY" = "$DEFAULT" ]; then + delnewsyslog + else + echo "You have changed the default ntpa entry in \"/etc/newsyslog.conf\"". + echo "If you deinstall ntpa permanently, you have to manually remove it" + fi +} + + +case $2 in + DEINSTALL) + if [ -z "${PACKAGE_BUILDING}" ]; then + newsyslog + fi + ;; + POST-DEINSTALL) + ;; +esac diff --git a/net/ntpa/pkg-install b/net/ntpa/pkg-install new file mode 100644 index 000000000000..da18ed5f380a --- /dev/null +++ b/net/ntpa/pkg-install @@ -0,0 +1,21 @@ +#! /bin/sh + +newsyslog() { + if grep -q /var/log/ntpa/ntpa.log /etc/newsyslog.conf; then + : + else + cat >> /etc/newsyslog.conf <