openbsd-ports/databases/postgresql/Makefile

127 lines
4.3 KiB
Makefile
Raw Normal View History

# New ports collection makefile for: PostgreSQL
1998-05-06 12:55:37 -04:00
# Version required: 6.3.2
# Date created: 6 May 1998
# Whom: Oleg Safiullin <form@vs.itam.nsc.ru>
#
# $OpenBSD: Makefile,v 1.8 1998/06/27 22:18:34 marc Exp $
1998-05-06 12:55:37 -04:00
# FreeBSD: Makefile,v 1.25 1998/04/22 08:28:07 asami Exp
#
1998-05-06 12:55:37 -04:00
DISTNAME= postgresql-6.3.2
CATEGORIES= databases
1998-05-06 12:55:37 -04:00
MASTER_SITES= ftp://ftp.postgresql.org/pub/
MAINTAINER= form@vs.itam.nsc.ru
# openbsd yacc fails with: /usr/bin/yacc: f - maximum table size exceeded
# so use bison
#
1998-06-10 02:06:52 -04:00
BUILD_DEPENDS= bison:${PORTSDIR}/devel/bison
1998-05-06 12:55:37 -04:00
.if defined(USE_TCL)
MAKE_ENV= USE_TCL=true TCL_INCDIR=${PREFIX}/include/tcl8.0
1998-06-17 01:41:24 -04:00
LIB_DEPENDS= tcl80\\.1\\.:${PORTSDIR}/lang/tcl80 \
tk80\\.1\\.:${PORTSDIR}/x11/tk80
1998-05-06 12:55:37 -04:00
WITH_TCL= --with-tcl
.endif
1998-06-17 02:27:17 -04:00
DBPREFIX= /var/db
NO_PACKAGE= "Requires pgsql uid"
WRKSRC= ${WRKDIR}/${DISTNAME}/src
USE_GMAKE= YES
MAKEFILE= GNUmakefile
HAS_CONFIGURE= YES
1998-05-06 12:55:37 -04:00
CONFIGURE_ARGS= --prefix=${PREFIX}/pgsql \
--enable-locale \
1998-05-06 12:55:37 -04:00
--with-template=`uname -s | ${TR} '[A-Z]' '[a-z]'` \
--with-includes=/usr/local/include ${WITH_TCL} \
--with-libraries=/usr/local/lib
MAN1= cleardbdir.1 createdb.1 createuser.1 destroydb.1 \
1998-05-06 12:55:37 -04:00
destroyuser.1 ecpg.1 initdb.1 ipcclean.1 initlocation.1 \
pg_dump.1 pg_dumpall.1 pg_passwd.1 pgintro.1 postgres.1 \
postmaster.1 psql.1
MAN3= catalogs.3 large_objects.3 libpq.3 oracle_compat.3 pgbuiltin.3
MAN5= bki.5 page.5 pg_hba.conf.5
1998-05-06 12:55:37 -04:00
MANL= abort.l alter_table.l alter_user.l begin.l close.l cluster.l \
commit.l copy.l create_aggregate.l create_database.l \
create_function.l create_index.l create_language.l \
create_operator.l create_rule.l create_sequence.l \
create_table.l create_trigger.l create_type.l create_user.l \
create_version.l create_view.l declare.l delete.l drop.l \
drop_aggregate.l drop_database.l drop_function.l drop_index.l \
drop_language.l drop_operator.l drop_rule.l drop_sequence.l \
drop_table.l drop_trigger.l drop_type.l drop_user.l \
drop_view.l end.l explain.l fetch.l grant.l insert.l listen.l \
1998-05-06 12:55:37 -04:00
load.l lock.l move.l notify.l reset.l revoke.l \
rollback.l select.l set.l show.l sql.l update.l vacuum.l
1998-05-06 12:55:37 -04:00
MANPREFIX= ${PREFIX}/pgsql
# Spit this message out right away.
#
pre-fetch:
1998-05-06 12:55:37 -04:00
.if !defined(USE_TCL)
@${ECHO_MSG} "To build the \"PostgreSQL to Tcl interface library\", libpgtcl, type:"
@${ECHO_MSG} " make USE_TCL=yes"
.else
1998-05-06 12:55:37 -04:00
@${ECHO_MSG} "Building PostgreSQL with \"libpgtcl\"."
.endif
1998-05-06 12:55:37 -04:00
pre-install:
.if defined(PACKAGE_BUILDING)
/bin/rm -rf ${PREFIX}/pgsql
.endif
1998-05-06 12:55:37 -04:00
@ ${MKDIR} ${PREFIX}/pgsql
@ ${SETENV} ${MAKE_ENV} perl ${SCRIPTDIR}/createuser
post-install:
@ if [ ! -f ${PREFIX}/pgsql/.profile ]; then \
1998-05-06 12:55:37 -04:00
${ECHO} "PATH=${PATH}:${PREFIX}/pgsql/bin" \
> ${PREFIX}/pgsql/.profile; \
1998-05-06 12:55:37 -04:00
${ECHO} "MANPATH=${MANPATH}:${PREFIX}/pgsql/bin" \
>> ${PREFIX}/pgsql/.profile; \
1998-05-06 12:55:37 -04:00
${ECHO} "PGLIB=${PREFIX}/pgsql/lib" \
>> ${PREFIX}/pgsql/.profile; \
${ECHO} "# note: PGDATA overwrites the -D startup option" \
>> ${PREFIX}/pgsql/.profile; \
1998-06-17 02:27:17 -04:00
${ECHO} "PGDATA=${DBPREFIX}/pgsql/data" \
>> ${PREFIX}/pgsql/.profile; \
${ECHO} "DISPLAY=:0" \
>> ${PREFIX}/pgsql/.profile; \
${ECHO} "export PATH MANPATH PGLIB PGDATA DISPLAY" \
>> ${PREFIX}/pgsql/.profile; \
${ECHO} "# if you want to make regression tests use this TZ" \
>> ${PREFIX}/pgsql/.profile; \
${ECHO} "#TZ=PST8PDT" \
>> ${PREFIX}/pgsql/.profile; \
${ECHO} "#export TZ" \
>> ${PREFIX}/pgsql/.profile; \
fi
@ chown -R pgsql:pgsql ${PREFIX}/pgsql
1998-06-17 02:27:17 -04:00
@ if [ ! -d ${DBPREFIX}/pgsql/data ]; then \
${MKDIR} -p ${DBPREFIX}/pgsql/data; \
chown pgsql:pgsql ${DBPREFIX}/pgsql ${DBPREFIX}/pgsql/data; \
chmod 700 ${DBPREFIX}/pgsql/data; \
1998-06-17 01:41:24 -04:00
${ECHO} 'Initializing PostgreSQL Databases - this may take a few minutes...'; \
${LDCONFIG} -m ${PREFIX}/pgsql/lib; \
1998-06-17 02:27:17 -04:00
su -l pgsql -c '${PREFIX}/pgsql/bin/initdb --pglib=${PREFIX}/pgsql/lib --pgdata=${DBPREFIX}/pgsql/data'; \
1998-06-17 01:41:24 -04:00
else \
${ECHO} 'Found existing PostgreSQL database(s) -- skipping database initializing...'; \
fi
${SED} -e "s=!!PREFIX!!=${PREFIX}=g" < ${FILESDIR}/pgsql.sh.tmpl > ${PREFIX}/etc/rc.d/pgsql.sh
chmod 554 ${PREFIX}/etc/rc.d/pgsql.sh
chown root.pgsql ${PREFIX}/etc/rc.d/pgsql.sh
${INSTALL_DATA} ${FILESDIR}/post-install-notes ${PREFIX}/pgsql
.if !defined(NOPORTDOCS)
1998-05-06 12:55:37 -04:00
${MKDIR} ${PREFIX}/share/doc/pgsql
${CP} -r ${WRKDIR}/${DISTNAME}/doc/* ${PREFIX}/share/doc/pgsql
.endif
.if !defined(BATCH)
1998-05-06 12:55:37 -04:00
@ more -e ${FILESDIR}/post-install-notes
.endif
.include <bsd.port.mk>