Ticket #42371: Portfile

File Portfile, 5.0 KB (added by sebastien.lange@…, 10 years ago)

New Portfile with unaccent extension

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