Saturday, September 03, 2022

Re: obsdfreqd port tweak

On Sat, Sep 03, 2022 at 03:36:08PM +0100, Stuart Henderson wrote:
> obsdfreqd currently installs an rc.d script that is bundled inside
> the distfile.
>
> I think generally we want to have those in the ports tree
> directly because from time to time when changes are made to rc.subr
> we need to adapt the scripts, so here's a diff to stop using the
> bundled one and add in pkg/ instead.
>
> The file itself is changed slightly, the existing one has pexp="${daemon}.*"
> which is not needed.

Agreed; see below.

>
> OK?
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/sysutils/obsdfreqd/Makefile,v
> retrieving revision 1.4
> diff -u -p -r1.4 Makefile
> --- Makefile 3 Sep 2022 11:18:39 -0000 1.4
> +++ Makefile 3 Sep 2022 14:33:08 -0000
> @@ -1,6 +1,6 @@
> COMMENT = userland daemon to manage CPU frequency
> V = 1.0.1
> -REVISION = 1
> +REVISION = 2
> DISTNAME = obsdfreqd-${V}
>
> CATEGORIES = sysutils
> Index: patches/patch-Makefile
> ===================================================================
> RCS file: patches/patch-Makefile
> diff -N patches/patch-Makefile
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-Makefile 3 Sep 2022 14:33:08 -0000
> @@ -0,0 +1,9 @@
> +Index: Makefile
> +--- Makefile.orig
> ++++ Makefile
> +@@ -16,5 +16,4 @@ clean:
> +
> + install: obsdfreqd
> + install -o root -g wheel -m 555 obsdfreqd ${PREFIX}/sbin/obsdfreqd
> +- install -o root -g wheel -m 555 obsdfreqd.rc ${DESTDIR}/etc/rc.d/obsdfreqd
> + install -o root -g wheel -m 444 obsdfreqd.1 ${PREFIX}/man/man1/obsdfreqd.1

I think you can do with a simpler do-install until upstream removes
the .rc script (handling).

Diff for that at the end (no PLIST change).

Feel free to commit either with OK kn.

> Index: pkg/obsdfreqd.rc
> ===================================================================
> RCS file: pkg/obsdfreqd.rc
> diff -N pkg/obsdfreqd.rc
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ pkg/obsdfreqd.rc 3 Sep 2022 14:33:08 -0000
> @@ -0,0 +1,10 @@
> +#!/bin/ksh
> +
> +daemon="${TRUEPREFIX}/sbin/obsdfreqd"
> +
> +. /etc/rc.d/rc.subr
> +
> +rc_reload=NO
> +rc_bg=YES
> +
> +rc_cmd $1
>

Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/obsdfreqd/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- Makefile 3 Sep 2022 11:18:39 -0000 1.4
+++ Makefile 3 Sep 2022 14:43:29 -0000
@@ -1,6 +1,6 @@
COMMENT = userland daemon to manage CPU frequency
V = 1.0.1
-REVISION = 1
+REVISION = 2
DISTNAME = obsdfreqd-${V}

CATEGORIES = sysutils
@@ -20,5 +20,9 @@ MASTER_SITES = https://tildegit.org/sol
DISTFILES = obsdfreqd-{}${V}${EXTRACT_SUFX}
WRKDIST = ${WRKDIR}/obsdfreqd
NO_TEST = Yes
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKBUILD}/obsdfreqd ${PREFIX}/sbin/
+ ${INSTALL_MAN} ${WRKBUILD}/obsdfreqd.1 ${PREFIX}/man/man1/

.include <bsd.port.mk>
Index: pkg/obsdfreqd.rc
===================================================================
RCS file: pkg/obsdfreqd.rc
diff -N pkg/obsdfreqd.rc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/obsdfreqd.rc 3 Sep 2022 14:39:56 -0000
@@ -0,0 +1,10 @@
+#!/bin/ksh
+
+daemon="/usr/local/sbin/obsdfreqd"
+
+. /etc/rc.d/rc.subr
+
+rc_reload=NO
+rc_bg=YES
+
+rc_cmd $1

No comments:

Post a Comment