[48689] trunk/dports/gnome/gnucash/Portfile

blb at macports.org blb at macports.org
Thu Mar 26 23:53:42 PDT 2009


Revision: 48689
          http://trac.macports.org/changeset/48689
Author:   blb at macports.org
Date:     2009-03-26 23:53:41 -0700 (Thu, 26 Mar 2009)
Log Message:
-----------
gnome/gnucash - rework the way the gconf schemas are registered, and as a
result, stop it from installing anything into ${prefix}/etc/macports

Modified Paths:
--------------
    trunk/dports/gnome/gnucash/Portfile

Modified: trunk/dports/gnome/gnucash/Portfile
===================================================================
--- trunk/dports/gnome/gnucash/Portfile	2009-03-27 06:53:14 UTC (rev 48688)
+++ trunk/dports/gnome/gnucash/Portfile	2009-03-27 06:53:41 UTC (rev 48689)
@@ -5,7 +5,7 @@
 
 name              gnucash
 version           2.2.9
-
+revision          1
 categories        gnome x11
 maintainers       nomaintainer
 platforms         darwin
@@ -87,47 +87,35 @@
     patchfiles-append patch-configure-nox11.diff
 }
 
-set storagedir  ${prefix}/etc/macports/gconf
-set storagefile $storagedir/${name}
+set gnucash_register_schema ${prefix}/libexec/${name}-gconf-schema.sh
 
 post-destroot {
     # We need to register some stuff to gconf. Just putting the
     # schema files to the right place is not enough.
-    # For now we store the files in
-    # ${prefix}/etc/macports/gconf/${name} and use that file
-    # in post-activate. Until there is no better solution
-    # this will make it into the gnomeportgroup
+    # Setup ${prefix}/libexec/${name}-gconf-schema.sh to handle this
 
+    set schemafiles ""
     fs-traverse schema ${destroot}${prefix}/etc/gconf/schemas {
-        if { [ file isfile $schema ] } {
-            lappend schemafiles $schema
+        if {[file isfile $schema]} {
+            # The 'string range' bit is to remove the initial ${destroot} stuff
+            append schemafiles " [string range $schema [string length ${destroot}] end]"
         }
     }
 
-    if { [ llength $schemafiles ] > 0 } {
-        file mkdir ${destroot}${storagedir}
-        set fh [open ${destroot}${storagefile} w]
-        foreach file $schemafiles {
-            puts $fh [exec basename $file]
-        }
+    if {[string length $schemafiles] > 0} {
+        set fh [open ${destroot}${gnucash_register_schema} w]
+        puts $fh "#!/bin/sh"
+        puts $fh "env GCONF_CONFIG_SOURCE=`${prefix}/bin/gconftool-2 --get-default-source` ${prefix}/bin/gconftool-2 --makefile-install-rule $schemafiles"
         close $fh
+        file attributes ${destroot}${gnucash_register_schema} -permissions 0755
     }
 }
 
 post-activate {
-    if { [file exists ${storagefile} ] } {
-        set fh [open ${storagefile} r]
-        while { ! [eof $fh] } {
-            lappend schemafiles [gets $fh]
-        }
-        close $fh
+    if {[file exists ${gnucash_register_schema}]} {
+        system "${gnucash_register_schema}"
     }
 
-    set schemastring [join $schemafiles " "]
-
-        system "cd ${prefix}/etc/gconf/schemas && \
-        GCONF_CONFIG_SOURCE=`${prefix}/bin/gconftool-2 --get-default-source` ${prefix}/bin/gconftool-2 --makefile-install-rule $schemastring"
-
     if {[variant_isset no_x11]} {
         ui_warn "When you run gnucash, if it pops up a window saying:"
         ui_warn "   An error occurred while loading or saving configuration"
@@ -141,3 +129,4 @@
         ui_warn "process after you quit gnucash."
     } 
 }
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090326/6615624a/attachment.html>


More information about the macports-changes mailing list