pkgsrc-WIP-changes archive

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

tuptime: Add tuptime-5.2.6



Module Name:	pkgsrc-wip
Committed By:	Ricardo F <r%rfmoz.eu@localhost>
Pushed By:	rfmoz
Date:		Sat Jun 6 16:17:12 2026 +0200
Changeset:	bf0605c2e5cd66c932501123d5372db6638d3ab3

Modified Files:
	Makefile
Added Files:
	tuptime/COMMIT_MSG
	tuptime/DESCR
	tuptime/Makefile
	tuptime/PLIST
	tuptime/TODO
	tuptime/distinfo
	tuptime/files/README.pkgsrc
	tuptime/files/tuptime.sh

Log Message:
tuptime: Add tuptime-5.2.6

System uptime history tracker that records boot and shutdown events.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=bf0605c2e5cd66c932501123d5372db6638d3ab3

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

diffstat:
 Makefile                    |  1 +
 tuptime/COMMIT_MSG          |  7 +++++++
 tuptime/DESCR               |  1 +
 tuptime/Makefile            | 41 +++++++++++++++++++++++++++++++++++++++++
 tuptime/PLIST               |  6 ++++++
 tuptime/TODO                |  4 ++++
 tuptime/distinfo            |  5 +++++
 tuptime/files/README.pkgsrc | 25 +++++++++++++++++++++++++
 tuptime/files/tuptime.sh    | 34 ++++++++++++++++++++++++++++++++++
 9 files changed, 124 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 5d64f5e763..6f0acb0a1e 100644
--- a/Makefile
+++ b/Makefile
@@ -5844,6 +5844,7 @@ SUBDIR+=	ttytter
 SUBDIR+=	tuareg-mode
 SUBDIR+=	tuba
 SUBDIR+=	tudu
+SUBDIR+=	tuptime
 SUBDIR+=	tutos
 SUBDIR+=	tuxanci
 SUBDIR+=	tuxanci-server
diff --git a/tuptime/COMMIT_MSG b/tuptime/COMMIT_MSG
new file mode 100644
index 0000000000..dfa187d445
--- /dev/null
+++ b/tuptime/COMMIT_MSG
@@ -0,0 +1,7 @@
+sysutils/tuptime: Add tuptime version 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.
diff --git a/tuptime/DESCR b/tuptime/DESCR
new file mode 100644
index 0000000000..975d06587b
--- /dev/null
+++ b/tuptime/DESCR
@@ -0,0 +1 @@
+System uptime history tracker that records boot and shutdown events.
diff --git a/tuptime/Makefile b/tuptime/Makefile
new file mode 100644
index 0000000000..faf66142c1
--- /dev/null
+++ b/tuptime/Makefile
@@ -0,0 +1,41 @@
+# $NetBSD$
+
+DISTNAME=	tuptime-5.2.6
+CATEGORIES=	sysutils
+MASTER_SITES=	${MASTER_SITE_GITHUB:=rfmoz/}
+GITHUB_PROJECT=	tuptime
+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"
diff --git a/tuptime/PLIST b/tuptime/PLIST
new file mode 100644
index 0000000000..d7121f413b
--- /dev/null
+++ b/tuptime/PLIST
@@ -0,0 +1,6 @@
+@comment $NetBSD$
+bin/tuptime
+man/man1/tuptime.1
+share/doc/tuptime/README.pkgsrc
+share/doc/tuptime/tuptime-manual.txt
+share/examples/rc.d/tuptime
diff --git a/tuptime/TODO b/tuptime/TODO
new file mode 100644
index 0000000000..ee2debd06c
--- /dev/null
+++ b/tuptime/TODO
@@ -0,0 +1,4 @@
+tuptime is feature-complete and ready for import to sysutils/tuptime.
+
+Verified on NetBSD 10.0/i386: pkglint clean, "make package" OK, runs at
+runtime (Python 3.13 with built-in sqlite3, no extra dependency needed).
diff --git a/tuptime/distinfo b/tuptime/distinfo
new file mode 100644
index 0000000000..acb2f9717a
--- /dev/null
+++ b/tuptime/distinfo
@@ -0,0 +1,5 @@
+$NetBSD$
+
+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
diff --git a/tuptime/files/README.pkgsrc b/tuptime/files/README.pkgsrc
new file mode 100644
index 0000000000..a8dc001c52
--- /dev/null
+++ b/tuptime/files/README.pkgsrc
@@ -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
diff --git a/tuptime/files/tuptime.sh b/tuptime/files/tuptime.sh
new file mode 100644
index 0000000000..e3accfc34e
--- /dev/null
+++ b/tuptime/files/tuptime.sh
@@ -0,0 +1,34 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD$
+#
+# 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