1 | # $Id$ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | |
---|
5 | name postgresql-server-devel |
---|
6 | version devel |
---|
7 | categories databases |
---|
8 | platforms darwin |
---|
9 | maintainers nomaintainer |
---|
10 | description run postgresql-devel as server |
---|
11 | long_description ${description} |
---|
12 | |
---|
13 | homepage http://www.postgresql.org/ |
---|
14 | master_sites postgresql |
---|
15 | |
---|
16 | depends_run port:postgresql-devel |
---|
17 | |
---|
18 | fetch {} |
---|
19 | checksum {} |
---|
20 | extract {} |
---|
21 | use_configure no |
---|
22 | build {} |
---|
23 | |
---|
24 | set libdir ${prefix}/lib/postgresql-devel |
---|
25 | set dbdir ${prefix}/var/db/postgresql-devel/defaultdb |
---|
26 | set logdir ${prefix}/var/log/postgresql-devel |
---|
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 \${POSTGRESQLDEVELDATA:=${dbdir}} start -l ${logdir}/postgres.log\"" |
---|
35 | startupitem.stop \ |
---|
36 | "su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQLDEVELDATA:=${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/postgresql-devel \ |
---|
43 | realname=PostgreSQL-devel\ 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 | } |
---|