Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified)) by mollari.NetBSD.org (Postfix) with ESMTPS id 07C521A9239 for ; Wed, 5 Jan 2022 10:56:02 +0000 (UTC) Received: by mail.netbsd.org (Postfix, from userid 605) id A430B84E60; Wed, 5 Jan 2022 10:56:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id DD2B084DBF for ; Wed, 5 Jan 2022 10:56:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id xkixlaHLSVoB for ; Wed, 5 Jan 2022 10:56:01 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 14CE784CE2 for ; Wed, 5 Jan 2022 10:56:01 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id E0C10FAEC; Wed, 5 Jan 2022 10:56:00 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1641380160178210" MIME-Version: 1.0 Date: Wed, 5 Jan 2022 10:56:00 +0000 From: "Amitai Schleier" Subject: CVS commit: pkgsrc/sysutils/sleepwatcher To: pkgsrc-changes@NetBSD.org Reply-To: schmonz@netbsd.org X-Mailer: log_accum Message-Id: <20220105105600.E0C10FAEC@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1641380160178210 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: schmonz Date: Wed Jan 5 10:56:00 UTC 2022 Added Files: pkgsrc/sysutils/sleepwatcher: DESCR Makefile PLIST distinfo pkgsrc/sysutils/sleepwatcher/files: sleepwatcher.sh pkgsrc/sysutils/sleepwatcher/patches: patch-sources_Makefile Log Message: Add sleepwatcher, a daemon that runs a Unix command on various macOS sleep or wake events. SleepWatcher is a daemon for macOS that monitors sleep, wakeup and idleness of a Mac. It can be used to execute a Unix command when the Mac or the display of the Mac goes to sleep mode or wakes up, after a given time without user interaction or when the user resumes activity after a break or when the power supply of a Mac notebook is attached or detached. It also can send the Mac to sleep mode or retrieve the time since last user activity. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/sleepwatcher/DESCR \ pkgsrc/sysutils/sleepwatcher/Makefile pkgsrc/sysutils/sleepwatcher/PLIST \ pkgsrc/sysutils/sleepwatcher/distinfo cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/sleepwatcher/files/sleepwatcher.sh cvs rdiff -u -r0 -r1.1 \ pkgsrc/sysutils/sleepwatcher/patches/patch-sources_Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1641380160178210 Content-Disposition: inline Content-Length: 5264 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Added files: Index: pkgsrc/sysutils/sleepwatcher/DESCR diff -u /dev/null pkgsrc/sysutils/sleepwatcher/DESCR:1.1 --- /dev/null Wed Jan 5 10:56:00 2022 +++ pkgsrc/sysutils/sleepwatcher/DESCR Wed Jan 5 10:56:00 2022 @@ -0,0 +1,7 @@ +SleepWatcher is a daemon for macOS that monitors sleep, wakeup and +idleness of a Mac. It can be used to execute a Unix command when the Mac +or the display of the Mac goes to sleep mode or wakes up, after a given +time without user interaction or when the user resumes activity after a +break or when the power supply of a Mac notebook is attached or +detached. It also can send the Mac to sleep mode or retrieve the time +since last user activity. Index: pkgsrc/sysutils/sleepwatcher/Makefile diff -u /dev/null pkgsrc/sysutils/sleepwatcher/Makefile:1.1 --- /dev/null Wed Jan 5 10:56:00 2022 +++ pkgsrc/sysutils/sleepwatcher/Makefile Wed Jan 5 10:56:00 2022 @@ -0,0 +1,31 @@ +# $NetBSD: Makefile,v 1.1 2022/01/05 10:56:00 schmonz Exp $ + +DISTNAME= sleepwatcher_2.2.1 +PKGNAME= ${DISTNAME:S/_/-/} +CATEGORIES= sysutils +MASTER_SITES= ${HOMEPAGE} +EXTRACT_SUFX= .tgz + +MAINTAINER= schmonz@NetBSD.org +HOMEPAGE= https://www.bernhard-baehr.de/ +COMMENT= Run a Unix command on macOS sleep or wake events +LICENSE= gnu-gpl-v3 + +ONLY_FOR_PLATFORM= Darwin-*-* + +BUILD_DIRS= sources +BUILD_TARGET= ${PKGBASE} + +RCD_SCRIPTS= sleepwatcher + +REPLACE_SH+= config/rc.sleep config/rc.wakeup + +post-extract: + cd ${WRKSRC} && rm -f sleepwatcher && mv sleepwatcher.8 sources + +post-install: + cd ${WRKSRC}/config && \ + ${INSTALL_SCRIPT} rc.sleep ${DESTDIR}${PREFIX}/sbin/sleepwatcher-sleep && \ + ${INSTALL_SCRIPT} rc.wakeup ${DESTDIR}${PREFIX}/sbin/sleepwatcher-wakeup + +.include "../../mk/bsd.pkg.mk" Index: pkgsrc/sysutils/sleepwatcher/PLIST diff -u /dev/null pkgsrc/sysutils/sleepwatcher/PLIST:1.1 --- /dev/null Wed Jan 5 10:56:00 2022 +++ pkgsrc/sysutils/sleepwatcher/PLIST Wed Jan 5 10:56:00 2022 @@ -0,0 +1,5 @@ +@comment $NetBSD: PLIST,v 1.1 2022/01/05 10:56:00 schmonz Exp $ +man/man8/sleepwatcher.8 +sbin/sleepwatcher +sbin/sleepwatcher-sleep +sbin/sleepwatcher-wakeup Index: pkgsrc/sysutils/sleepwatcher/distinfo diff -u /dev/null pkgsrc/sysutils/sleepwatcher/distinfo:1.1 --- /dev/null Wed Jan 5 10:56:00 2022 +++ pkgsrc/sysutils/sleepwatcher/distinfo Wed Jan 5 10:56:00 2022 @@ -0,0 +1,6 @@ +$NetBSD: distinfo,v 1.1 2022/01/05 10:56:00 schmonz Exp $ + +BLAKE2s (sleepwatcher_2.2.1.tgz) = e795e940b4cd190c12470213a0120aefc5bd57fe197596f8f70567fdb030e86c +SHA512 (sleepwatcher_2.2.1.tgz) = 3f041f9259c31d11222166069ef53d6a6c13261635c1a47ea4dc2f105564f27d6c471379149f93097b52b0e051a4927ee19a957ba47d5501057e08c1a32c5375 +Size (sleepwatcher_2.2.1.tgz) = 42659 bytes +SHA1 (patch-sources_Makefile) = 42ba11cbaeeb12d6a004c693c577ddba8a16e96f Index: pkgsrc/sysutils/sleepwatcher/files/sleepwatcher.sh diff -u /dev/null pkgsrc/sysutils/sleepwatcher/files/sleepwatcher.sh:1.1 --- /dev/null Wed Jan 5 10:56:00 2022 +++ pkgsrc/sysutils/sleepwatcher/files/sleepwatcher.sh Wed Jan 5 10:56:00 2022 @@ -0,0 +1,16 @@ +#!@RCD_SCRIPTS_SHELL@ +# +# $NetBSD: sleepwatcher.sh,v 1.1 2022/01/05 10:56:00 schmonz Exp $ +# +# PROVIDE: sleepwatcher +# REQUIRE: LOGIN + +. /etc/rc.subr + +name="sleepwatcher" +rcvar=$name +command="@PREFIX@/sbin/${name}" +command_args="-d -V -s @PREFIX@/sbin/sleepwatcher-sleep -w @PREFIX@/sbin/sleepwatcher-wakeup" + +load_rc_config $name +run_rc_command $1 Index: pkgsrc/sysutils/sleepwatcher/patches/patch-sources_Makefile diff -u /dev/null pkgsrc/sysutils/sleepwatcher/patches/patch-sources_Makefile:1.1 --- /dev/null Wed Jan 5 10:56:00 2022 +++ pkgsrc/sysutils/sleepwatcher/patches/patch-sources_Makefile Wed Jan 5 10:56:00 2022 @@ -0,0 +1,39 @@ +$NetBSD: patch-sources_Makefile,v 1.1 2022/01/05 10:56:00 schmonz Exp $ + +Build for the host architecture only. Support DESTDIR and PREFIX. + +--- sources/Makefile.orig 2018-12-26 09:31:52.000000000 +0000 ++++ sources/Makefile +@@ -18,14 +18,11 @@ CFLAGS_I386= -O3 -prebind -mmacosx-versi + CFLAGS_X86_64= -O3 -prebind -mmacosx-version-min=10.4 -arch x86_64 + LIBS= -framework IOKit -framework CoreFoundation + +-BINDIR=/usr/local/sbin +-MANDIR=/usr/local/man ++BINDIR=$(PREFIX)/sbin ++MANDIR=$(PREFIX)/$(PKGMANDIR) + + sleepwatcher: sleepwatcher.c +- $(CC) $(CFLAGS_I386) -o sleepwatcher.i386 sleepwatcher.c $(LIBS) +- $(CC) $(CFLAGS_X86_64) -o sleepwatcher.x86_64 sleepwatcher.c $(LIBS) +- lipo -create sleepwatcher.i386 sleepwatcher.x86_64 -output sleepwatcher +- rm sleepwatcher.i386 sleepwatcher.x86_64 ++ $(CC) $(CFLAGS) -o sleepwatcher sleepwatcher.c $(LIBS) + + fat: sleepwatcher sleepwatcher.ppc + lipo -create sleepwatcher sleepwatcher.ppc -output sleepwatcher.fat +@@ -36,10 +33,10 @@ sleepwatcher.ppc: sleepwatcher.c + $(CC) $(CFLAGS_PPC) -o sleepwatcher.ppc sleepwatcher.c $(LIBS) + + install: sleepwatcher sleepwatcher.8 +- mkdir -p $(BINDIR) +- install -o root -g wheel -m 755 sleepwatcher $(BINDIR) +- mkdir -p $(MANDIR)/man8 +- install -o root -g wheel -m 644 sleepwatcher.8 $(MANDIR)/man8 ++ mkdir -p $(DESTDIR)$(BINDIR) ++ $(BSD_INSTALL_PROGRAM) sleepwatcher $(DESTDIR)$(BINDIR) ++ mkdir -p $(DESTDIR)$(MANDIR)/man8 ++ $(BSD_INSTALL_MAN) sleepwatcher.8 $(DESTDIR)$(MANDIR)/man8 + + clean: + rm -f sleepwatcher --_----------=_1641380160178210--