Revision: 70929 http://trac.macports.org/changeset/70929 Author: ryandesign@macports.org Date: 2010-08-26 14:36:46 -0700 (Thu, 26 Aug 2010) Log Message: ----------- sleepwatcher: * update to 2.1, which requires Mac OS X 10.5 or higher * remove server variant; always install launchd plist * use startupitem.executable instead of startupitem.start and startupitem.stop * universal variant is no longer mandatory * add license keyword * use notes See #26236 Modified Paths: -------------- trunk/dports/sysutils/sleepwatcher/Portfile Modified: trunk/dports/sysutils/sleepwatcher/Portfile =================================================================== --- trunk/dports/sysutils/sleepwatcher/Portfile 2010-08-26 20:04:01 UTC (rev 70928) +++ trunk/dports/sysutils/sleepwatcher/Portfile 2010-08-26 21:36:46 UTC (rev 70929) @@ -4,12 +4,13 @@ PortGroup xcode 1.0 name sleepwatcher -version 2.0.5 +version 2.1 categories sysutils maintainers ryandesign +license GPL homepage http://www.bernhard-baehr.de/ master_sites ${homepage} -distname ${name}_${version}_src +distname ${name}_${version} extract.suffix .tgz xcode.destroot.path ${prefix}/sbin @@ -23,43 +24,42 @@ interaction. It also can send the Mac to sleep mode or retrieve the \ time since last user activity. -checksums \ - md5 886fd37f9ae2941e99eb507b312ba236 \ - sha1 4c1ca64d94768e0ccffb085d65632b4e37330882 \ - rmd160 f2b3a362b71a3b31e3c3774122fb282327e5151e +checksums md5 d4ace64e2e978f4f289ca4dddd21c6f2 \ + sha1 54d09ed7a25abd2f2a398bf7f17b0ddc70f1b1d9 \ + rmd160 3bd630072825b5cac54e5a28f9d519827b67bdc4 -post-extract { - reinplace "s|/usr/|${prefix}/|" ${worksrcpath}/sleepwatcher.xcodeproj/project.pbxproj - reinplace "s|man/man1|man/man8|" ${worksrcpath}/sleepwatcher.xcodeproj/project.pbxproj +pre-fetch { + if {${os.major} < 9} { + ui_error "${name} ${version} requires Mac OS X 10.5 or greater." + return -code error "incompatible Mac OS X version" + } } -variant server { - startupitem.create yes - startupitem.start "${prefix}/sbin/sleepwatcher --verbose --daemon --pidfile ${prefix}/var/run/${name}.pid --sleep ${prefix}/etc/rc.sleep --wakeup ${prefix}/etc/rc.wakeup" - startupitem.stop "kill `cat ${prefix}/var/run/${name}.pid`" - - post-destroot { - xinstall -m 755 -d ${prefix}/etc - xinstall -m 755 "${worksrcpath}/SleepWatcher StartupItem.package/packagemaker.files/private/etc/rc.sleep" ${destroot}${prefix}/etc - xinstall -m 755 "${worksrcpath}/SleepWatcher StartupItem.package/packagemaker.files/private/etc/rc.wakeup" ${destroot}${prefix}/etc - } - - post-install { - ui_msg "###########################################################" - ui_msg "# Now each user can create scripts called .sleep and" - ui_msg "# .wakeup in their home directories, and the ${name}" - ui_msg "# daemon will run them at the appropriate times." - ui_msg "###########################################################" - } +build.dir ${worksrcpath}/sources + +post-patch { + reinplace "s|/usr/local/|${prefix}/|" ${build.dir}/sleepwatcher.xcodeproj/project.pbxproj } -default_variants +universal -variant universal {} -pre-fetch { - if {![variant_isset universal]} { - return -code error "${name} is only available in a universal version" - } +post-destroot { + xinstall -m 755 -W ${worksrcpath}/config rc.sleep rc.wakeup ${destroot}${prefix}/etc } +startupitem.create yes +startupitem.executable ${prefix}/sbin/sleepwatcher \ + --verbose \ + --sleep ${prefix}/etc/rc.sleep \ + --wakeup ${prefix}/etc/rc.wakeup + livecheck.type regex livecheck.regex (?i)>${name} (\[0-9.\]+)< + +notes "\ +The included system-wide launchd plist starts a ${name} daemon which calls\ +the scripts \".sleep\" and \".wakeup\" in your home directory when the\ +computer goes to sleep and wakes up, respectively.\ +For more control, and to be able to respond to display sleep, idle, and\ +power manager events, ignore the system-wide launchd plist and write your\ +own user-specific plist.\ +Consult the manpage for the full range of possibilities.\ +"