| 1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
|---|
| 2 | # $Id$ |
|---|
| 3 | |
|---|
| 4 | PortSystem 1.0 |
|---|
| 5 | PortGroup xcode 1.0 |
|---|
| 6 | |
|---|
| 7 | name sleepwatcher |
|---|
| 8 | version 2.2 |
|---|
| 9 | categories sysutils |
|---|
| 10 | maintainers ryandesign |
|---|
| 11 | license GPL-3+ |
|---|
| 12 | homepage http://www.bernhard-baehr.de/ |
|---|
| 13 | master_sites ${homepage} |
|---|
| 14 | distname ${name}_${version} |
|---|
| 15 | extract.suffix .tgz |
|---|
| 16 | xcode.destroot.path ${prefix}/sbin |
|---|
| 17 | |
|---|
| 18 | description monitors sleep, wakeup and idleness of a Mac |
|---|
| 19 | |
|---|
| 20 | long_description SleepWatcher monitors sleep, wakeup and idleness of \ |
|---|
| 21 | a Mac. It can be used to execute a Unix command \ |
|---|
| 22 | when the Mac or the display of the Mac goes to sleep \ |
|---|
| 23 | mode or wakes up or after a given time without user \ |
|---|
| 24 | interaction. It also can send the Mac to sleep mode \ |
|---|
| 25 | or retrieve the time since last user activity. |
|---|
| 26 | |
|---|
| 27 | checksums rmd160 4e1ff469e59ae992ee297cb16a96a74e9993d4bb \ |
|---|
| 28 | sha256 c04ac1c49e2b5785ed5d5c375854c9c0b9e959affa46adab57985e4123e8b6be |
|---|
| 29 | |
|---|
| 30 | pre-fetch { |
|---|
| 31 | if {${os.major} < 9} { |
|---|
| 32 | ui_error "${name} ${version} requires Mac OS X 10.5 or greater." |
|---|
| 33 | return -code error "incompatible Mac OS X version" |
|---|
| 34 | } |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | build.dir ${worksrcpath}/sources |
|---|
| 38 | |
|---|
| 39 | post-patch { |
|---|
| 40 | reinplace "s|/usr/local/|${prefix}/|" ${build.dir}/sleepwatcher.xcodeproj/project.pbxproj |
|---|
| 41 | } |
|---|
| 42 | |
|---|
| 43 | post-destroot { |
|---|
| 44 | xinstall -m 755 -W ${worksrcpath}/config rc.sleep rc.wakeup ${destroot}${prefix}/etc |
|---|
| 45 | set docdir ${destroot}${prefix}/share/doc/${name} |
|---|
| 46 | xinstall -d ${docdir} |
|---|
| 47 | xinstall -m 644 -W ${worksrcpath} ReadMe.rtf ${docdir} |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | startupitem.create yes |
|---|
| 51 | startupitem.executable ${prefix}/sbin/sleepwatcher \ |
|---|
| 52 | --verbose \ |
|---|
| 53 | --sleep ${prefix}/etc/rc.sleep \ |
|---|
| 54 | --wakeup ${prefix}/etc/rc.wakeup |
|---|
| 55 | |
|---|
| 56 | livecheck.type regex |
|---|
| 57 | livecheck.regex (?i)>${name} (\[0-9.\]+)< |
|---|
| 58 | |
|---|
| 59 | notes "\ |
|---|
| 60 | The included system-wide launchd plist starts a ${name} daemon which calls\ |
|---|
| 61 | the scripts \".sleep\" and \".wakeup\" in your home directory when the\ |
|---|
| 62 | computer goes to sleep and wakes up, respectively.\ |
|---|
| 63 | For more control, and to be able to respond to display sleep, idle, and\ |
|---|
| 64 | power manager events, ignore the system-wide launchd plist and write your\ |
|---|
| 65 | own user-specific plist.\ |
|---|
| 66 | Consult the manpage for the full range of possibilities.\ |
|---|
| 67 | " |
|---|