Update of /cvsroot/fink/dists/10.7/stable/main/finkinfo/utils
In directory vz-cvs-3.sog:/tmp/cvs-serv9692

Added Files:
        sleepwatcher.info sleepwatcher.patch 
Log Message:
to 10.7
now with launchd knowledge

--- NEW FILE: sleepwatcher.info ---
Package: sleepwatcher
Version: 2.1.2
Revision: 3
Description: Daemon that monitors sleep and wakeup
License: GPL
Maintainer: None <[email protected]>
Source: http://www.bernhard-baehr.de/%n_%v.tgz
Source-MD5: 1a3e38e2a18691450fbd59baa67a4f5b
SourceDirectory: %n_%v
PatchFile: %n.patch
PatchFile-MD5: a83170a0e8dda8a4ab88edf197e148e6
#DaemonicFile: %n.xml
Homepage: http://www.bernhard-baehr.de/

BuildDepends: fink (>= 0.24.12) 
Depends: <<
        daemonic (>= 20010902-1)
<<

DocFiles: ReadMe.rtf
PatchScript: <<
#!/bin/sh -ev

case %m in
  i386) ARCH=X86;;
  x86_64) ARCH=X86_64;;
  powerpc) ARCH=PPC;;
  *) echo "Architecture not recognized.  Exiting" ; exit -1;;
esac

sed -e "s,@ARCH@,$ARCH," -e "s,@PREFIX@,%i,"  < %{PatchFile} | patch -p1
<<

CompileScript: make -C sources sleepwatcher

InstallScript:<<
make -C sources install
mkdir -p %i/etc
install -m 755 config/rc.sleep %i/etc/
install -m 755 config/rc.wakeup %i/etc/
mkdir -p %i/opt/Library/LaunchDaemons
install -m 644 config/de.bernhard-baehr.sleepwatcher* 
%i/opt/Library/LaunchDaemons
<<

DaemonicFile: <<
<service>
  <description>%n %v</description>
  <message>%n %v</message>

  <daemon name="%n">
    <executable background="yes">%p/sbin/%n</executable>
    <parameters>-d -V -s %p/etc/rc.sleep -w %p/etc/rc.wakeup -p 
%p/var/run/sleepwatcher.pid</parameters>
    <pidfile>%p/var/run/%n.pid</pidfile>
  </daemon>
</service>

<<

PreRmScript: <<
if [ $1 != "upgrade" ]; then
  daemonic remove %N
fi
#rm -r /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist
<<

PostInstScript: <<
chown root:wheel %p/sbin/%n %p/etc/rc.sleep %p/etc/rc.wakeup
daemonic install %N
#cp -p 
%p/opt/Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher-20compatibility.plist
 /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist 
<<

DescUsage: <<
You can run 'sudo daemonic enable %N' as root to create a StartupItem for it.
If run as daemon all users can create two executable scripts ~/.wakeup and
~/.sleep, that will be executed when the computers wakes up or sleeps,
accordingly.

Can be modified to install a systemwide launchd config file to 
/Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist
that looks for %p/etc/rc.wakeup and %p/etc/rc.wakeup on startup.

If you wish to give users individual control with launchd, follow 
the directions in %p/share/doc/%n/ReadMe.rtf.
<<

DescDetail: <<
SleepWatcher is a command line tool (daemon) for Mac OS X 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 or after a
given time without user interaction. It also can send the Mac to sleep mode or
retrieve the time since last user activity.
<<

DescPort: <<
Initial port by Pepe Barbe <[email protected]>
nieder: Moved all chown commands outside of the Makefile and InstallScript to 
allow building as 'nobody'.

>From version 2.1.2, can use launchd instead of the default daemonic.
<<

--- NEW FILE: sleepwatcher.patch ---
diff -urN sleepwatcher_2.0.5_src/sources/Makefile 
sleepwatcher_2.0.5_src.new/sources/Makefile
--- sleepwatcher_2.0.5_src/sources/Makefile     2007-11-02 08:40:21.000000000 
-0500
+++ sleepwatcher_2.0.5_src.new/sources/Makefile 2008-02-06 20:23:03.000000000 
-0600
@@ -8,22 +8,20 @@
 
 CFLAGS_PPC= -O3 -prebind -mmacosx-version-min=10.4 -mtune=G4 -arch ppc
 CFLAGS_X86= -O3 -prebind -mmacosx-version-min=10.4 -mtune=pentium -arch i386
+CFLAGS_X86_64 = -O3 -prebind -mmacosx-version-min=10.7 -arch x86_64
 LIBS= -framework IOKit -framework CoreFoundation
 
-BINDIR=/usr/local/sbin
-MANDIR=/usr/local/man
+BINDIR=@PREFIX@/sbin
+MANDIR=@PREFIX@/share/man
 
 sleepwatcher: sleepwatcher.c
-       $(CC) $(CFLAGS_PPC) -o sleepwatcher.ppc sleepwatcher.c $(LIBS)
-       $(CC) $(CFLAGS_X86) -o sleepwatcher.x86 sleepwatcher.c $(LIBS)
-       lipo -create sleepwatcher.ppc sleepwatcher.x86 -output sleepwatcher
-       rm -f sleepwatcher.ppc sleepwatcher.x86
+       $(CC) $(CFLAGS_@ARCH@) -o sleepwatcher sleepwatcher.c $(LIBS)
 
-install: sleepwatcher sleepwatcher.8
+install: sleepwatcher
        mkdir -p $(BINDIR)
-       install -o root -g wheel -m 755 sleepwatcher $(BINDIR)
+       install -m 755 sleepwatcher $(BINDIR)
        mkdir -p $(MANDIR)/man8
-       install -o root -g wheel -m 644 sleepwatcher.8 $(MANDIR)/man8
+       install -m 644 ../sleepwatcher.8 $(MANDIR)/man8
 
 clean:
        rm -f sleepwatcher
diff -ruN 
sleepwatcher_2.1.2/config-orig/de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist
 
sleepwatcher_2.1.2/config/de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist
--- 
sleepwatcher_2.1.2/config-orig/de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist
       2011-08-27 11:20:49.000000000 -0400
+++ 
sleepwatcher_2.1.2/config/de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist
    2011-08-27 11:21:06.000000000 -0400
@@ -6,7 +6,7 @@
        <string>de.bernhard-baehr.sleepwatcher</string>
        <key>ProgramArguments</key>
        <array>
-               <string>/usr/local/sbin/sleepwatcher</string>
+               <string>@PREFIX@/sbin/sleepwatcher</string>
                <string>-V</string>
                <string>-s ~/.sleep</string>
                <string>-w ~/.wakeup</string>
diff -ruN 
sleepwatcher_2.1.2/config-orig/de.bernhard-baehr.sleepwatcher-20compatibility.plist
 sleepwatcher_2.1.2/config/de.bernhard-baehr.sleepwatcher-20compatibility.plist
--- 
sleepwatcher_2.1.2/config-orig/de.bernhard-baehr.sleepwatcher-20compatibility.plist
 2011-08-27 11:20:47.000000000 -0400
+++ 
sleepwatcher_2.1.2/config/de.bernhard-baehr.sleepwatcher-20compatibility.plist  
    2011-08-27 11:21:09.000000000 -0400
@@ -6,10 +6,10 @@
        <string>de.bernhard-baehr.sleepwatcher</string>
        <key>ProgramArguments</key>
        <array>
-               <string>/usr/local/sbin/sleepwatcher</string>
+               <string>@PREFIX@/sbin/sleepwatcher</string>
                <string>-V</string>
-               <string>-s /etc/rc.sleep</string>
-               <string>-w /etc/rc.wakeup</string>
+               <string>-s @PREFIX@/etc/rc.sleep</string>
+               <string>-w @PREFIX@/etc/rc.wakeup</string>
        </array>
        <key>RunAtLoad</key>
        <true/>


------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Fink-commits mailing list
[email protected]
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to