source: trunk/dports/databases/postgresql95/Portfile @ 139229

Last change on this file since 139229 was 139229, checked in by jeremyhu@…, 4 years ago

misc: Change port:openssl dependency to path:lib/libssl.dylib:openssl

This should allow usage of libressl as a replacement for openssl in relevant
ports. Not all ports have been tested, but libressl aims for API
compatibility with OpenSSL, so it is expected to work.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.0 KB
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 139229 2015-08-08 03:10:35Z jeremyhu@macports.org $
3
4PortSystem 1.0
5PortGroup select 1.0
6PortGroup compiler_blacklist_versions 1.0
7
8#remember to update the -doc and -server as well
9name                    postgresql95
10version                 9.5alpha2
11
12categories              databases
13platforms               darwin
14maintainers             mww jwa
15license                 Permissive
16description             The most advanced open-source database available anywhere.
17long_description PostgreSQL is Object-Relational Database Management System. \
18                                It supports almost all SQL constructs, including transactions, \
19                                subselects, and user-defined types and functions. Write-ahead \
20                                logging means increased performance while retaining data \
21                                integrity.
22
23homepage                http://www.postgresql.org/
24master_sites            http://ftp3.de.postgresql.org/pub/Mirrors/ftp.postgresql.org/source/v${version}/ \
25                        postgresql:source/v${version}/
26distname                postgresql-${version}
27
28checksums           rmd160  9fc22eefb27107a596f709f2d0ed233b34cd1f43 \
29                    sha256  87a55f39fb465ffe47701251665d3bff431760d9941f884be7f5ff67435ba485
30
31use_bzip2               yes
32
33depends_lib             port:readline path:lib/libssl.dylib:openssl port:zlib port:libxml2 port:libxslt
34depends_build           port:bison
35depends_run             port:postgresql_select
36
37worksrcdir              postgresql-${version}
38
39set libdir              ${prefix}/lib/${name}
40configure.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                --with-gssapi \
55                                --enable-thread-safety \
56                                --with-uuid=e2fs
57
58configure.ldflags-append    -headerpad_max_install_names
59
60# building psql with clang from XCode prior to 4.4 causes segfault on query; see #31717
61compiler.blacklist-append {clang < 421} macports-clang-2.9 macports-clang-3.0             
62notes "To use the postgresql server, install the ${name}-server port"
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
82# remember to change livecheck with first proper release
83livecheck.type  regex
84#livecheck.regex        (9\\.5\\.\[.0-9\]+)
85livecheck.url   ${homepage}/ftp/source/
86livecheck.regex (9\\.5\[.0-9\]*\[a-z\]+\[0-9\])
87
88# prepare the contrib modules
89set contribs {}
90
91post-build {
92# remove a Linux-specific contrib before continuing
93    file delete -force ${worksrcpath}/contrib/sepgsql
94# remove perl-specific contrib, if no perl variant
95    if {![variant_isset perl]} {
96        file delete -force ${worksrcpath}/contrib/hstore_plperl
97    }
98# remove python-specific contrib, if no python27 variant
99    if {![variant_isset python27]} {
100        file delete -force ${worksrcpath}/contrib/hstore_plpython
101        file delete -force ${worksrcpath}/contrib/ltree_plpython
102    }
103    set contribdirs [glob -nocomplain -type d ${worksrcpath}/contrib/*]
104    foreach d [lsort $contribdirs] {
105        if { [file exists $d/Makefile] } {
106            lappend contribs [file tail $d]
107        }
108    }
109        foreach contrib ${contribs} {
110                system "cd ${worksrcpath}/contrib/${contrib}/ && ${build.cmd}"
111        }
112}
113
114post-destroot {
115        foreach contrib ${contribs} {
116                system "echo contrib: \"${contrib}\""
117                system "cd ${worksrcpath}/contrib/${contrib}/ && \
118                        ${destroot.cmd} install ${destroot.destdir} && touch DONE"
119        }
120        system "cd ${destroot}${prefix}/bin && ln -sf ${libdir}/bin/psql psql95"
121        file delete -force ${destroot}${prefix}/share/doc/postgresql \
122                ${destroot}${prefix}/share/man
123               
124        reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \
125            ${destroot}${prefix}/lib/${name}/pgxs/src/Makefile.global
126       
127        reinplace -E "s#^CFLAGS =#CFLAGS +=#g" \
128            ${destroot}${prefix}/lib/${name}/pgxs/src/Makefile.global
129           
130        reinplace -E "s#^(\[\[:space:\]\]+)LDFLAGS =#\\1LDFLAGS +=#g" \
131            ${destroot}${prefix}/lib/${name}/pgxs/src/Makefile.global
132}
133
134select.group    postgresql
135select.file     ${filespath}/${name}
136
137variant python requires python27 description {add support for python} {
138}
139
140variant python27 description {add support for python 2.7} {
141        depends_lib-append              port:python27
142        configure.args-append   --with-python
143        configure.python                ${prefix}/bin/python2.7
144}
145
146variant perl description {add Perl support} {
147        depends_lib-append                      bin:perl:perl5
148        configure.args-append           --with-perl
149}
150
151variant tcl description {add Tcl support} {
152        depends_lib-append                      port:tcl
153        configure.args-append           --with-tcl --with-tclconfig=${prefix}/lib
154        configure.env-append            TCLSH=${prefix}/bin/tclsh
155}
Note: See TracBrowser for help on using the repository browser.