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