# $Id: Portfile 26023 2007-06-09 08:44:53Z ryandesign@macports.org $ PortSystem 1.0 PortGroup xcode 1.0 name sleepwatcher version 2.0.4 revision 2 categories sysutils maintainers ryandesign homepage http://www.bernhard-baehr.de/ master_sites ${homepage} distname ${name}_${version}_src extract.suffix .tgz xcode.destroot.path ${prefix}/sbin description \ monitors sleep, wakeup and idleness of a Mac long_description \ SleepWatcher 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. checksums \ md5 03756e4f5c61d384ed0c1b05144d0c32 \ sha1 ec088be2bb727432109751b828df5d50369bca3e \ rmd160 c345ba739caaa94b093da4c27a20445c16b29bfb post-extract { reinplace "s|/usr/|${prefix}/|" ${worksrcpath}/sleepwatcher.xcodeproj/project.pbxproj } 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 "###########################################################" } } # SleepWatcher always builds universal, so let's advertise that. default_variants +universal variant universal {} livecheck.check regex livecheck.regex ${name}_(\[0-9\.\]+)\.dmg