-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Portfile
61 lines (49 loc) · 1.71 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# -*- 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
PortSystem 1.0
PortGroup deprecated 1.0
# Final release was on 2011-12-05
deprecated.upstream_support no
name postgresql82-server
version 8.2.23
categories databases
platforms {darwin any}
supported_archs noarch
maintainers nomaintainer
license Permissive
description run postgresql82 as server
long_description {*}${description}
homepage https://www.postgresql.org/
master_sites postgresql
depends_run port:postgresql82
distfiles
use_configure no
build {}
set libdir ${prefix}/lib/postgresql82
set dbdir ${prefix}/var/db/postgresql82/defaultdb
set logdir ${prefix}/var/log/postgresql82
set dbuser postgres
set dbgrp postgres
add_users ${dbuser} shell=/bin/sh group=${dbgrp} \
home=${prefix}/var/db/postgresql82 \
realname=PostgreSQL-82\ Server
startupitem.create yes
startupitem.init \
"PGCTL=${libdir}/bin/pg_ctl"
startupitem.start \
"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL82DATA:=${dbdir}} start -l ${logdir}/postgres.log\""
startupitem.stop \
"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL82DATA:=${dbdir}} stop -s -m fast\""
destroot {
xinstall -m 755 -d ${destroot}${logdir}
system "touch ${destroot}${logdir}/postgres.log"
system "chown ${dbuser}:${dbgrp} ${destroot}${logdir}/postgres.log"
}
post-install {
ui_msg "\nTo create a database instance, after install do\n\
sudo mkdir -p ${dbdir}\n\
sudo chown ${dbuser}:${dbgrp} ${dbdir}\n\
sudo su ${dbuser} -c \'${libdir}/bin/initdb -D ${dbdir}\'"
ui_msg "\nTo tweak your DBMS, consider increasing kern.sysv.shmmax\
by adding an increased kern.sysv.shmmax .. to /etc/sysctl.conf"
}
livecheck.type none