blob: 4fc76cdbc78e7bd6c2ffb833a970eff1389a5492 (
plain)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
# $NetBSD: Makefile,v 1.51 2000/07/14 04:44:11 jlam Exp $
# FreeBSD Id: Makefile,v 1.22 1997/12/24 01:21:37 alex Exp
#
DEPENDS+= readline-*:../../devel/readline
MAKEFILE= GNUmakefile
.include "../../mk/bsd.prefs.mk"
.if exists(/usr/sbin/user)
USERDIR= /usr/sbin
.else
DEPENDS+= user>=20000313:../../sysutils/user
USERDIR= ${LOCALBASE}/sbin
.endif
# Needs ELF clue, mips has no TAS implementation
NOT_FOR_PLATFORM= *-*-alpha *-*-mips
# PGUSER username of the database administrator
# PGGROUP group of the database administrator
#
PGUSER?= pgsql
PGGROUP?= ingres
MESSAGE_FILE= ${FILESDIR}/post-install-notes
DEINSTALL_FILE= ${WRKDIR}/DEINSTALL
INSTALL_FILE= ${WRKDIR}/INSTALL
PGHOME= ${PREFIX}/${PGUSER}
BUILD_DEFS= PGUSER PGROUP
PLIST_SUBST= PGUSER=${PGUSER}
CONFIGURE_ARGS+= --without-perl --without-odbc --without-tcl
CONFIGURE_ARGS+= --with-includes="${LOCALBASE}/include"
CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}"
pre-install:
@case "X${PGUSER}" in \
Xbin|Xetc|Xinclude|Xinfo|Xlib|Xlibdata|Xlibexec|Xman|Xsbin|Xshare) \
${ECHO} "You have chosen PGUSER=${PGUSER} which will"; \
${ECHO} "cause trouble, because the postgres home directory"; \
${ECHO} "would be ${PGHOME}. Please"; \
${ECHO} "set PGUSER to something more reasonable"; \
${ECHO} "like pgsql."; \
${ECHO} ""; \
${FALSE}; \
;; \
esac
${SED} -e 's|@PGUSER@|${PGUSER}|g' \
-e 's|@PGHOME@|${PGHOME}|g' \
< ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}
${SED} -e 's|@PGUSER@|${PGUSER}|g' \
-e 's|@PGGROUP@|${PGGROUP}|g' \
-e 's|@PGHOME@|${PGHOME}|g' \
-e 's|@USERDIR@|${USERDIR}|g' \
< ${PKGDIR}/INSTALL > ${INSTALL_FILE}
PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL
post-install:
cd ${PREFIX}/include/pgsql; ${RMDIR} -p port/netbsd
.for PROG in ecpg pg_dump pg_encoding pg_id pg_passwd pg_version postgres psql
strip ${PREFIX}/bin/${PROG}
.endfor
${SED} -e 's|@PATH@|${PATH}|g' \
-e 's|@MANPATH@|${MANPATH}|g' \
-e 's|@PREFIX@|${PREFIX}|g' \
< ${FILESDIR}/profile.pgsql > ${WRKDIR}/profile.pgsql
${INSTALL_DATA} ${WRKDIR}/profile.pgsql ${PGHOME}/.profile.pgsql
${INSTALL_DATA} ${FILESDIR}/post-install-notes ${PGHOME}
${CHOWN} -R ${PGUSER}:${PGGROUP} ${PGHOME}
${SED} -e "s|@PREFIX@|${PREFIX}|g" \
-e "s|@PGUSER@|${PGUSER}|g" \
-e "s|@PGHOME@|${PGHOME}|g" \
< ${FILESDIR}/pgsql.sh.tmpl > ${WRKDIR}/pgsql.sh
${INSTALL} -c -o root -g ${PGGROUP} -m 554 \
${WRKDIR}/pgsql.sh ${PREFIX}/etc/rc.d/pgsql.sh
${CAT} ${FILESDIR}/exclude ${FILESDIR}/man.tcl ${FILESDIR}/man.tk \
| ${SED} "s,^#.*,," \
| ${GTAR} zxCXf ${PREFIX}/man - \
${WRKDIR}/${DISTNAME}/doc/man.tar.gz
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/postgresql
cd ${WRKDIR}/${DISTNAME}/doc; \
${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} all
cd ${WRKDIR}/${DISTNAME}/doc; ${INSTALL_DATA} \
FAQ FAQ_DEV README.Charsets README.fsync README.inet \
README.locale README.mb README.mb.jp TODO \
bug.template internals.ps \
${PREFIX}/share/doc/postgresql
${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/share/doc/postgresql
${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/share/doc/html/postgresql
PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
.include "../../databases/postgresql/Makefile.common"
|