summaryrefslogtreecommitdiff
path: root/package/rdate
diff options
context:
space:
mode:
Diffstat (limited to 'package/rdate')
-rw-r--r--package/rdate/Config.in7
-rw-r--r--package/rdate/Makefile32
-rw-r--r--package/rdate/ipkg/rdate.control4
-rw-r--r--package/rdate/ipkg/rdate.postinst4
-rw-r--r--package/rdate/rdate.init21
-rw-r--r--package/rdate/rdate.ip-up4
6 files changed, 72 insertions, 0 deletions
diff --git a/package/rdate/Config.in b/package/rdate/Config.in
new file mode 100644
index 000000000..76954adc9
--- /dev/null
+++ b/package/rdate/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_RDATE
+ prompt "rdate............................. very small rdate and ntp client"
+ tristate
+ default n
+ help
+ A very small but secure rdate and ntp time synchronisation
+ client from MirBSD.
diff --git a/package/rdate/Makefile b/package/rdate/Makefile
new file mode 100644
index 000000000..4c409c88b
--- /dev/null
+++ b/package/rdate/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME= rdate
+PKG_VERSION= 20070817
+PKG_RELEASE= 2
+PKG_MD5SUM= 9a6489d7de4311678a3fab001bb503df
+MASTER_SITES= ${MASTER_SITE_MIRBSD:distfiles/=dist/mir/rdate/}
+WRKDIST= ${WRKDIR}/${PKG_NAME}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,RDATE,rdate,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+MAKE_FILE= GNUmakefile
+BUILD_STYLE= auto
+
+do-install:
+ifeq (${ADK_MANPAGES},y)
+ mkdir -p ${WRKINST}/man8
+ cp ${WRKSRC}/rdate.8 ${WRKINST}/man8/
+endif
+ ${INSTALL_DIR} ${IDIR_RDATE}/{etc/{init.d,ppp/ip-up.d},usr/sbin}
+ ${INSTALL_BIN} ${WRKBUILD}/rdate ${IDIR_RDATE}/usr/sbin/
+ ${INSTALL_SCRIPT} rdate.ip-up ${IDIR_RDATE}/etc/ppp/ip-up.d/rdate
+ ${INSTALL_SCRIPT} rdate.init ${IDIR_RDATE}/etc/init.d/rdate
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/rdate/ipkg/rdate.control b/package/rdate/ipkg/rdate.control
new file mode 100644
index 000000000..dcd902764
--- /dev/null
+++ b/package/rdate/ipkg/rdate.control
@@ -0,0 +1,4 @@
+Package: rdate
+Priority: base
+Section: base
+Description: A small rdate and NTP client
diff --git a/package/rdate/ipkg/rdate.postinst b/package/rdate/ipkg/rdate.postinst
new file mode 100644
index 000000000..e0013bdcc
--- /dev/null
+++ b/package/rdate/ipkg/rdate.postinst
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf 'e.g. "-nv pool.ntp.org"' rdate_flags
+add_service ntp 123/udp
diff --git a/package/rdate/rdate.init b/package/rdate/rdate.init
new file mode 100644
index 000000000..88bf464b9
--- /dev/null
+++ b/package/rdate/rdate.init
@@ -0,0 +1,21 @@
+#!/bin/mksh
+#FWINIT 54
+# It’s important that this is lower than openntpd’s FWinit number
+. /etc/rc.conf
+case $1 in
+autostart|start|restart)
+ if [[ $(ls -l /usr/sbin/rdate) != *ucb* ]]; then
+ rm -f /usr/sbin/rdate
+ ln -s ../ucb/rdate /usr/sbin/rdate
+ fi
+ [[ $rdate_flags = NO ]] && exit 0
+ /usr/ucb/rdate $rdate_flags
+ ;;
+autostop|stop)
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/rdate/rdate.ip-up b/package/rdate/rdate.ip-up
new file mode 100644
index 000000000..a80a7f320
--- /dev/null
+++ b/package/rdate/rdate.ip-up
@@ -0,0 +1,4 @@
+#!/bin/mksh
+. /etc/rc.conf
+[[ $rdate_flags = NO ]] || /usr/ucb/rdate $rdate_flags
+exit 0