Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Oct 2005 19:35:32 +0200 (CEST)
From:      "Frank W. Josellis" <frank@dynamical-systems.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/86839: Update port: sysutils/pcfclock revised to 0.44_2
Message-ID:  <200510021735.j92HZW5B000573@achilles.senax.net>
Resent-Message-ID: <200510021740.j92HeDhL036322@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         86839
>Category:       ports
>Synopsis:       Update port: sysutils/pcfclock revised to 0.44_2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 02 17:40:13 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Frank W. Josellis
>Release:        FreeBSD 4.11-STABLE i386
>Organization:
>Environment:
System: FreeBSD achilles.senax.net 4.11-STABLE FreeBSD 4.11-STABLE #8: Fri Sep 23 17:31:13 CEST 2005 root@achilles.senax.net:/usr/obj/usr/src/sys/ACHILLES i386


>Description:
Added a script for setting the system time from /dev/pcfclock0 during 
the boot process. Notably for FreeBSD 5.x this provides a convenient way 
to set the time at an early boot stage, before any time synchronization 
daemons are launched to achieve a more precise adjustment with the global 
network time.

Added files:
files/pcfdate.sh
pkg-deinstall

>How-To-Repeat:
	
>Fix:

--- pcfclock-0.44_2.patch begins here ---
diff -Nur pcfclock.BAK/Makefile pcfclock/Makefile
--- pcfclock.BAK/Makefile	Sat May  7 10:14:35 2005
+++ pcfclock/Makefile	Sun Oct  2 17:44:45 2005
@@ -7,18 +7,19 @@
 
 PORTNAME=	pcfclock
 PORTVERSION=	0.44
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	sysutils
 MASTER_SITES=	http://www-stud.ims.uni-stuttgart.de/~voegelas/pcfclock/
 
 MAINTAINER=	frank@dynamical-systems.org
 COMMENT=	Userland access to the pcfclock device
 
+USE_RC_SUBR=	yes
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--without-linux
 
 MAN8=		pcfdate.8
-PLIST_FILES=	sbin/pcfdate
+PLIST_FILES=	etc/rc.d/pcfdate.sh.sample sbin/pcfdate
 
 .include <bsd.port.pre.mk>
 
@@ -31,8 +32,9 @@
 .endif
 
 post-install:
-.if ${OSVERSION} < 500000
-	${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
-.endif
-
+	PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+	@${SED} -e 's|%%PREFIX%%|${PREFIX}|g' \
+		-e 's|%%RC_SUBR%%|${RC_SUBR}|g' \
+		${FILESDIR}/pcfdate.sh > ${PREFIX}/etc/rc.d/pcfdate.sh.sample
+	@${CHMOD} 755 ${PREFIX}/etc/rc.d/pcfdate.sh.sample
 .include <bsd.port.post.mk>
diff -Nur pcfclock.BAK/files/pcfdate.sh pcfclock/files/pcfdate.sh
--- pcfclock.BAK/files/pcfdate.sh	Thu Jan  1 01:00:00 1970
+++ pcfclock/files/pcfdate.sh	Sun Oct  2 17:44:45 2005
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+#
+# PROVIDE: pcfdate
+# BEFORE:  hostname
+# KEYWORD: FreeBSD DragonFly
+
+prefix=%%PREFIX%%
+
+# Define these pcfdate_* variables in one of these files:
+#	/etc/rc.conf
+#	/etc/rc.conf.local
+#	/etc/rc.conf.d/pcfdate
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+pcfdate_enable=${pcfdate_enable:-"NO"}	        # Enable pcfdate
+pcfdate_flags=${pcfdate_flags:-"-sv"}           # Flags to pcfdate program
+pcfdate_program="${prefix}/sbin/pcfdate"        # Location of pcfdate
+
+. %%RC_SUBR%%
+
+name="pcfdate"
+rcvar=`set_rcvar`
+start_cmd="pcfdate_start"
+stop_cmd=":"
+required_files="/dev/pcfclock0"
+
+pcfdate_start(){
+	echo "Setting time from pcfclock."
+	${pcfdate_program} ${pcfdate_flags}
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff -Nur pcfclock.BAK/pkg-deinstall pcfclock/pkg-deinstall
--- pcfclock.BAK/pkg-deinstall	Thu Jan  1 01:00:00 1970
+++ pcfclock/pkg-deinstall	Sun Oct  2 17:44:45 2005
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+case $2 in
+    DEINSTALL)
+    if [ -L /etc/rc.d/pcfdate ]; then
+	echo -n "Removing stale link: " ; rm -v /etc/rc.d/pcfdate
+    fi
+    ;;
+esac
diff -Nur pcfclock.BAK/pkg-install pcfclock/pkg-install
--- pcfclock.BAK/pkg-install	Sat May  7 10:14:35 2005
+++ pcfclock/pkg-install	Sun Oct  2 17:44:45 2005
@@ -16,5 +16,8 @@
 	    echo "$2: Try 'cd /dev ; mknod pcfclock0 c 140 0 root:wheel'"
 	fi
     fi
+    if [ -d /etc/rc.d ]; then
+	ln -vfs ${PKG_PREFIX}/etc/rc.d/pcfdate.sh.sample /etc/rc.d/pcfdate
+    fi
     ;;
 esac
--- pcfclock-0.44_2.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200510021735.j92HZW5B000573>