1 | # $Id: Portfile 46568 2009-02-07 18:21:06Z jwa@macports.org $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | |
---|
5 | name postgresql83-server |
---|
6 | version 8.3.7 |
---|
7 | categories databases |
---|
8 | platforms darwin |
---|
9 | maintainers mww jwa |
---|
10 | description run postgresql83 as server |
---|
11 | long_description ${description} |
---|
12 | |
---|
13 | homepage http://www.postgresql.org/ |
---|
14 | master_sites postgresql |
---|
15 | |
---|
16 | depends_run port:postgresql83 |
---|
17 | |
---|
18 | fetch {} |
---|
19 | checksum {} |
---|
20 | extract {} |
---|
21 | use_configure no |
---|
22 | build {} |
---|
23 | |
---|
24 | set libdir ${prefix}/lib/postgresql83 |
---|
25 | set dbdir ${prefix}/var/db/postgresql83/defaultdb |
---|
26 | set logdir ${prefix}/var/log/postgresql83 |
---|
27 | set dbuser postgres |
---|
28 | set dbgrp postgres |
---|
29 | |
---|
30 | startupitem.create yes |
---|
31 | startupitem.init \ |
---|
32 | "PGCTL=${libdir}/bin/pg_ctl" |
---|
33 | startupitem.start \ |
---|
34 | "su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL83DATA:=${dbdir}} start -l ${logdir}/postgres.log\"" |
---|
35 | startupitem.stop \ |
---|
36 | "su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL83DATA:=${dbdir}} stop -s -m fast\"" |
---|
37 | |
---|
38 | destroot { |
---|
39 | addgroup ${dbgrp} |
---|
40 | set gid [existsgroup ${dbgrp}] |
---|
41 | adduser ${dbuser} shell=/bin/sh gid=${gid} \ |
---|
42 | home=${prefix}/var/db/postgresql83 \ |
---|
43 | realname=PostgreSQL-83\ Server |
---|
44 | xinstall -m 755 -d ${destroot}${logdir} |
---|
45 | system "touch ${destroot}${logdir}/postgres.log" |
---|
46 | system "chown ${dbuser}:${dbgrp} ${destroot}${logdir}/postgres.log" |
---|
47 | } |
---|
48 | |
---|
49 | post-install { |
---|
50 | ui_msg "\nTo create a database instance, after install do\n\ |
---|
51 | sudo mkdir -p ${dbdir}\n\ |
---|
52 | sudo chown ${dbuser}:${dbgrp} ${dbdir}\n\ |
---|
53 | sudo su ${dbuser} -c \'${libdir}/bin/initdb -D ${dbdir}\'" |
---|
54 | ui_msg "\nTo tweak your DBMS, consider increasing kern.sysv.shmmax\ |
---|
55 | by adding an increased kern.sysv.shmmax .. to /etc/sysctl.conf" |
---|
56 | } |
---|
57 | |
---|
58 | livecheck.check regex |
---|
59 | livecheck.url ${homepage} |
---|
60 | livecheck.regex (8.3.\[0-9\]+) |
---|
61 | |
---|