pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/sysutils/sleepwatcher
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.
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@localhost
+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
Home |
Main Index |
Thread Index |
Old Index