Index | Thread | Search

From:
Ryan Freeman <ryan@slipgate.org>
Subject:
Re: [update] sysutils/uptimed 0.4.6
To:
Laurent Cheylus <foxy@free.fr>
Cc:
Ports <ports@openbsd.org>
Date:
Thu, 17 Oct 2024 10:23:34 -0700

Download raw body.

Thread
Hello,

On Thu, Oct 17, 2024 at 12:51:25PM +0200, Laurent Cheylus wrote:
> Hi,
> 
> [cc ryan@slipgate.org as maintainer]
> 
> update for sysutils/uptimed to the latest version 0.4.6 (release = November 2021...).
> Daemon and tool to track uptime records => https://github.com/rpodgorny/uptimed

Thanks for this.  I have been holding off on updates here as the ChangeLog
does not indicate changes worth generating ports churn.  The only one change
I saw in the most recent version was about fuzzing boot times, but I've
never seen an issue with this on the machines I still run this on.

All other changes are about small portability changes to add platform
support for other systems, there is little to no benefit from updating
here.

0.4.6
-----
- better deuplicate entry detection on linux and bsd
- added manifest for solaris smf

0.4.5
-----
- added AIX port

0.4.4
-----
- updates for compilation on macos

0.4.3
-----
- support for dragonfly

0.4.2
-----
- support for android

0.4.1
-----
- updates for modern solaris

0.4.0
-----

- dropped pre-generated autotools stuff
- fixed configure step on non-linux platforms
  (thanks to Baptiste Fontaine <b@ptistefontaine.fr>)
- updated systemd unit to restart daemon on failure

0.3.18
------

- reintroduce reading of /proc/uptime on Linux
  (thanks to Tomasz Torcz <tomek@pipebreaker.pl>)
- also try clock_gettime() on Linux
  (thanks to Tomasz Torcz <tomek@pipebreaker.pl>)
- extended status for systemd/Linux
  (thanks to Tomasz Torcz <tomek@pipebreaker.pl>)

> - update Makefile:
>   * use GH_* to download sources from GitHub repository 
>   * use CONFIGURE_STYLE = autoreconf and define AUTORECONF, AUTOCONF_VERSION and AUTOMAKE_VERSION
>   * define LOCALSTATEDIR (/var/db/uptimed/)
>   * substitute VARBASE/LOCALSTATEDIR during configure and install

Switching to the GitHub generated archives may just cause more churn if
distfile checksums change on a whim...

> - patch Makefile.am for LOCALSTATEDIR
> - patch libuptimed/urec.h for LOCALSTATEDIR
> - patch pkg/uptimed.rc for VARBASE

I'm unsure if its worth patching files to use LOCALSTATEDIR.  If you are
interested, pushing such changes upstream to make the options available
would be a better path than maintaining the patches locally in ports.

VARBASE usage in the uptimed.rc file is nice.

Lastly, I do not pay enough attention to this little utility these days.
The current version still runs fine for me.

If you are interested, you have my blessing to take MAINTAINER.
I would await further comments from other porters for the other changes.


Regards,
-Ryan


> - update pkg/PLIST after 'make fake'
> 
> Build and tests OK on current/amd64.
> 
> Tests welcome and please commit if OK.
> 
> Laurent
> 

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/sysutils/uptimed/Makefile,v
> diff -u -p -r1.9 Makefile
> --- Makefile	27 Sep 2023 17:16:36 -0000	1.9
> +++ Makefile	17 Oct 2024 09:15:05 -0000
> @@ -1,22 +1,34 @@
>  COMMENT =	keeps a list of uptime records
> -DISTNAME =	uptimed-0.3.17
> +
> +GH_ACCOUNT =	rpodgorny
> +GH_PROJECT =	uptimed
> +GH_TAGNAME =	v0.4.6
> +
>  CATEGORIES =	sysutils
> -REVISION =	4
>  
>  SHARED_LIBS +=	uptimed                   0.0 # 0.0
>  
> -HOMEPAGE =	https://github.com/rpodgorny/uptimed/
> -
>  MAINTAINER =	Ryan Freeman <ryan@slipgate.org>
>  
>  # GPLv2
> -PERMIT_PACKAGE = Yes
> +PERMIT_PACKAGE=	Yes
>  
>  WANTLIB += c
>  
> -SITES =		http://podgorny.cz/uptimed/releases/
> -EXTRACT_SUFX =	.tar.bz2
> +LOCALSTATEDIR =	${BASELOCALSTATEDIR}/db/uptimed
> +SUBST_VARS +=	LOCALSTATEDIR VARBASE
> +
> +CONFIGURE_STYLE =	autoreconf
> +
> +USE_GMAKE =	Yes
> +
> +AUTORECONF = 	./autogen.sh
> +AUTOCONF_VERSION = 	2.69
> +AUTOMAKE_VERSION =	1.14
> +
> +SEPARATE_BUILD=	Yes
>  
> -CONFIGURE_STYLE = gnu
> +post-patch:
> +	${SUBST_CMD} ${WRKSRC}/libuptimed/urec.h
>  
>  .include <bsd.port.mk>
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/sysutils/uptimed/distinfo,v
> diff -u -p -r1.1.1.1 distinfo
> --- distinfo	18 Jun 2013 05:47:19 -0000	1.1.1.1
> +++ distinfo	17 Oct 2024 09:15:05 -0000
> @@ -1,2 +1,2 @@
> -SHA256 (uptimed-0.3.17.tar.bz2) = UkzomEwNCngKMgJbo/+5gOXuw9eOZc9oyR7ex/6DOgY=
> -SIZE (uptimed-0.3.17.tar.bz2) = 269102
> +SHA256 (uptimed-0.4.6.tar.gz) = SGVkmKwwxZuQLpjcXkEel8u5YnigGUa98JQdjacrKuE=
> +SIZE (uptimed-0.4.6.tar.gz) = 56796
> Index: patches/patch-Makefile_am
> ===================================================================
> RCS file: patches/patch-Makefile_am
> diff -N patches/patch-Makefile_am
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ patches/patch-Makefile_am	17 Oct 2024 09:15:05 -0000
> @@ -0,0 +1,12 @@
> +Index: Makefile.am
> +--- Makefile.am.orig
> ++++ Makefile.am
> +@@ -12,7 +12,7 @@ EXTRA_DIST = CREDITS INSTALL.cgi INSTALL.upgrade READM
> + AM_CFLAGS = @CFLAGS@ -DFILE_CONFIG=\"$(sysconfdir)/uptimed.conf\"
> + 
> + install-data-local:
> +-	$(INSTALL) -d $(DESTDIR)/var/spool/uptimed
> ++	$(INSTALL) -d $(DESTDIR)/${LOCALSTATEDIR}
> + 
> + srpm: dist
> + 	@(rpmbuild -ts uptimed-$(PACKAGE_VERSION).tar.gz)
> Index: patches/patch-libuptimed_urec_h
> ===================================================================
> RCS file: /cvs/ports/sysutils/uptimed/patches/patch-libuptimed_urec_h,v
> diff -u -p -r1.2 patch-libuptimed_urec_h
> --- patches/patch-libuptimed_urec_h	11 Mar 2022 19:58:09 -0000	1.2
> +++ patches/patch-libuptimed_urec_h	17 Oct 2024 09:15:05 -0000
> @@ -1,13 +1,14 @@
> ---- libuptimed/urec.h.orig	Sun Jun 16 17:00:29 2013
> -+++ libuptimed/urec.h	Sun Jun 16 17:00:51 2013
> -@@ -54,8 +54,8 @@ extern void snprintf(char *, ...);
> - 
> - #include "misc.h"
> - 
> +Index: libuptimed/urec.h
> +--- libuptimed/urec.h.orig
> ++++ libuptimed/urec.h
> +@@ -65,8 +65,8 @@ extern void snprintf(char *, ...);
> + #define FILE_BOOTID "/data/uptimed/bootid"
> + #define FILE_RECORDS "/data/uptimed/records"
> + #else
>  -#define FILE_BOOTID "/var/spool/uptimed/bootid"
>  -#define FILE_RECORDS "/var/spool/uptimed/records"
> -+#define FILE_BOOTID "/var/db/uptimed/bootid"
> -+#define FILE_RECORDS "/var/db/uptimed/records"
> ++#define FILE_BOOTID "${LOCALSTATEDIR}/bootid"
> ++#define FILE_RECORDS "${LOCALSTATEDIR}/records"
> + #endif
>   
>   typedef struct urec {
> - 	time_t utime; /* uptime */
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/sysutils/uptimed/pkg/PLIST,v
> diff -u -p -r1.4 PLIST
> --- pkg/PLIST	8 Nov 2022 11:17:13 -0000	1.4
> +++ pkg/PLIST	17 Oct 2024 09:15:05 -0000
> @@ -1,14 +1,13 @@
> -@extraunexec rm -f /var/db/uptimed/*
>  @newgroup _uptimed:717
>  @newuser _uptimed:717:717::Uptimed Account:/nonexistent:/sbin/nologin
> +@extraunexec rm -f ${VARBASE}/db/uptimed/*
> +@rcscript ${RCDIR}/uptimed
>  @bin bin/uprecords
> -lib/libuptimed.a
> +@static-lib lib/libuptimed.a
>  lib/libuptimed.la
>  @lib lib/libuptimed.so.${LIBuptimed_VERSION}
>  @man man/man1/uprecords.1
>  @man man/man8/uptimed.8
>  @bin sbin/uptimed
>  @owner _uptimed
> -@sample /var/db/uptimed/
> -@owner
> -@rcscript ${RCDIR}/uptimed
> +@sample ${VARBASE}/db/uptimed/
> Index: pkg/uptimed.rc
> ===================================================================
> RCS file: /cvs/ports/sysutils/uptimed/pkg/uptimed.rc,v
> diff -u -p -r1.3 uptimed.rc
> --- pkg/uptimed.rc	11 Mar 2022 19:58:09 -0000	1.3
> +++ pkg/uptimed.rc	17 Oct 2024 09:15:05 -0000
> @@ -1,7 +1,7 @@
>  #!/bin/ksh
>  
>  daemon="${TRUEPREFIX}/sbin/uptimed"
> -daemon_flags="-p /var/run/uptimed/uptimed.pid"
> +daemon_flags="-p ${VARBASE}/run/uptimed/uptimed.pid"
>  daemon_user="_uptimed"
>  
>  . /etc/rc.d/rc.subr
> @@ -9,7 +9,7 @@ daemon_user="_uptimed"
>  rc_reload=NO
>  
>  rc_pre() {
> -	install -d -o _uptimed /var/run/uptimed
> +	install -d -o _uptimed ${VARBASE}/run/uptimed
>  }
>  
>  rc_cmd $1