Ticket #24433: kmymoney_1.0.4_1_takanori_2.diff

File kmymoney_1.0.4_1_takanori_2.diff, 6.7 KB (added by takanori@…, 14 years ago)

Here is a diff file. Just in case.

  • files/main.applescript

     
     1#---------------------------------------------------------------------------------------------------
     2#
     3# This program is free software: you can redistribute it and/or modify
     4# it under the terms of the GNU General Public License as published by
     5# the Free Software Foundation, either version 3 of the License, or
     6# (at your option) any later version.
     7#
     8# This program is distributed in the hope that it will be useful,
     9# but WITHOUT ANY WARRANTY; without even the implied warranty of
     10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     11# GNU General Public License for more details.
     12#
     13# You should have received a copy of the GNU General Public License
     14# along with this program.  If not, see <http://www.gnu.org/licenses/>.
     15#
     16#---------------------------------------------------------------------------------------------------
     17#
     18# GPL-licensed icons included in applet.icns are courtesy of KMyMoney's developers!
     19#
     20#---------------------------------------------------------------------------------------------------
     21#
     22# Authors:
     23#  - Brad Giesbrecht <brad@pixilla.com>
     24#  - Marko K"aning <MK-MacPorts@techno.ms>
     25#
     26########################################################
     27
     28try
     29       
     30        set userID to do shell script "stat -f '%Su' $HOME"
     31       
     32end try
     33
     34set kdedirID to ""
     35set ICEauthorityID to ""
     36set XauthorityID to ""
     37
     38set kdeDir to (POSIX path of (path to home folder) & ".kde/" as string)
     39set ICEauthority to (POSIX path of (path to home folder) & ".ICEauthority" as string)
     40set Xauthority to (POSIX path of (path to home folder) & ".Xauthority" as string)
     41
     42set kdeDirMessage to ""
     43
     44try
     45       
     46        POSIX file kdeDir as alias
     47        set kdedirID to do shell script "stat -f '%Su' $HOME/.kde"
     48       
     49end try
     50
     51try
     52       
     53        POSIX file ICEauthority as alias
     54        set ICEauthorityID to do shell script "stat -f '%Su' $HOME/.ICEauthority"
     55       
     56end try
     57
     58try
     59       
     60        POSIX file Xauthority as alias
     61        set XauthorityID to do shell script "stat -f '%Su' $HOME/.Xauthority"
     62       
     63end try
     64
     65if ((not kdedirID is equal to "") and not kdedirID = userID) or not ICEauthorityID = userID or not XauthorityID = userID then
     66       
     67        if (not kdedirID is equal to "") then set kdeDirMessage to (kdeDir & return & " is owned by " & kdedirID & return & return)
     68       
     69        set fixPermissions to button returned of ¬
     70                (display dialog (kdeDirMessage ¬
     71                        & ICEauthority & return & " is owned by " & ICEauthorityID & return & return ¬
     72                        & Xauthority & return & " is owned by " & XauthorityID & return & return ¬
     73                        & "They should be owned by " & userID & " for KMyMoney to run properly!") ¬
     74                        buttons {"Cancel", "Fix"} default button {"Fix"} with icon 2)
     75       
     76        if fixPermissions = "Fix" then
     77               
     78                if (not kdedirID is equal to "") then do shell script "chown -R " & userID & " " & kdeDir with administrator privileges
     79                do shell script "chown " & userID & " " & ICEauthority with administrator privileges
     80                do shell script "chown " & userID & " " & Xauthority with administrator privileges
     81               
     82        end if
     83       
     84end if
     85
     86try
     87        do shell script "PATH=__PREFIX__/bin:$PATH; export PATH; __PREFIX__/bin/kmymoney > /dev/null 2>&1"
     88on error
     89        display alert "There was an error launching KMyMoney." & return & return & ¬
     90                "Try 'port installed kmymoney' to verify kmymoney is installed." & return & return & ¬
     91                "The command we tried to execute was:" & return & return & ¬
     92                "'PATH=__PREFIX__/bin:$PATH; export PATH; __PREFIX__/bin/kmymoney > /dev/null 2>&1'" as warning
     93end try
  • Portfile

     
    44
    55name              kmymoney
    66version           1.0.4
     7revision          1
    78
    89categories        kde finance
    9 maintainers       techno.ms:mk-macports
     10maintainers       techno.ms:mk-macports pixilla.com:brad
    1011platforms         darwin
    1112
    1213description       a personal finance manager
     
    1718                  QIF import/export, multiple currencies and initial online \
    1819                  banking support. \
    1920                  Released under the GNU General Public License. \
    20                   KMyMoney is free software.
     21                  KMyMoney is free software. \
     22                  \
     23                  NB: This port contains a starter .app which is located in \
     24                  Applications/MacPorts and ensures that permissions of .kde \
     25                  directory are set properly to run kmymoney.
    2126
    2227homepage          http://kmymoney2.sourceforge.net/index-home.html
    23 master_sites      sourceforge:kmymoney2
     28master_sites      sourceforge:kmymoney2 \
     29                  macports::icon
    2430distname          kmymoney2-${version}
    2531use_bzip2         yes
    26 checksums         md5     5971b8b2bc4107b967e267bc635d1b5c \
    27                   sha1    c6d3bdceec354502d8dee24b88ee714aa29e80b4 \
    28                   rmd160  71e5bbd4ddba7d6b5f71443f67eebba6ea26c20a
     32distfiles         [suffix ${distname}] \
     33                  applet.icns:icon
     34checksums         [suffix ${distname}]  md5     5971b8b2bc4107b967e267bc635d1b5c \
     35                                        sha1    c6d3bdceec354502d8dee24b88ee714aa29e80b4 \
     36                                        rmd160  71e5bbd4ddba7d6b5f71443f67eebba6ea26c20a \
     37                  applet.icns           md5     ff7199454889841b9188a39de417094f \
     38                                        sha1    ed1d8510521d9b81c632d5bb70d99c3d8291adf3 \
     39                                        rmd160  83369c68f66872e115291db1d25524e68468928e
    2940
    3041depends_build     port:libtool
    3142
     
    3748configure.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"
    3849configure.env     MKDIR_P="mkdir -p" \
    3950                  QTDIR=${prefix}/lib/qt3 \
    40                   HOME=${workpath}
     51                  HOME=${worksrcpath}
    4152configure.args    --with-qt-dir=${prefix}/lib/qt3 \
    4253                  --without-arts \
    4354                  --enable-mac \
     
    5061
    5162post-configure {
    5263    ln -sf ${prefix}/bin/glibtool ${worksrcpath}/libtool
     64    system "cp ${filespath}/main.applescript ${worksrcpath}"
     65    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/main.applescript
    5366}
    5467
    55 build.env         HOME=${workpath}
     68build.env         HOME=${worksrcpath}
     69
     70post-destroot {
     71    system "osacompile -o ${destroot}/Applications/MacPorts/KMyMoney.app ${worksrcpath}/main.applescript"
     72    system "cp ${distpath}/applet.icns ${destroot}/Applications/MacPorts/KMyMoney.app/Contents/Resources/"
     73}