Ticket #16554: Portfile

File Portfile, 4.6 KB (added by illogical1@…, 16 years ago)

Actual portfile so user can test if Portfile works

Line 
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: Portfile 40399 2008-09-30 15:40:42Z macsforever2000@macports.org $
3
4PortSystem        1.0
5
6name              gnucash
7version           2.2.7
8revision          1
9
10categories        gnome x11
11maintainers       nomaintainer
12platforms         darwin
13
14description       a personal and small-business financial-accounting software
15long_description  GnuCash is a personal and small-business \
16                  financial-accounting software, freely licensed under the \
17                  GNU GPL.  Designed to be easy to use, yet powerful and \
18                  flexible, GnuCash allows you to track bank accounts, \
19                  stocks, income and expenses. As quick and intuitive to \
20                  use as a checkbook register, it is based on professional \
21                  accounting principles to ensure balanced books and \
22                  accurate reports.
23
24homepage          http://www.gnucash.org/
25master_sites      sourceforge \
26                  http://www.gnucash.org/pub/gnucash/sources/stable/
27use_bzip2         yes
28checksums         md5 0f3f324c274b136070b769aa10591ccf \
29                  sha1 55aeb126de4b195b3a84b8fe88cc16e8679f3cc5 \
30                  rmd160 db6cf249ca8f2a2497d48b4a1815b6ae5c681b97
31
32depends_lib       port:p5-xml-parser \
33                  path:${prefix}/lib/pkgconfig/glib-2.0.pc:glib2 \
34                  port:gconf \
35                  port:guile16 \
36                  port:slib \
37                  port:slib-guile16 \
38                  port:popt \
39                  port:libgnomeui \
40                  port:libgnomeprintui \
41                  port:libgtkhtml3 \
42                  port:libgsf \
43                  port:goffice \
44                  port:aqbanking3 \
45                  port:libofx \
46                  port:p5-finance-quote
47
48depends_build     port:libtool
49depends_run       port:evince
50
51configure.args    --disable-glibtest \
52                  --disable-dependency-tracking --enable-hbci --enable-ofx
53
54patchfiles        patch-configure.diff patch-lib_libc_libc-missing-noop.c.diff
55
56post-patch {
57    reinplace "/^DYLD_LIBRARY_PATH/s|=\"|=\"/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources@-PATH_SEPARATOR-@|" ${worksrcpath}/src/bin/gnucash.in
58    reinplace "/^DYLD_LIBRARY_PATH/s|=\"|=\"/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources@-PATH_SEPARATOR-@|" ${worksrcpath}/src/bin/overrides/gnucash-env.in
59    fs-traverse src_file ${worksrcpath}/src {
60        if { [ file isfile ${src_file} ] } {
61            reinplace "s|\\<guile\\/|\\<guile16\\/|g"   ${src_file}
62            reinplace "s|libguile\\.h|libguile16\\.h|g" ${src_file}
63            reinplace "s|exec\\ guile|exec\\ guile16|g" ${src_file}
64        }
65    }
66}
67
68variant without_quotes description {Does not depend on building p5-finance-quote} {
69    depends_lib-delete  port:p5-finance-quote
70}
71
72variant without_hbci description {Disables HBCI support} {
73    depends_lib-delete  port:aqbanking3
74    configure.args-delete   --enable-hbci
75    configure.args-append   --disable-hbci
76}
77
78variant without_ofx description {Disables ofx support} {
79    depends_lib-delete  port:libofx
80    configure.args-delete   --enable-ofx
81    configure.args-append   --disable-ofx
82}
83
84set storagedir  ${prefix}/etc/macports/gconf
85set storagefile $storagedir/${name}
86
87post-destroot {
88    # We need to register some stuff to gconf. Just putting the
89    # schema files to the right place is not enough.
90    # For now we store the files in
91    # ${prefix}/etc/macports/gconf/${name} and use that file
92    # in post-activate. Until there is no better solution
93    # this will make it into the gnomeportgroup
94
95    fs-traverse schema ${destroot}${prefix}/etc/gconf/schemas {
96        if { [ file isfile $schema ] } {
97            lappend schemafiles $schema
98        }
99    }
100
101    if { [ llength $schemafiles ] > 0 } {
102        file mkdir ${destroot}${storagedir}
103        set fh [open ${destroot}${storagefile} w]
104        foreach file $schemafiles {
105            puts $fh [exec basename $file]
106        }
107        close $fh
108    }
109}
110
111post-activate {
112    if { [file exists ${storagefile} ] } {
113        set fh [open ${storagefile} r]
114        while { ! [eof $fh] } {
115            lappend schemafiles [gets $fh]
116        }
117        close $fh
118    }
119
120    set schemastring [join $schemafiles " "]
121
122        system "cd ${prefix}/etc/gconf/schemas && \
123        GCONF_CONFIG_SOURCE=`${prefix}/bin/gconftool-2 --get-default-source` ${prefix}/bin/gconftool-2 --makefile-install-rule $schemastring"
124}