-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Portfile
114 lines (99 loc) · 3.38 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# $Id: Portfile,v 1.25 2005/10/05 13:33:11 mww Exp $
PortSystem 1.0
name postgresql8
version 8.0.4
categories databases
platforms darwin
maintainers mww@opendarwin.org
description The most advanced open-source database available anywhere
long_description PostgreSQL is Object-Relational Database Management System. \
It supports almost all SQL constructs, including transactions, \
subselects, and user-defined types and functions. Write-ahead \
logging means increased performance while retaining data \
integrity.
homepage http://www.postgresql.org/
master_sites postgresql:source/v${version} \
ftp://ftp.postgresql.org/pub/source/v${version}/
set dbase postgresql-base-${version}.tar.bz2
set dopt postgresql-opt-${version}.tar.bz2
set dtest postgresql-test-${version}.tar.bz2
distfiles ${dbase} ${dopt} ${dtest}
checksums ${dbase} md5 ece2604b7bc6c4c460d34113b1542725 \
${dopt} md5 27b8817f6ad1b81b55cdc8da55ed8295 \
${dtest} md5 2db4d072a359b5f62de96c10022ab8b8
patchfiles patch-PostgreSQL.darwin
use_bzip2 yes
depends_lib port:readline \
port:openssl \
port:zlib
depends_build port:bison
worksrcdir postgresql-${version}
set libdir ${prefix}/lib/pgsql8
configure.args --sysconfdir=${prefix}/etc/pgsql8 \
--bindir=${libdir}/bin \
--libdir=${libdir} \
--includedir=${prefix}/include/pgsql8 \
--datadir=${prefix}/share/${name} \
--mandir=${prefix}/share/man \
--with-docdir=${prefix}/share/doc/${name} \
--with-includes=${prefix}/include \
--with-libraries=${prefix}/lib \
--with-openssl \
--with-rendezvous \
--with-readline \
--with-zlib \
--enable-integer-datetimes \
--enable-multibyte \
--enable-unicode
configure.env CPPFLAGS=-I${prefix}/include \
CFLAGS=-I${prefix}/include \
LDFLAGS="-L${prefix}/lib"
build.type gnu
build.target
test.run yes
test.target check
set dbdir ${prefix}/var/db/pgsql8/defaultdb
set contribs "pg_autovacuum tsearch2"
post-build {
foreach contrib { ${contribs} } {
system "cd ${worksrcpath}/contrib/${contrib} && ${build.cmd}"
}
}
post-destroot {
foreach contrib { ${contribs} } {
system "cd ${worksrcpath}/contrib/${contrib} && \
${build.cmd} install ${destroot.destdir}"
}
system "cd ${destroot}${prefix}/bin && ln -sf ${libdir}/bin/psql psql8"
file delete -force ${destroot}${prefix}/share/doc/${name}
}
variant python {
depends_lib-append port:python24
configure.args-append --with-python
configure.env-append PYTHON=${prefix}/bin/python2.4
}
variant server {
pre-destroot {
set startupdir ${destroot}/Library/StartupItems/PostgreSQL8
set contrib ${worksrcpath}/contrib/start-scripts
xinstall -m 755 -d ${startupdir}
xinstall -m 755 ${contrib}/PostgreSQL.darwin ${startupdir}/PostgreSQL8
xinstall -m 644 ${contrib}/StartupParameters.plist.darwin \
${startupdir}/StartupParameters.plist
reinplace "s|__PREFIX__|${prefix}|g" ${startupdir}/PostgreSQL8
addgroup postgres
set gid [existsgroup postgres]
adduser postgres8 shell=/bin/sh gid=${gid} \
home=${prefix}/var/db/pgsql8 \
realname=PostgreSQL-8\ Server
}
post-install {
ui_msg "\nTo create a database instance, after install do\n\
sudo mkdir -p ${dbdir}\n\
sudo chown postgres8:postgre ${dbdir}\n\
sudo su postgres8 -c \'${libdir}/bin/initdb -D ${dbdir}\'"
ui_msg "\nTo activate the PostgreSQL8 server, add\n\
POSTGRESQL8=-YES-\n\
to your ${prefix}/etc/rc.local"
}
}