[66784] trunk/dports/kde/kmymoney

takanori at macports.org takanori at macports.org
Thu Apr 22 16:50:44 PDT 2010


Revision: 66784
          http://trac.macports.org/changeset/66784
Author:   takanori at macports.org
Date:     2010-04-22 16:50:41 -0700 (Thu, 22 Apr 2010)
Log Message:
-----------
kmymoney: add a starter .app for easy use (#24433)

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

Added Paths:
-----------
    trunk/dports/kde/kmymoney/files/
    trunk/dports/kde/kmymoney/files/KMyMoney.applescript
    trunk/dports/kde/kmymoney/files/applet.icns

Modified: trunk/dports/kde/kmymoney/Portfile
===================================================================
--- trunk/dports/kde/kmymoney/Portfile	2010-04-22 23:25:35 UTC (rev 66783)
+++ trunk/dports/kde/kmymoney/Portfile	2010-04-22 23:50:41 UTC (rev 66784)
@@ -4,9 +4,10 @@
 
 name              kmymoney
 version           1.0.4
+revision          5
 
 categories        kde finance
-maintainers       techno.ms:mk-macports
+maintainers       techno.ms:mk-macports pixilla.com:brad
 platforms         darwin
 
 description       a personal finance manager
@@ -17,7 +18,11 @@
                   QIF import/export, multiple currencies and initial online \
                   banking support. \
                   Released under the GNU General Public License. \
-                  KMyMoney is free software.
+                  KMyMoney is free software. \
+                  \
+                  NB: This port contains a starter .app which is located in \
+                  Applications/MacPorts and ensures that permissions of .kde \
+                  directory are set properly to run kmymoney.
 
 homepage          http://kmymoney2.sourceforge.net/index-home.html
 master_sites      sourceforge:kmymoney2
@@ -37,7 +42,7 @@
 configure.ldflags-append   "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
 configure.env     MKDIR_P="mkdir -p" \
                   QTDIR=${prefix}/lib/qt3 \
-                  HOME=${workpath}
+                  HOME=${worksrcpath}
 configure.args    --with-qt-dir=${prefix}/lib/qt3 \
                   --without-arts \
                   --enable-mac \
@@ -50,6 +55,13 @@
 
 post-configure {
     ln -sf ${prefix}/bin/glibtool ${worksrcpath}/libtool
+    system "cp ${filespath}/KMyMoney.applescript ${worksrcpath}"
+    reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/KMyMoney.applescript
 }
 
-build.env         HOME=${workpath}
+build.env         HOME=${worksrcpath}
+
+post-destroot {
+    system "osacompile -o ${destroot}/Applications/MacPorts/KMyMoney.app ${worksrcpath}/KMyMoney.applescript"
+    system "cp ${filespath}/applet.icns ${destroot}/Applications/MacPorts/KMyMoney.app/Contents/Resources/"
+}

Added: trunk/dports/kde/kmymoney/files/KMyMoney.applescript
===================================================================
--- trunk/dports/kde/kmymoney/files/KMyMoney.applescript	                        (rev 0)
+++ trunk/dports/kde/kmymoney/files/KMyMoney.applescript	2010-04-22 23:50:41 UTC (rev 66784)
@@ -0,0 +1,107 @@
+#---------------------------------------------------------------------------------------------------
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+#---------------------------------------------------------------------------------------------------
+#
+# GPL-licensed icons included in applet.icns are courtesy of KMyMoney's developers!
+#
+#---------------------------------------------------------------------------------------------------
+#
+# Authors:
+#  - Brad Giesbrecht <brad at pixilla.com>
+#  - Marko K"aning <MK-MacPorts at techno.ms>
+#
+########################################################
+
+try
+	
+	set userID to do shell script "stat -f '%Su' $HOME"
+	
+end try
+
+set executable to "__PREFIX__/bin/kmymoney" as string
+set kmymoney to (POSIX file executable)
+
+try
+	
+	get alias kmymoney
+	
+on error
+	
+	display alert "There was an error locating KMyMoney's executable." & return & return & "Try 'port installed kmymoney' to verify that port 'kmymoney' is installed." & return & return & "The file we tried to find was:" & return & return & "'" & executable & "'" as warning
+	return
+	
+end try
+
+set command to ""
+
+set kdedirID to ""
+set ICEauthorityID to ""
+set XauthorityID to ""
+
+set kdeDir to (POSIX path of (path to home folder) & ".kde/" as string)
+set ICEauthority to (POSIX path of (path to home folder) & ".ICEauthority" as string)
+set Xauthority to (POSIX path of (path to home folder) & ".Xauthority" as string)
+
+set kdeDirMessage to ""
+
+try
+	
+	POSIX file kdeDir as alias
+	set kdedirID to do shell script "stat -f '%Su' $HOME/.kde"
+	
+end try
+
+try
+	
+	POSIX file ICEauthority as alias
+	set ICEauthorityID to do shell script "stat -f '%Su' $HOME/.ICEauthority"
+	
+end try
+
+try
+	
+	POSIX file Xauthority as alias
+	set XauthorityID to do shell script "stat -f '%Su' $HOME/.Xauthority"
+	
+end try
+
+if ((not kdedirID is equal to "") and not kdedirID = userID) or not ICEauthorityID = userID or not XauthorityID = userID then
+	
+	if (not kdedirID is equal to "") then set kdeDirMessage to (kdeDir & return & " is owned by " & kdedirID & return & return)
+	
+	set fixPermissions to button returned of (display dialog (kdeDirMessage & ICEauthority & return & " is owned by " & ICEauthorityID & return & return & Xauthority & return & " is owned by " & XauthorityID & return & return & "They should be owned by " & userID & " for KMyMoney to run properly!") buttons {"Cancel", "Fix"} default button {"Fix"} with icon 2)
+	
+	if fixPermissions = "Fix" then
+		
+		if (not kdedirID is equal to "") then do shell script "chown -R " & userID & " " & kdeDir with administrator privileges
+		do shell script "chown " & userID & " " & ICEauthority with administrator privileges
+		do shell script "chown " & userID & " " & Xauthority with administrator privileges
+		
+	end if
+	
+end if
+
+set command to "sh -l -c " & (POSIX path of kmymoney) & " > /dev/null 2>&1"
+
+try
+	
+	do shell script command
+	
+on error
+	
+	display alert "There was an error launching KMyMoney." & return & return & "Try 'port installed kmymoney' to verify that port 'kmymoney' is installed." & return & return & "The command we tried to execute was:" & return & return & "'" & command & "'" as warning
+	
+end try

Added: trunk/dports/kde/kmymoney/files/applet.icns
===================================================================
(Binary files differ)


Property changes on: trunk/dports/kde/kmymoney/files/applet.icns
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100422/b5b8cc29/attachment-0001.html>


More information about the macports-changes mailing list