Thursday, October 17, 2024

[update] sysutils/uptimed 0.4.6

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
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

- 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

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

- update pkg/PLIST after 'make fake'

Build and tests OK on current/amd64.

Tests welcome and please commit if OK.

Laurent

No comments:

Post a Comment