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 96690 2012-08-17 16:09:28Z jwa@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup select 1.0 |
---|
6 | |
---|
7 | name postgresql90 |
---|
8 | version 9.0.9 |
---|
9 | |
---|
10 | categories databases |
---|
11 | platforms darwin |
---|
12 | maintainers mww jwa |
---|
13 | license Permissive |
---|
14 | description The most advanced open-source database available anywhere. |
---|
15 | long_description PostgreSQL is Object-Relational Database Management System. \ |
---|
16 | It supports almost all SQL constructs, including transactions, \ |
---|
17 | subselects, and user-defined types and functions. Write-ahead \ |
---|
18 | logging means increased performance while retaining data \ |
---|
19 | integrity. |
---|
20 | |
---|
21 | homepage http://www.postgresql.org/ |
---|
22 | master_sites http://ftp3.de.postgresql.org/pub/Mirrors/ftp.postgresql.org/source/v${version}/ \ |
---|
23 | postgresql:source/v${version}/ |
---|
24 | distname postgresql-${version} |
---|
25 | |
---|
26 | checksums rmd160 03cd901956c09e50e3d91f69962301d31e361391 \ |
---|
27 | sha256 87417d181a0f534fa96ba1d315a62b721f5bc22b7bb70af3f674bc1a68a5da8a |
---|
28 | |
---|
29 | use_bzip2 yes |
---|
30 | |
---|
31 | depends_lib port:readline port:openssl port:zlib port:libxml2 port:libxslt port:ossp-uuid |
---|
32 | depends_build port:bison |
---|
33 | depends_run port:postgresql_select |
---|
34 | |
---|
35 | worksrcdir postgresql-${version} |
---|
36 | |
---|
37 | patchfiles src_pl_plpython_Makefile.patch |
---|
38 | |
---|
39 | set libdir ${prefix}/lib/${name} |
---|
40 | configure.args --sysconfdir=${prefix}/etc/${name} \ |
---|
41 | --bindir=${libdir}/bin \ |
---|
42 | --libdir=${libdir} \ |
---|
43 | --includedir=${prefix}/include/${name} \ |
---|
44 | --datadir=${prefix}/share/${name} \ |
---|
45 | --mandir=${prefix}/share/man \ |
---|
46 | --with-includes=${prefix}/include \ |
---|
47 | --with-libraries=${prefix}/lib \ |
---|
48 | --with-openssl \ |
---|
49 | --with-bonjour \ |
---|
50 | --with-readline \ |
---|
51 | --with-zlib \ |
---|
52 | --with-libxml \ |
---|
53 | --with-libxslt \ |
---|
54 | --enable-thread-safety \ |
---|
55 | --enable-integer-datetimes \ |
---|
56 | --with-ossp-uuid |
---|
57 | configure.cppflags-append -I${prefix}/include/ossp |
---|
58 | |
---|
59 | # building psql with clang causes segfault on query; see #31717 |
---|
60 | if {${configure.compiler} == "clang" && [vercmp ${xcodeversion} 4.4] < 0} { |
---|
61 | configure.compiler llvm-gcc-4.2 |
---|
62 | } |
---|
63 | |
---|
64 | if {[variant_isset universal]} { |
---|
65 | configure.cflags-append -DAC_APPLE_UNIVERSAL_BUILD |
---|
66 | post-configure { |
---|
67 | system "cd ${worksrcpath}/src/include \ |
---|
68 | && ed - pg_config.h < ${filespath}/pg_config.h.ed \ |
---|
69 | && touch stamp-h" |
---|
70 | system "cd ${worksrcpath}/src/interfaces/ecpg/include \ |
---|
71 | && ed - ecpg_config.h < ${filespath}/ecpg_config.h.ed \ |
---|
72 | && touch stamp-h" |
---|
73 | } |
---|
74 | } |
---|
75 | |
---|
76 | build.type gnu |
---|
77 | build.target |
---|
78 | |
---|
79 | test.run yes |
---|
80 | test.target check |
---|
81 | |
---|
82 | livecheck.type regex |
---|
83 | livecheck.url ${homepage} |
---|
84 | livecheck.regex (9\\.0\\.\[.0-9\]+) |
---|
85 | |
---|
86 | platform darwin 12 { |
---|
87 | patchfiles-append postgresql-uuid-ossp.patch |
---|
88 | } |
---|
89 | |
---|
90 | set contrib_blacklist "start-scripts" |
---|
91 | set build_contribs "" |
---|
92 | |
---|
93 | post-extract { |
---|
94 | global contrib_blacklist |
---|
95 | set contribs [glob -tails -type d -directory ${worksrcpath}/contrib/ *] |
---|
96 | |
---|
97 | foreach contrib ${contribs} { |
---|
98 | if {[lsearch ${contrib_blacklist} ${contrib}] < 0} { |
---|
99 | append build_contribs ${contrib} " " |
---|
100 | } |
---|
101 | } |
---|
102 | } |
---|
103 | |
---|
104 | post-build { |
---|
105 | foreach contrib ${build_contribs} { |
---|
106 | system "cd ${worksrcpath}/contrib/${contrib}/ && ${build.cmd}" |
---|
107 | } |
---|
108 | } |
---|
109 | |
---|
110 | post-destroot { |
---|
111 | foreach contrib ${build_contribs} { |
---|
112 | system "echo contrib: \"${contrib}\"" |
---|
113 | system "cd ${worksrcpath}/contrib/${contrib}/ && \ |
---|
114 | ${destroot.cmd} install ${destroot.destdir} && touch DONE" |
---|
115 | } |
---|
116 | system "cd ${destroot}${prefix}/bin && ln -sf ${libdir}/bin/psql psql90" |
---|
117 | file delete -force ${destroot}${prefix}/share/doc/postgresql \ |
---|
118 | ${destroot}${prefix}/share/man |
---|
119 | |
---|
120 | reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \ |
---|
121 | ${destroot}${prefix}/lib/postgresql90/pgxs/src/Makefile.global |
---|
122 | |
---|
123 | reinplace -E "s#^CFLAGS =#CFLAGS +=#g" \ |
---|
124 | ${destroot}${prefix}/lib/postgresql90/pgxs/src/Makefile.global |
---|
125 | |
---|
126 | reinplace -E "s#^(\[\[:space:\]\]+)LDFLAGS =#\\1LDFLAGS +=#g" \ |
---|
127 | ${destroot}${prefix}/lib/postgresql90/pgxs/src/Makefile.global |
---|
128 | } |
---|
129 | |
---|
130 | select.group postgresql |
---|
131 | select.file ${filespath}/${name} |
---|
132 | |
---|
133 | variant python description {add support for python} { |
---|
134 | depends_lib-append port:python27 |
---|
135 | configure.args-append --with-python |
---|
136 | configure.python ${prefix}/bin/python2.7 |
---|
137 | } |
---|
138 | |
---|
139 | variant krb5 description {add support for Kerberos 5 authentication} { |
---|
140 | configure.args-append --with-krb5 |
---|
141 | } |
---|
142 | |
---|
143 | variant perl description {add Perl support} { |
---|
144 | depends_lib-append bin:perl:perl5 |
---|
145 | configure.args-append --with-perl |
---|
146 | } |
---|
147 | |
---|
148 | variant tcl description {add Tcl support} { |
---|
149 | depends_lib-append port:tcl |
---|
150 | configure.args-append --with-tcl --with-tclconfig=${prefix}/lib |
---|
151 | configure.env-append TCLSH=${prefix}/bin/tclsh |
---|
152 | } |
---|
153 | |
---|
154 | post-install { |
---|
155 | ui_msg "\nTo use the postgresql server, install the ${name}-server port" |
---|
156 | } |
---|
157 | |
---|