source: trunk/dports/databases/db46/Portfile @ 136823

Last change on this file since 136823 was 136823, checked in by larryv@…, 5 years ago

select-1.0: Rebuild clients affected by #47849

In r136723, I introduced a bug into select-1.0 (since fixed in r136794)
that caused client ports to execute their post-destroot, pre/post-install,
and pre/post-activate scripts with an incorrect name. Some of these
failures were fatal, but others were silent and produced subtly broken
installations, which need to be fixed with a revbump.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.1 KB
Line 
1# $Id: Portfile 136823 2015-05-28 04:25:51Z larryv@macports.org $
2
3PortSystem 1.0
4PortGroup  muniversal 1.0
5PortGroup  select 1.0
6
7name            db46
8version         4.6.21
9#subport db46-java revision has been bumped, reset it on next version update
10revision        10
11set branch      [join [lrange [split ${version} .] 0 1] {}]
12categories      databases
13license         Sleepycat
14maintainers     blair openmaintainer
15platforms       darwin
16description     The Berkeley DB package, version 4.6
17long_description \
18    Version 4.6 of the Berkeley Data Base library which \
19    offers (key/value) storage with optional concurrent \
20    access or transactions interface.  This port will \
21    install the AES (American Encryption Standard) \
22    enabled version.
23
24homepage        http://www.oracle.com/us/products/database/berkeley-db/db/overview/index.html
25master_sites    http://download.oracle.com/berkeley-db/
26patch_sites     http://download.oracle.com/berkeley-db/patches/db/${version}/
27patchfiles      patch.${version}.1 \
28                patch.${version}.2 \
29                patch.${version}.3 \
30                patch.${version}.4
31
32distname        db-${version}
33dist_subdir     db4/${version}_6
34checksums       ${distname}${extract.suffix} \
35                md5     718082e7e35fc48478a2334b0bc4cd11 \
36                sha1    5be3beb82e42a78ff671a3f5a4c30e5652972119 \
37                rmd160  ccf9a4b85cc0464b2f3c2f2da29d99328fd4978e \
38                patch.${version}.1 \
39                md5     4878872edfc53c6ecb871b1062a4bdaf \
40                sha1    c7c155705687e4de03d06c2ea86940f573fdac0b \
41                rmd160  8c11e9b991ac6559f22ece2d93617b16126049e8 \
42                patch.${version}.2 \
43                md5     55074e53d3acae2dcbeae8322f96e522 \
44                sha1    a694b71088ba99b74042e7568f395fe467bb6590 \
45                rmd160  f8abf554552db668037e046dea54700ce3340bf8 \
46                patch.${version}.3 \
47                md5     7a6e11b54712caf752f9c4a52babe60c \
48                sha1    d52aa498943cfaa339ad6bf2cf7b836a40627701 \
49                rmd160  4e6b7ed1e1c69cba54351d76a0b8543107a655b8 \
50                patch.${version}.4 \
51                md5     ae7d3d587355fe85b512ef09b9a77d19 \
52                sha1    e2190185c667edb97e800495ce6eb4f95f43eb87 \
53                rmd160  f1d18e59c311fb4e1f00a3b6220269fca17df312
54
55# Generate libtool that understands -stdlib.
56use_autoreconf          yes
57autoreconf.dir          ${worksrcpath}/dist
58autoreconf.cmd          ${autoreconf.dir}/s_config
59autoreconf.args         --force --verbose --install \
60                        --include=${prefix}/share/aclocal \
61                        --include=${autoreconf.dir}/aclocal \
62                        --include=${autoreconf.dir}/aclocal_java \
63patchfiles-append       autoreconf-fix.patch
64depends_build-append    port:autoconf port:automake port:libtool
65
66configure.dir   ${worksrcpath}/build_unix
67build.dir       ${configure.dir}
68
69configure.cmd   ${worksrcpath}/dist/configure
70configure.args  --enable-cxx \
71                --includedir=\\\${prefix}/include/db${branch} \
72                --libdir=\\\${prefix}/lib/db${branch} \
73                --enable-dump185
74
75set cxx_stdlibflags {}
76if {[string match *clang* ${configure.cxx}]} {
77    set cxx_stdlibflags -stdlib=${configure.cxx_stdlib}
78}
79configure.cxx ${configure.cxx} ${cxx_stdlibflags}
80
81destroot.args-append \
82    docdir=${prefix}/share/doc/${name}
83
84pre-extract {
85    if {[file exists "/usr/local/include/db.h"]} {
86            ui_error "You have a conflicting install of Berkeley DB in /usr/local, please move it aside before building ${name}"
87            return -code error "Berkeley DB in /usr/local is in the way"
88    }
89}
90
91subport ${name}-java {
92    revision 10
93    depends_lib-append      port:${name}
94
95    # Compile BerkeleyDB's Java bindings with Java 1.5 as this is the
96    # oldest version of Java that the bindings are known to compile
97    # with.  This is done because ports that depend upon db46-java may
98    # be compiled with Apache Ant and Ant explicitly sets JAVA_HOME to
99    # /System/Library/Frameworks/JavaVM.framework/Home if JAVA_HOME is
100    # not already set.  If Oracle's JDK 7 is installed on the Mac and
101    # is set as the default Java version, then when BerkeleyDB's Java
102    # bindings are compiled the *.class files will be a newer format
103    # then the older Java in $JAVA_HOME can read.  So just compile
104    # BerkeleyDB with the oldest version of Java that can compile it.
105    # There is no harm in doing so as at application run time newer
106    # JVMs can read older class files and optimize them as if they
107    # were compiled with a newer version of Java.  The only
108    # performance loss may be a slightly longer class loading time,
109    # which is optimized in newer versions of Java.
110    configure.env   JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home
111    configure.args-append   --enable-java
112
113    build.env       JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home
114
115    platform macosx {
116        pre-configure {
117            if {![file isfile "/System/Library/Frameworks/JavaVM.framework/Headers/jni.h"]} {
118                ui_error "${subport} requires the Java for Mac OS X development headers."
119                if {${os.major} == 10} {
120                    ui_error "Download the Java Developer Package from: <https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20719>"
121                } elseif {${os.major} == 9} {
122                    ui_error "Download the Java Developer Package from: <https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20720>"
123                } else {
124                    ui_error "Make sure your Xcode installation is complete."
125                }
126                return -code error "missing Java headers"
127            }
128        }
129    }
130}
131
132if {$subport == $name} {
133    depends_run-append  port:db_select
134    select.group        db
135    select.file         ${filespath}/db46
136
137    post-destroot {
138        foreach bin [glob -tails -directory ${destroot}${prefix}/bin/ db_*] {
139            set newbin [regsub {^db_} ${bin} "db${branch}_"]
140            move ${destroot}${prefix}/bin/${bin} \
141                ${destroot}${prefix}/bin/${newbin}
142        }
143
144        delete ${destroot}${prefix}/share/doc/${name}/java
145        select::install ${select.group} ${select.file}
146    }
147
148    # Delete this variant on or after 2013-10-08.
149    variant java description "Java API - moved to ${name}-java port" {
150        notes "${name}'s +java variant has been replaced with the ${name}-java port."
151    }
152
153    variant tcl description {build Tcl API} {
154        depends_lib-append      port:tcl
155        configure.args-append   --enable-tcl --with-tcl=${prefix}/lib
156    }
157
158    variant compat185 description {build with db185 compatibility mode} {
159        configure.args-append   --enable-compat185
160    }
161} else {
162    # There is no Java specific install target, so delete everything
163    # but the Java related files.
164    post-destroot {
165        set p ${destroot}${prefix}
166
167        delete ${p}/bin
168        delete ${p}/include
169
170        # Install the docs into the main ports's doc directory so that
171        # the link in index.html to java/index.html works.
172        foreach f [lsort [glob -tails -directory ${p}/share/doc/${name} *]] {
173            if {${f} != {java}} {
174                delete ${p}/share/doc/${name}/${f}
175            }
176        }
177        ln -s ${name} ${p}/share/doc/${subport}
178
179        foreach f [lsort [glob -tails -directory ${p}/lib/${name} *]] {
180            if {   ${f} != {db.jar}
181                && [string compare -length 10 {libdb_java} ${f}]} {
182                delete ${p}/lib/${name}/${f}
183            }
184        }
185    }
186}
187
188if { [variant_isset universal] } {
189    if {${os.arch} eq "i386"} {
190        if { ${os.major} >= 10 } {
191            set merger_configure_args(ppc) --with-mutex=Darwin/_spin_lock_try
192        }
193        set merger_configure_args(ppc64)   --with-mutex=Darwin/_spin_lock_try
194    } else {
195        set merger_configure_args(i386)    --with-mutex=x86/gcc-assembly
196        set merger_configure_args(x86_64)  --with-mutex=x86_64/gcc-assembly
197    }
198}
199
200livecheck.type  regex
201livecheck.url   http://www.oracle.com/technetwork/database/berkeleydb/downloads/index-082944.html
202livecheck.regex {(4\.6(?:\.\d+)*)\.tar\.gz}
Note: See TracBrowser for help on using the repository browser.