1997-04-10 19:15:12 +00:00
|
|
|
# New ports collection makefile for: PostgreSQL
|
1998-11-22 21:33:20 +00:00
|
|
|
# Date created: November 13, 1998
|
1999-08-31 06:53:31 +00:00
|
|
|
# Whom: Marc G. Fournier <scrappy@FreeBSD.org>
|
1997-04-09 15:30:55 +00:00
|
|
|
#
|
1999-08-25 05:28:01 +00:00
|
|
|
# $FreeBSD$
|
1998-04-22 08:28:07 +00:00
|
|
|
#
|
1998-04-21 21:52:10 +00:00
|
|
|
|
2000-04-08 22:49:07 +00:00
|
|
|
PORTNAME= postgresql
|
2000-12-11 03:22:07 +00:00
|
|
|
PORTVERSION= 7.0.3
|
1997-04-09 15:30:55 +00:00
|
|
|
CATEGORIES= databases
|
2000-06-20 05:08:07 +00:00
|
|
|
MASTER_SITES= ftp://ftp.postgresql.org/pub/%SUBDIR%/ \
|
|
|
|
ftp://ftp.de.postgresql.org/%SUBDIR%/ \
|
|
|
|
ftp://ftp.iodynamics.com/pub/mirror/postgresql/%SUBDIR%/ \
|
|
|
|
ftp://ftp.digex.net/pub/packages/database/postgresql/%SUBDIR%/ \
|
|
|
|
ftp://ftp.sunet.se/pub/unix/databases/relational/postgresql/%SUBDIR%/
|
|
|
|
MASTER_SITE_SUBDIR= source/v${PORTVERSION}
|
|
|
|
DISTFILES= ${PORTNAME}-${PORTVERSION}.base${EXTRACT_SUFX} \
|
|
|
|
${PORTNAME}-${PORTVERSION}.support${EXTRACT_SUFX} \
|
|
|
|
${PORTNAME}-${PORTVERSION}.docs${EXTRACT_SUFX}
|
|
|
|
# ${PORTNAME}-${PORTVERSION}.test${EXTRACT_SUFX}
|
2000-05-24 14:11:19 +00:00
|
|
|
DIST_SUBDIR= postgresql
|
1997-10-03 14:13:36 +00:00
|
|
|
|
2000-12-08 06:12:19 +00:00
|
|
|
MAINTAINER= girgen@partitur.se
|
1997-04-10 19:15:12 +00:00
|
|
|
|
2000-12-11 03:22:07 +00:00
|
|
|
BUILD_DEPENDS= autoconf:${PORTSDIR}/devel/autoconf
|
|
|
|
|
1999-01-12 18:17:42 +00:00
|
|
|
Y2K= http://www.postgresql.org/y2k.html
|
|
|
|
|
2000-06-20 05:08:07 +00:00
|
|
|
INSTALLS_SHLIB= YES
|
2000-07-11 19:03:58 +00:00
|
|
|
LDCONFIG_DIRS= %%PREFIX%%/pgsql/lib
|
1997-10-04 22:43:26 +00:00
|
|
|
|
1997-06-14 19:40:05 +00:00
|
|
|
WRKSRC= ${WRKDIR}/${DISTNAME}/src
|
2000-04-17 20:56:06 +00:00
|
|
|
DOCDIR= ${WRKDIR}/${DISTNAME}/doc
|
1997-10-04 22:43:26 +00:00
|
|
|
|
1997-04-10 19:15:12 +00:00
|
|
|
USE_GMAKE= YES
|
1997-10-04 22:43:26 +00:00
|
|
|
MAKEFILE= GNUmakefile
|
1997-06-14 19:40:05 +00:00
|
|
|
HAS_CONFIGURE= YES
|
2000-04-20 05:04:31 +00:00
|
|
|
CONFIGURE_ARGS= --prefix=${PREFIX}/pgsql \
|
1997-06-14 19:40:05 +00:00
|
|
|
--enable-locale \
|
1998-04-21 21:52:10 +00:00
|
|
|
--with-template=`uname -s | ${TR} '[A-Z]' '[a-z]'` \
|
2000-04-17 00:18:05 +00:00
|
|
|
--with-includes="${PREFIX}/include ${TCL_INCDIR} ${TK_INCDIR}" \
|
1999-06-05 19:55:24 +00:00
|
|
|
--with-libraries=${PREFIX}/lib
|
1997-04-10 19:15:12 +00:00
|
|
|
|
2000-05-24 14:11:19 +00:00
|
|
|
MAN1= createdb.1 createlang.1 createuser.1 dropdb.1 droplang.1 \
|
|
|
|
dropuser.1 ecpg.1 initdb.1 initlocation.1 ipcclean.1 pg_ctl.1 \
|
|
|
|
pg_dump.1 pg_dumpall.1 pg_passwd.1 pg_upgrade.1 pgaccess.1 \
|
|
|
|
pgadmin.1 pgtclsh.1 pgtksh.1 postgres.1 postmaster.1 psql.1 \
|
|
|
|
vacuumdb.1
|
|
|
|
MANL= abort.l alter_group.l alter_table.l alter_user.l \
|
|
|
|
begin.l close.l cluster.l comment.l commit.l copy.l \
|
|
|
|
create_aggregate.l create_constraint_trigger.l \
|
|
|
|
create_database.l create_function.l create_group.l \
|
|
|
|
create_index.l create_language.l create_operator.l \
|
|
|
|
create_rule.l create_sequence.l create_table.l \
|
|
|
|
create_table_as.l create_trigger.l create_type.l \
|
|
|
|
create_user.l create_view.l declare.l delete.l \
|
|
|
|
drop_aggregate.l drop_database.l drop_function.l \
|
|
|
|
drop_group.l drop_index.l drop_language.l \
|
|
|
|
drop_operator.l drop_rule.l drop_sequence.l \
|
1998-04-21 21:52:10 +00:00
|
|
|
drop_table.l drop_trigger.l drop_type.l drop_user.l \
|
2000-05-24 14:11:19 +00:00
|
|
|
drop_view.l end.l explain.l fetch.l grant.l insert.l \
|
|
|
|
listen.l load.l lock.l move.l notify.l reindex.l \
|
|
|
|
reset.l revoke.l rollback.l select.l select_into.l \
|
|
|
|
set.l show.l truncate.l unlisten.l update.l vacuum.l
|
1997-10-03 14:13:36 +00:00
|
|
|
|
1997-04-10 19:15:12 +00:00
|
|
|
MANPREFIX= ${PREFIX}/pgsql
|
1997-04-09 15:30:55 +00:00
|
|
|
|
2000-12-11 03:22:07 +00:00
|
|
|
SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \
|
|
|
|
WRKDIR="${WRKDIR}" \
|
|
|
|
FILESDIR="${FILESDIR}" \
|
|
|
|
TOUCH="${TOUCH}" \
|
|
|
|
MKDIR="${MKDIR}" \
|
|
|
|
NO_OPENSSL="${NO_OPENSSL}" \
|
|
|
|
DISTNAME="${DISTNAME}"
|
|
|
|
|
|
|
|
.if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc)
|
|
|
|
.include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc"
|
2000-09-23 16:13:56 +00:00
|
|
|
.endif
|
1999-06-29 20:21:49 +00:00
|
|
|
|
2000-12-11 03:22:07 +00:00
|
|
|
pre-extract:
|
|
|
|
@ ${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure.postgresql
|
|
|
|
|
1998-12-23 17:37:03 +00:00
|
|
|
post-patch:
|
|
|
|
@ ${MV} ${WRKSRC}/template/freebsd ${WRKSRC}/template/freebsd.orig
|
|
|
|
@ ${SED} -e 's#CFLAGS:-O2 -m486 -pipe#CFLAGS:${CFLAGS}#' \
|
|
|
|
-e 's#USE_LOCALE:no#USE_LOCALE:yes#' \
|
|
|
|
${WRKSRC}/template/freebsd.orig >> ${WRKSRC}/template/freebsd
|
1999-06-29 20:21:49 +00:00
|
|
|
@ ${MV} ${WRKSRC}/Makefile.global.in ${WRKSRC}/Makefile.global.in.old
|
|
|
|
@ ${SED} -e 's=!!PREFIX!!=${PREFIX}=g' \
|
|
|
|
${WRKSRC}/Makefile.global.in.old \
|
|
|
|
>> ${WRKSRC}/Makefile.global.in
|
1998-12-23 17:37:03 +00:00
|
|
|
|
2000-11-23 06:20:17 +00:00
|
|
|
#
|
|
|
|
# USE_AUTOCONF implies GNU_CONFIGURE, which we don't want, so we have
|
|
|
|
# to do it by hand.
|
|
|
|
#
|
|
|
|
pre-configure:
|
|
|
|
@(cd ${WRKSRC} && ${AUTOCONF})
|
|
|
|
|
1997-10-03 14:13:36 +00:00
|
|
|
post-build:
|
2000-04-17 00:18:05 +00:00
|
|
|
.if defined(WITH_JDBC)
|
2000-12-11 03:22:07 +00:00
|
|
|
@ ${GMAKE} -C ${WRKSRC}/interfaces/jdbc jdbc${JAVAVERSION}
|
1999-06-29 20:21:49 +00:00
|
|
|
.endif
|
1997-10-03 14:13:36 +00:00
|
|
|
|
1997-04-09 15:30:55 +00:00
|
|
|
pre-install:
|
1997-12-04 11:44:52 +00:00
|
|
|
.if defined(PACKAGE_BUILDING)
|
1999-06-29 20:21:49 +00:00
|
|
|
${RM} -rf ${PREFIX}/pgsql
|
1997-12-04 11:44:52 +00:00
|
|
|
.endif
|
1997-06-14 19:40:05 +00:00
|
|
|
@ ${MKDIR} ${PREFIX}/pgsql
|
1997-10-03 14:13:36 +00:00
|
|
|
@ ${SETENV} ${MAKE_ENV} perl ${SCRIPTDIR}/createuser
|
2000-12-11 03:22:07 +00:00
|
|
|
.if !defined(BATCH)
|
|
|
|
@ ${SED} -e "s#%%WRKDIR%%#${WRKDIR}#; s#%%DISTNAME%%#${DISTNAME}#" \
|
|
|
|
< ${FILESDIR}/pre-install-notes | more -e
|
|
|
|
.endif
|
1997-04-09 15:30:55 +00:00
|
|
|
|
|
|
|
post-install:
|
2000-04-17 20:56:06 +00:00
|
|
|
.if defined(NOPORTDOCS)
|
2000-12-11 03:22:07 +00:00
|
|
|
@ ${GMAKE} -C ${DOCDIR} man
|
2000-04-17 20:56:06 +00:00
|
|
|
.else
|
2000-12-11 03:22:07 +00:00
|
|
|
@ ${GMAKE} -C ${DOCDIR} install
|
|
|
|
${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/doc/FAQ* ${PREFIX}/share/doc/pgsql
|
|
|
|
${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/doc/README* ${PREFIX}/share/doc/pgsql
|
|
|
|
${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/doc/TODO ${PREFIX}/share/doc/pgsql
|
|
|
|
# ${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/doc/*ps.gz ${PREFIX}/share/doc/pgsql
|
|
|
|
@ ${CAT} ${PKGDIR}/pkg-plist.doc >> ${TMPPLIST}
|
2000-04-17 20:56:06 +00:00
|
|
|
.endif
|
1997-06-14 19:40:05 +00:00
|
|
|
@ if [ ! -f ${PREFIX}/pgsql/.profile ]; then \
|
2000-12-11 03:22:07 +00:00
|
|
|
${SED} 's|%%PREFIX%%|${PREFIX}|g' \
|
|
|
|
< ${FILESDIR}/dot.profile.in \
|
1997-06-14 19:40:05 +00:00
|
|
|
> ${PREFIX}/pgsql/.profile; \
|
|
|
|
fi
|
1999-08-22 19:01:07 +00:00
|
|
|
@ ${CHOWN} -R pgsql:pgsql ${PREFIX}/pgsql
|
2000-09-09 06:29:15 +00:00
|
|
|
@ ${CHOWN} root:pgsql ${PREFIX}/pgsql/lib
|
1997-10-03 14:13:36 +00:00
|
|
|
@ ${ECHO} 'Initializing PostgreSQL Databases - this may take a few minutes...'
|
1998-10-16 02:42:29 +00:00
|
|
|
@ ${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ${PREFIX}/pgsql/lib
|
2000-12-11 03:22:07 +00:00
|
|
|
# '-' so we don't fail to create packagelist at this stage,
|
|
|
|
# when we already have everything installed on top of previous version
|
|
|
|
-@ su -l pgsql -c 'PATH=${PREFIX}/pgsql/bin:${PATH} ${PREFIX}/pgsql/bin/initdb --pglib=${PREFIX}/pgsql/lib --pgdata=${PREFIX}/pgsql/data'
|
1997-10-03 14:13:36 +00:00
|
|
|
@ ${SED} -e "s=!!PREFIX!!=${PREFIX}=g" < ${FILESDIR}/pgsql.sh.tmpl \
|
|
|
|
> ${PREFIX}/etc/rc.d/pgsql.sh
|
1999-08-22 19:01:07 +00:00
|
|
|
@ ${CHMOD} 554 ${PREFIX}/etc/rc.d/pgsql.sh
|
|
|
|
@ ${CHOWN} root.pgsql ${PREFIX}/etc/rc.d/pgsql.sh
|
2000-12-11 03:22:07 +00:00
|
|
|
@ ${SED} -e 's#%%PREFIX%%#${PREFIX}#' < ${FILESDIR}/post-install-notes \
|
|
|
|
> ${PREFIX}/pgsql/post-install-notes
|
2000-06-20 05:08:07 +00:00
|
|
|
.if defined(WITHOUT_MULTIBYTE)
|
|
|
|
@${CP} ${TMPPLIST} ${TMPPLIST}.nomulti
|
|
|
|
@${GREP} -v pgsql/bin/pg_encoding ${TMPPLIST}.nomulti > ${TMPPLIST}
|
|
|
|
.endif
|
2000-04-17 00:18:05 +00:00
|
|
|
.if defined(WITH_TCL)
|
|
|
|
@${CP} ${TMPPLIST} ${TMPPLIST}.notcl
|
2000-12-11 03:22:07 +00:00
|
|
|
@${CAT} ${PKGDIR}/${TCL_PLIST} ${TMPPLIST}.notcl > ${TMPPLIST}
|
2000-04-17 00:18:05 +00:00
|
|
|
@${RM} ${TMPPLIST}.notcl
|
2000-12-11 03:22:07 +00:00
|
|
|
# Preparing a loadable TCL-package (pkgIndex.tcl)
|
|
|
|
# XXX This directory and the single file are not registered in
|
|
|
|
# XXX the PLIST, because of different PREFIX.
|
|
|
|
@${MKDIR} ${LOCALBASE}/lib/tcl${WITH_TCL}/Pgtcl1.3
|
|
|
|
@${SED} 's|%%PREFIX%%|${PREFIX}|' < ${FILESDIR}/pkgIndex.tcl.in \
|
|
|
|
> ${LOCALBASE}/lib/tcl${WITH_TCL}/Pgtcl1.3/pkgIndex.tcl
|
1999-06-29 20:21:49 +00:00
|
|
|
.endif
|
2000-09-23 16:13:56 +00:00
|
|
|
.if defined(WITH_ODBC)
|
|
|
|
@${CP} ${TMPPLIST} ${TMPPLIST}.noodbc
|
2000-10-08 00:04:36 +00:00
|
|
|
@${CAT} ${PKGDIR}/pkg-plist.odbc ${TMPPLIST}.noodbc > ${TMPPLIST}
|
2000-09-23 16:13:56 +00:00
|
|
|
@${RM} ${TMPPLIST}.noodbc
|
|
|
|
.endif
|
2000-04-17 00:18:05 +00:00
|
|
|
.if defined(WITH_JDBC)
|
2000-06-20 05:08:07 +00:00
|
|
|
@ ${MKDIR} -m 0555 ${PREFIX}/share/java/classes
|
1999-06-29 20:21:49 +00:00
|
|
|
@ ${INSTALL_DATA} ${WRKSRC}/interfaces/jdbc/postgresql.jar \
|
2000-05-24 14:11:19 +00:00
|
|
|
${PREFIX}/share/java/classes/postgresql.jar
|
1999-06-29 20:21:49 +00:00
|
|
|
@ ${ECHO_MSG} "---------------------------------------------------------"
|
2000-05-24 14:11:19 +00:00
|
|
|
@ ${ECHO_MSG} "Putting postgresql.jar in"
|
|
|
|
@ ${ECHO_MSG} "${PREFIX}/share/java/classes/postgresql.jar"
|
1999-06-29 20:21:49 +00:00
|
|
|
@ ${ECHO_MSG} "Add this to your CLASSPATH!"
|
2000-05-25 09:35:25 +00:00
|
|
|
@ ${ECHO_MSG} "ALSO NOTE: path inside jar file modified from 6.5.x:"
|
|
|
|
@ ${ECHO_MSG} " 'postgresql.*' -> 'org.postgresql.*'!"
|
|
|
|
@ ${ECHO_MSG} "You will need to modify you applications' props files."
|
1999-06-29 20:21:49 +00:00
|
|
|
@ ${ECHO_MSG} "---------------------------------------------------------"
|
2000-10-08 00:04:36 +00:00
|
|
|
@ ${CAT} ${PKGDIR}/pkg-plist.jdbc >> ${TMPPLIST}
|
1999-06-29 20:21:49 +00:00
|
|
|
.if !defined(NOPORTDOCS)
|
|
|
|
@ ${MKDIR} -m 0555 ${PREFIX}/share/examples/pgsql/jdbc
|
|
|
|
@ ${INSTALL_DATA} ${WRKSRC}/interfaces/jdbc/example/*java \
|
|
|
|
${PREFIX}/share/examples/pgsql/jdbc
|
|
|
|
@ ${INSTALL_DATA} ${WRKSRC}/interfaces/jdbc/README* \
|
|
|
|
${PREFIX}/share/examples/pgsql/jdbc
|
|
|
|
@ ${ECHO_MSG} "---------------------------------------------------------"
|
|
|
|
@ ${ECHO_MSG} "Putting jdbc examples into ${PREFIX}/share/examples/pgsql"
|
|
|
|
@ ${ECHO_MSG} "---------------------------------------------------------"
|
|
|
|
.endif
|
1997-06-14 21:10:42 +00:00
|
|
|
.endif
|
1997-04-10 19:15:12 +00:00
|
|
|
.if !defined(BATCH)
|
2000-12-11 03:22:07 +00:00
|
|
|
@ more -e ${PREFIX}/pgsql/post-install-notes
|
1997-04-09 15:30:55 +00:00
|
|
|
.endif
|
1999-07-21 07:16:27 +00:00
|
|
|
.if !defined(DEBUG_FLAGS)
|
1999-06-29 20:21:49 +00:00
|
|
|
.for file in ecpg pg_dump pg_id pg_passwd pg_version postgres psql
|
|
|
|
@ strip ${PREFIX}/pgsql/bin/${file}
|
|
|
|
.endfor
|
1999-07-21 07:16:27 +00:00
|
|
|
.endif
|
1997-04-09 15:30:55 +00:00
|
|
|
|
2000-12-11 03:22:07 +00:00
|
|
|
post-clean:
|
|
|
|
@ ${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc
|
|
|
|
|
1997-04-09 15:30:55 +00:00
|
|
|
.include <bsd.port.mk>
|