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