source: trunk/dports/databases/postgresql81-server/Portfile @ 23388

Last change on this file since 23388 was 23388, checked in by mww@…, 10 years ago

add livecheck

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1# $Id: Portfile 23388 2007-03-30 15:35:25Z mww@macports.org $
2
3PortSystem 1.0
4
5name                    postgresql81-server
6version                 8.1.8
7categories              databases
8platforms               darwin
9maintainers             mww@macports.org jwa@macports.org
10description             run postgresql81 as server
11long_description        ${description}
12
13homepage                http://www.postgresql.org/
14master_sites    postgresql
15
16depends_run             port:postgresql81
17
18fetch   {}
19checksum        {}
20extract {}
21configure       {}
22build   {}
23
24set libdir              ${prefix}/lib/postgresql81
25set dbdir               ${prefix}/var/db/postgresql81/defaultdb
26set logdir              ${prefix}/var/log/postgresql81
27set dbuser              postgres81
28set dbgrp               postgres
29
30startupitem.create      yes
31startupitem.init        \
32        "PGCTL=${libdir}/bin/pg_ctl"
33startupitem.start       \
34        "su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL81DATA:=${dbdir}} start -l ${logdir}/postgres.log\""
35startupitem.stop        \
36"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL81DATA:=${dbdir}} stop -s -m fast\""
37
38destroot {
39        addgroup ${dbgrp}
40        set gid [existsgroup ${dbgrp}]
41        adduser ${dbuser} shell=/bin/sh gid=${gid} \
42                home=${prefix}/var/db/postgresql81 \
43                realname=PostgreSQL-81\ 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
49post-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
58livecheck.check regex
59livecheck.url   ${homepage}
60livecheck.regex v(8.1.\[0-9\]+)
Note: See TracBrowser for help on using the repository browser.