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 93936 2012-06-04 16:52:09Z jwa@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup select 1.0 |
---|
6 | |
---|
7 | name postgresql91 |
---|
8 | version 9.1.4 |
---|
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 ff08ad702c7ffc0172b3f66aa4819d4865f0e77b \ |
---|
27 | sha256 a0795a8eb3ae2d1a2914b63bf143d20182835d90699915ff43567c041d3c9712 |
---|
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 ossp-uuid.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\\.1\\.\[.0-9\]+) |
---|
85 | #livecheck.url ${homepage}/developer/beta |
---|
86 | #livecheck.regex (9\\.1\[a-z\]+\[.0-9\]+) |
---|
87 | |
---|
88 | set contribs "adminpack auto_explain dblink file_fdw fuzzystrmatch lo oid2name pageinspect pg_archivecleanup pg_buffercache pg_freespacemap pg_standby pg_stat_statements pg_trgm pg_upgrade pg_upgrade_support pgcrypto pgrowlocks pgstattuple tablefunc uuid-ossp vacuumlo" |
---|
89 | |
---|
90 | post-build { |
---|
91 | foreach contrib ${contribs} { |
---|
92 | system "cd ${worksrcpath}/contrib/${contrib}/ && ${build.cmd}" |
---|
93 | } |
---|
94 | } |
---|
95 | |
---|
96 | post-destroot { |
---|
97 | foreach contrib ${contribs} { |
---|
98 | system "echo contrib: \"${contrib}\"" |
---|
99 | system "cd ${worksrcpath}/contrib/${contrib}/ && \ |
---|
100 | ${destroot.cmd} install ${destroot.destdir} && touch DONE" |
---|
101 | } |
---|
102 | system "cd ${destroot}${prefix}/bin && ln -sf ${libdir}/bin/psql psql91" |
---|
103 | file delete -force ${destroot}${prefix}/share/doc/postgresql \ |
---|
104 | ${destroot}${prefix}/share/man |
---|
105 | |
---|
106 | reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \ |
---|
107 | ${destroot}${prefix}/lib/postgresql91/pgxs/src/Makefile.global |
---|
108 | |
---|
109 | reinplace -E "s#^CFLAGS =#CFLAGS +=#g" \ |
---|
110 | ${destroot}${prefix}/lib/postgresql91/pgxs/src/Makefile.global |
---|
111 | |
---|
112 | reinplace -E "s#^(\[\[:space:\]\]+)LDFLAGS =#\\1LDFLAGS +=#g" \ |
---|
113 | ${destroot}${prefix}/lib/postgresql91/pgxs/src/Makefile.global |
---|
114 | } |
---|
115 | |
---|
116 | select.group postgresql |
---|
117 | select.file ${filespath}/${name} |
---|
118 | |
---|
119 | variant python description {add support for python} { |
---|
120 | depends_lib-append port:python27 |
---|
121 | configure.args-append --with-python |
---|
122 | configure.python ${prefix}/bin/python2.7 |
---|
123 | } |
---|
124 | |
---|
125 | variant krb5 description {add support for Kerberos 5 authentication} { |
---|
126 | configure.args-append --with-krb5 |
---|
127 | } |
---|
128 | |
---|
129 | variant perl description {add Perl support} { |
---|
130 | depends_lib-append bin:perl:perl5 |
---|
131 | configure.args-append --with-perl |
---|
132 | } |
---|
133 | |
---|
134 | variant tcl description {add Tcl support} { |
---|
135 | depends_lib-append port:tcl |
---|
136 | configure.args-append --with-tcl --with-tclconfig=${prefix}/lib |
---|
137 | configure.env-append TCLSH=${prefix}/bin/tclsh |
---|
138 | } |
---|
139 | |
---|
140 | post-install { |
---|
141 | ui_msg "\nTo use the postgresql server, install the ${name}-server port" |
---|
142 | } |
---|
143 | |
---|