[99050] trunk/dports/kde/kdelibs4

nicos at macports.org nicos at macports.org
Wed Oct 24 19:56:54 PDT 2012


Revision: 99050
          http://trac.macports.org//changeset/99050
Author:   nicos at macports.org
Date:     2012-10-24 19:56:54 -0700 (Wed, 24 Oct 2012)
Log Message:
-----------
kdelibs4: adding agent for automatic refreshment of cache (ticket #36552, maintainer timeout)

Modified Paths:
--------------
    trunk/dports/kde/kdelibs4/Portfile

Added Paths:
-----------
    trunk/dports/kde/kdelibs4/files/org.macports.kdecache.plist

Modified: trunk/dports/kde/kdelibs4/Portfile
===================================================================
--- trunk/dports/kde/kdelibs4/Portfile	2012-10-25 02:34:50 UTC (rev 99049)
+++ trunk/dports/kde/kdelibs4/Portfile	2012-10-25 02:56:54 UTC (rev 99050)
@@ -76,6 +76,8 @@
 "
 }
 
+set startup_root ""
+
 pre-activate {
     if {![catch {set vers [lindex [registry_active kde4-runtime] 0]}]
         && [vercmp [lindex $vers 1] 4.8.1] < 0} {
@@ -91,7 +93,43 @@
     xinstall -d ${destroot}${prefix}/include/nepomuk
     eval xinstall -m 644 [glob ${worksrcpath}/nepomuk/core/*.h] \
         ${destroot}${prefix}/include/nepomuk
+    
+    xinstall -d -m 755 ${destroot}${prefix}/Library/LaunchAgents
+    xinstall -m 644 ${filespath}/org.macports.kdecache.plist \
+        ${destroot}${prefix}/Library/LaunchAgents
+    reinplace "s|%PREFIX%|${prefix}|g" \
+        ${destroot}${prefix}/Library/LaunchAgents/org.macports.kdecache.plist
+    reinplace "s|%APPLICATIONS_DIR%|${applications_dir}|g" \
+        ${destroot}${prefix}/Library/LaunchAgents/org.macports.kdecache.plist
+    
+    xinstall -d -m 755 ${destroot}${startup_root}/Library/LaunchAgents
+    ln -s ${prefix}/Library/LaunchAgents/org.macports.kdecache.plist ${destroot}${startup_root}/Library/LaunchAgents
 }
 
+post-activate {
+    if { ![variant_isset no_root] } {
+        file attributes ${prefix}/Library/LaunchAgents/org.macports.kdecache.plist -owner root -group wheel 
+    }
+}
+
+notes " ##########################################################################
+ # An agent to provide communication between KDE programs must be started.
+ # To start it run the following command:
+ # launchctl load -w ${startup_root}/Library/LaunchAgents/org.macports.kdecache.plist
+ ##########################################################################"
+
+variant no_root description {Run the kde case agent as MacPorts install user.} {
+    pre-fetch {
+        if { ${install.user}=="root" || ${install.group}=="wheel" } {
+            ui_error "The kde cache agent should not be run as root with no_root variant."
+            error "Please do not use this variant with your MacPorts configuration."
+        }
+    }
+
+    set startup_root  [join [lrange [exec /usr/bin/dscl . -read Users/${install.user} NFSHomeDirectory] 1 end]]
+    # Files are installed into user's startup directory.
+    destroot.violate_mtree  yes
+}
+
 livecheck.url       http://kde.mirrors.hoobly.com/stable/latest/src/
 livecheck.regex     kdelibs-(\\d+\\.\\d+\\.\\d+)

Added: trunk/dports/kde/kdelibs4/files/org.macports.kdecache.plist
===================================================================
--- trunk/dports/kde/kdelibs4/files/org.macports.kdecache.plist	                        (rev 0)
+++ trunk/dports/kde/kdelibs4/files/org.macports.kdecache.plist	2012-10-25 02:56:54 UTC (rev 99050)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>Label</key>
+        <string>org.macports.kdecache</string>
+    <key>ProgramArguments</key>
+        <array>
+            <string>%PREFIX%/bin/kbuildsycoca4</string>
+        </array>
+    <key>RunAtLoad</key>
+        <true/>
+    <key>WatchPaths</key>
+        <array>
+            <string>%PREFIX%/bin</string>
+            <string>%APPLICATIONS_DIR%/KDE4</string>
+        </array>
+    <key>ThrottleInterval</key>
+        <integer>60</integer>
+    <key>Disabled</key>
+        <true/>
+</dict>
+</plist>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20121024/0947297d/attachment.html>


More information about the macports-changes mailing list