pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/sysutils/tuptime



Module Name:    pkgsrc
Committed By:   wiz
Date:           Sat Jun  6 18:39:55 UTC 2026

Added Files:
        pkgsrc/sysutils/tuptime: DESCR Makefile PLIST distinfo
        pkgsrc/sysutils/tuptime/files: README.pkgsrc tuptime.sh

Log Message:
sysutils/tuptime: import tuptime-5.2.6

Packaged in wip by Ricardo Fraile.

tuptime reports historical and statistical real time of the system,
preserving it between restarts. Like uptime, but with extended
information about the system startups, shutdowns and up/down times.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/tuptime/DESCR \
    pkgsrc/sysutils/tuptime/Makefile pkgsrc/sysutils/tuptime/PLIST \
    pkgsrc/sysutils/tuptime/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/tuptime/files/README.pkgsrc \
    pkgsrc/sysutils/tuptime/files/tuptime.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/sysutils/tuptime/DESCR
diff -u /dev/null pkgsrc/sysutils/tuptime/DESCR:1.1
--- /dev/null   Sat Jun  6 18:39:55 2026
+++ pkgsrc/sysutils/tuptime/DESCR       Sat Jun  6 18:39:55 2026
@@ -0,0 +1 @@
+System uptime history tracker that records boot and shutdown events.
Index: pkgsrc/sysutils/tuptime/Makefile
diff -u /dev/null pkgsrc/sysutils/tuptime/Makefile:1.1
--- /dev/null   Sat Jun  6 18:39:55 2026
+++ pkgsrc/sysutils/tuptime/Makefile    Sat Jun  6 18:39:55 2026
@@ -0,0 +1,40 @@
+# $NetBSD: Makefile,v 1.1 2026/06/06 18:39:55 wiz Exp $
+
+DISTNAME=      tuptime-5.2.6
+CATEGORIES=    sysutils
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=rfmoz/}
+GITHUB_TAG=    ${PKGVERSION_NOREV}
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://github.com/rfmoz/tuptime/
+COMMENT=       System uptime history tracker
+LICENSE=       gnu-gpl-v2
+
+USE_LANGUAGES= # none
+
+NO_BUILD=      yes
+
+REPLACE_PYTHON=        src/tuptime
+
+RCD_SCRIPTS=   tuptime
+
+PKG_GROUPS=            _tuptime
+PKG_USERS=             _tuptime:_tuptime
+PKG_GECOS._tuptime=    Tuptime user
+PKG_HOME._tuptime=     ${VARBASE}/lib/tuptime
+
+BUILD_DEFS+=           VARBASE
+OWN_DIRS_PERMS+=       ${VARBASE}/lib/tuptime _tuptime _tuptime 0755
+
+DOCDIR=                ${PREFIX}/share/doc/tuptime
+
+INSTALLATION_DIRS+=    bin ${DOCDIR} ${PKGMANDIR}/man1
+
+do-install:
+       ${INSTALL_SCRIPT} ${WRKSRC}/src/tuptime ${DESTDIR}${PREFIX}/bin/tuptime
+       ${INSTALL_MAN} ${WRKSRC}/src/man/tuptime.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/tuptime.1
+       ${INSTALL_DATA} ${WRKSRC}/tuptime-manual.txt ${DESTDIR}${DOCDIR}/tuptime-manual.txt
+       ${INSTALL_DATA} ${FILESDIR}/README.pkgsrc ${DESTDIR}${DOCDIR}/README.pkgsrc
+
+.include "../../lang/python/application.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/sysutils/tuptime/PLIST
diff -u /dev/null pkgsrc/sysutils/tuptime/PLIST:1.1
--- /dev/null   Sat Jun  6 18:39:55 2026
+++ pkgsrc/sysutils/tuptime/PLIST       Sat Jun  6 18:39:55 2026
@@ -0,0 +1,6 @@
+@comment $NetBSD: PLIST,v 1.1 2026/06/06 18:39:55 wiz Exp $
+bin/tuptime
+man/man1/tuptime.1
+share/doc/tuptime/README.pkgsrc
+share/doc/tuptime/tuptime-manual.txt
+share/examples/rc.d/tuptime
Index: pkgsrc/sysutils/tuptime/distinfo
diff -u /dev/null pkgsrc/sysutils/tuptime/distinfo:1.1
--- /dev/null   Sat Jun  6 18:39:55 2026
+++ pkgsrc/sysutils/tuptime/distinfo    Sat Jun  6 18:39:55 2026
@@ -0,0 +1,5 @@
+$NetBSD: distinfo,v 1.1 2026/06/06 18:39:55 wiz Exp $
+
+BLAKE2s (tuptime-5.2.6.tar.gz) = 24320b9c47730c75584e63c783925595c11cf6950ad305d68cec6dbe7530bb66
+SHA512 (tuptime-5.2.6.tar.gz) = 456b57efbacdb2cbbd4cac3bbe19b5f1fe96a07275d4dadc5e6d4be34b795cc966081e908407367521ba4430d74b644657e0b80c0b055c5cc13873f0b01be2aa
+Size (tuptime-5.2.6.tar.gz) = 64113 bytes

Index: pkgsrc/sysutils/tuptime/files/README.pkgsrc
diff -u /dev/null pkgsrc/sysutils/tuptime/files/README.pkgsrc:1.1
--- /dev/null   Sat Jun  6 18:39:55 2026
+++ pkgsrc/sysutils/tuptime/files/README.pkgsrc Sat Jun  6 18:39:55 2026
@@ -0,0 +1,25 @@
+tuptime on NetBSD
+=================
+
+tuptime records the system uptime each time it is run, keeping the
+history across reboots in /var/lib/tuptime.
+
+Recording boot and shutdown
+---------------------------
+
+An rc.d script is provided.  Copy it into place and enable it:
+
+    cp /usr/pkg/share/examples/rc.d/tuptime /etc/rc.d/tuptime
+    echo "tuptime=YES" >> /etc/rc.conf
+    /etc/rc.d/tuptime start
+
+It records a startup (tuptime -q) at boot and a graceful shutdown
+(tuptime -qg) at system shutdown, both with the _tuptime user.
+
+Periodic recording
+-------------------
+
+To keep the stored value current even after an unclean shutdown, add a
+periodic entry to the _tuptime user's crontab ("crontab -u _tuptime -e"):
+
+    */5 * * * * /usr/pkg/bin/tuptime -q
Index: pkgsrc/sysutils/tuptime/files/tuptime.sh
diff -u /dev/null pkgsrc/sysutils/tuptime/files/tuptime.sh:1.1
--- /dev/null   Sat Jun  6 18:39:55 2026
+++ pkgsrc/sysutils/tuptime/files/tuptime.sh    Sat Jun  6 18:39:55 2026
@@ -0,0 +1,34 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: tuptime.sh,v 1.1 2026/06/06 18:39:55 wiz Exp $
+#
+# PROVIDE: tuptime
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+#
+# Record the uptime at boot (tuptime -q) and at shutdown (tuptime -qg),
+# as the _tuptime user.  Enable by adding  tuptime=YES  to /etc/rc.conf.
+
+. /etc/rc.subr
+
+name="tuptime"
+rcvar=${name}
+command="@PREFIX@/bin/tuptime"
+tuptime_user="_tuptime"
+start_cmd="tuptime_start"
+stop_cmd="tuptime_stop"
+
+tuptime_start()
+{
+       echo "Starting ${name}."
+       su -m ${tuptime_user} -c "${command} -q"
+}
+
+tuptime_stop()
+{
+       echo "Stopping ${name}."
+       su -m ${tuptime_user} -c "${command} -qg"
+}
+
+load_rc_config "${name}"
+run_rc_command "$1"



Home | Main Index | Thread Index | Old Index