1998-09-08 15:30:19 +00:00
|
|
|
# New ports collection makefile for: PostgreSQL-j
|
1999-11-23 11:04:43 +00:00
|
|
|
# Date created: 09 Nov 1999
|
1998-09-08 15:30:19 +00:00
|
|
|
# Whom: Ichiro Fukuhara <ichiro@ichiro.org>
|
|
|
|
#
|
1999-08-25 05:28:01 +00:00
|
|
|
# $FreeBSD$
|
1998-09-08 15:30:19 +00:00
|
|
|
#
|
|
|
|
|
2000-04-12 14:38:12 +00:00
|
|
|
PORTNAME= postgresql
|
|
|
|
PORTVERSION= 6.5.3
|
1998-09-08 15:30:19 +00:00
|
|
|
CATEGORIES= japanese databases
|
2000-04-12 14:38:12 +00:00
|
|
|
MASTER_SITES= ftp://ftp.jaist.ac.jp/pub/dbms/PostgreSQL/ \
|
|
|
|
ftp://ftp.sra.co.jp/pub/cmd/postgres/${PORTVERSION}/ \
|
|
|
|
ftp://ftp.postgresql.org/pub/
|
1998-09-08 15:30:19 +00:00
|
|
|
|
2000-07-13 06:42:22 +00:00
|
|
|
MAINTAINER= kuriyama@FreeBSD.org
|
1998-09-08 15:30:19 +00:00
|
|
|
|
|
|
|
WRKSRC= ${WRKDIR}/${DISTNAME}/src
|
1999-11-23 11:04:43 +00:00
|
|
|
PLISTS=
|
1998-09-08 15:30:19 +00:00
|
|
|
|
|
|
|
# if you want to use the tcl/tk frontend pgaccess, then you need to build
|
2000-04-17 00:18:05 +00:00
|
|
|
# postgresql with tcl support by typing: make WITH_TCL=yes
|
|
|
|
.if defined(WITH_TCL)
|
1999-01-01 07:19:45 +00:00
|
|
|
TCL_INCDIR= ${PREFIX}/include/tcl8.0jp
|
|
|
|
TK_INCDIR= ${PREFIX}/include/tk8.0jp
|
1999-11-23 11:04:43 +00:00
|
|
|
MAKE_ENV= USE_TCL=true USE_TK=true TCL_INCDIR=${TCL_INCDIR}
|
2000-04-17 00:18:05 +00:00
|
|
|
CONFIGURE_ARGS= --with-tcl --with-tk \
|
|
|
|
--with-tclconfig=${PREFIX}/lib/tcl8.0jp \
|
|
|
|
--with-tkconfig=${PREFIX}/lib/tk8.0jp
|
1999-01-01 07:19:45 +00:00
|
|
|
LIB_DEPENDS= tcl80jp.1:${PORTSDIR}/japanese/tcl80 \
|
|
|
|
tk80jp.1:${PORTSDIR}/japanese/tk80
|
2000-10-08 01:40:32 +00:00
|
|
|
PLISTS+= pkg-plist.tcl
|
1999-01-01 07:19:45 +00:00
|
|
|
.endif
|
|
|
|
.if defined(MULTIBYTE)
|
2000-04-17 00:18:05 +00:00
|
|
|
CONFIGURE_ARGS+= --with-mb=${MULTIBYTE}
|
1999-01-01 07:19:45 +00:00
|
|
|
.endif
|
2000-04-17 00:18:05 +00:00
|
|
|
.if defined(WITH_PERL)
|
|
|
|
CONFIGURE_ARGS+= --with-perl
|
2000-10-08 01:40:32 +00:00
|
|
|
PLISTS+= pkg-plist.pl
|
1999-01-01 07:19:45 +00:00
|
|
|
.endif
|
2000-04-17 00:18:05 +00:00
|
|
|
.if defined(WITH_ODBC)
|
|
|
|
CONFIGURE_ARGS+= --with-odbc
|
2000-10-08 01:40:32 +00:00
|
|
|
PLISTS+= pkg-plist.odbc
|
1998-09-08 15:30:19 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
NO_PACKAGE= "Requires ${PGSQL_UID} uid"
|
|
|
|
|
|
|
|
USE_GMAKE= YES
|
|
|
|
MAKEFILE= GNUmakefile
|
|
|
|
HAS_CONFIGURE= YES
|
2000-04-17 00:18:05 +00:00
|
|
|
CONFIGURE_ARGS+= --prefix=${PREFIX}/${INSTALL_DIR} \
|
1998-09-08 15:30:19 +00:00
|
|
|
--with-template=`uname -s | ${TR} '[A-Z]' '[a-z]'` \
|
1999-11-23 11:04:43 +00:00
|
|
|
--with-includes="${PREFIX}/include ${TCL_INCDIR} ${TK_INCDIR}" \
|
2000-04-17 00:18:05 +00:00
|
|
|
--with-libraries=${PREFIX}/lib
|
1999-01-01 07:19:45 +00:00
|
|
|
|
|
|
|
INSTALL_TARGET= install install-man
|
1998-09-08 15:30:19 +00:00
|
|
|
|
|
|
|
MAN1= cleardbdir.1 createdb.1 createuser.1 destroydb.1 \
|
1999-01-01 07:19:45 +00:00
|
|
|
destroyuser.1 ecpg.1 initdb.1 initlocation.1 \
|
|
|
|
ipcclean.1 pg_dump.1 pg_dumpall.1 pg_passwd.1 \
|
|
|
|
pg_upgrade.1 postgres.1 postmaster.1 psql.1
|
|
|
|
MAN3= catalogs.3 libpq.3
|
|
|
|
MAN5= pg_hba.conf.5
|
1998-09-08 15:30:19 +00: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 \
|
1999-01-01 07:19:45 +00: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-09-08 15:30:19 +00:00
|
|
|
|
|
|
|
MANPREFIX= ${PREFIX}/${INSTALL_DIR}
|
2000-06-17 05:34:04 +00:00
|
|
|
INSTALLS_SHLIB= yes
|
|
|
|
LDCONFIG_DIRS= ${PREFIX}/${INSTALL_DIR}/lib
|
1998-09-08 15:30:19 +00:00
|
|
|
|
|
|
|
PLIST_SUB= INSTALL_DIR=${INSTALL_DIR}
|
1999-01-01 07:19:45 +00:00
|
|
|
PLIST= ${WRKDIR}/PLIST
|
1998-09-08 15:30:19 +00:00
|
|
|
|
|
|
|
# These values are easily overridable like as
|
|
|
|
# "make PGQL_UID=postgresql PGSQL_GID=postgresql install"
|
|
|
|
INSTALL_DIR= pgsql
|
|
|
|
PGSQL_UID= pgsql
|
|
|
|
PGSQL_GID= pgsql
|
|
|
|
|
|
|
|
pre-fetch:
|
2000-04-17 00:18:05 +00:00
|
|
|
.if !defined(WITH_TCL) & !defined(WITH_PERL) & !defined(WITH_ODBC) & !defined(MULTIBYTE)
|
1999-01-01 07:19:45 +00:00
|
|
|
|
|
|
|
@${ECHO_MSG} "To build the \"MULTIBYTE PostgreSQL\", type:"
|
|
|
|
@${ECHO_MSG} " make MULTIBYTE={EUC_JP,EUC_CN,EUC_KR,EUC_TW,UNICODE,MULE_INTERNAL,LATIN1-5}"
|
2000-04-17 00:18:05 +00:00
|
|
|
@${ECHO_MSG} " WITH_TCL=yes, WITH_PERL=yes, WITH_ODBC=yes"
|
1999-01-01 07:19:45 +00:00
|
|
|
@${ECHO_MSG} ""
|
1998-09-08 15:30:19 +00:00
|
|
|
@${ECHO_MSG} "To build the \"PostgreSQL to Tcl interface library\", libpgtcl, type:"
|
2000-04-17 00:18:05 +00:00
|
|
|
@${ECHO_MSG} " make WITH_TCL=yes"
|
1998-09-08 15:30:19 +00:00
|
|
|
.else
|
|
|
|
@${ECHO_MSG} "Building PostgreSQL with \"libpgtcl\"."
|
|
|
|
.endif
|
|
|
|
|
1999-01-01 07:19:45 +00:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
1998-09-08 15:30:19 +00:00
|
|
|
post-patch:
|
|
|
|
find ${WRKDIR} -name '*.orig' -exec ${RM} {} \;
|
|
|
|
|
|
|
|
post-build:
|
|
|
|
@ ${ECHO} "------------------------------------------------------------"
|
|
|
|
@ ${ECHO} "Dump existing databases, before installing new db version !!"
|
|
|
|
@ ${ECHO} "Detailed instructions, see INSTALL file under ${WRKDIR}... "
|
|
|
|
@ ${ECHO} "------------------------------------------------------------"
|
1999-01-01 07:19:45 +00:00
|
|
|
@${RM} -f ${WRKDIR}/PLIST
|
2000-10-08 08:33:29 +00:00
|
|
|
.for i in ${PLISTS} pkg-plist
|
1999-01-01 07:19:45 +00:00
|
|
|
${CAT} ${PKGDIR}/${i} >> ${WRKDIR}/PLIST
|
|
|
|
.endfor
|
2000-04-17 00:18:05 +00:00
|
|
|
.if defined(WITH_TCL)
|
2000-10-08 01:40:32 +00:00
|
|
|
${CAT} ${PKGDIR}/pkg-plist.tcl.dirrm >> ${WRKDIR}/PLIST
|
1999-11-23 11:04:43 +00:00
|
|
|
.endif
|
2000-04-17 00:18:05 +00:00
|
|
|
.if defined(WITH_ODBC)
|
2000-10-08 01:40:32 +00:00
|
|
|
${CAT} ${PKGDIR}/pkg-plist.odbc.dirrm >> ${WRKDIR}/PLIST
|
1999-11-23 11:04:43 +00:00
|
|
|
.endif
|
2000-10-08 01:40:32 +00:00
|
|
|
${CAT} ${PKGDIR}/pkg-plist.dirrm >> ${WRKDIR}/PLIST
|
2000-04-17 00:18:05 +00:00
|
|
|
|
1998-09-08 15:30:19 +00:00
|
|
|
pre-install:
|
|
|
|
.if defined(PACKAGE_BUILDING)
|
|
|
|
${RM} -rf ${PREFIX}/${INSTALL_DIR}
|
|
|
|
.endif
|
|
|
|
@ ${MKDIR} ${PREFIX}/${INSTALL_DIR}
|
1999-01-01 07:19:45 +00:00
|
|
|
@ ${SETENV} INSTALL_DIR=${INSTALL_DIR} \
|
|
|
|
PGSQL_UID=${PGSQL_UID} PGSQL_GID=${PGSQL_GID} \
|
1999-04-17 19:43:23 +00:00
|
|
|
PKG_PREFIX=${PREFIX} \
|
2000-10-08 10:23:48 +00:00
|
|
|
${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
|
1998-09-08 15:30:19 +00:00
|
|
|
post-install:
|
|
|
|
@ if [ ! -f ${PREFIX}/${INSTALL_DIR}/.profile ]; then \
|
|
|
|
${ECHO} "PATH=${PATH}:${PREFIX}/${INSTALL_DIR}/bin" \
|
|
|
|
> ${PREFIX}/${INSTALL_DIR}/.profile; \
|
|
|
|
${ECHO} "MANPATH=${MANPATH}:${PREFIX}/${INSTALL_DIR}/bin" \
|
|
|
|
>> ${PREFIX}/${INSTALL_DIR}/.profile; \
|
|
|
|
${ECHO} "PGLIB=${PREFIX}/${INSTALL_DIR}/lib" \
|
|
|
|
>> ${PREFIX}/${INSTALL_DIR}/.profile; \
|
|
|
|
${ECHO} "# note: PGDATA overwrites the -D startup option" \
|
|
|
|
>> ${PREFIX}/${INSTALL_DIR}/.profile; \
|
|
|
|
${ECHO} "PGDATA=${PREFIX}/${INSTALL_DIR}/data" \
|
|
|
|
>> ${PREFIX}/${INSTALL_DIR}/.profile; \
|
|
|
|
${ECHO} "DISPLAY=:0" \
|
|
|
|
>> ${PREFIX}/${INSTALL_DIR}/.profile; \
|
|
|
|
${ECHO} "export PATH MANPATH PGLIB PGDATA DISPLAY" \
|
|
|
|
>> ${PREFIX}/${INSTALL_DIR}/.profile; \
|
|
|
|
${ECHO} "# if you want to make regression tests use this TZ" \
|
|
|
|
>> ${PREFIX}/${INSTALL_DIR}/.profile; \
|
|
|
|
${ECHO} "#TZ=PST8PDT" \
|
|
|
|
>> ${PREFIX}/${INSTALL_DIR}/.profile; \
|
|
|
|
${ECHO} "#export TZ" \
|
|
|
|
>> ${PREFIX}/${INSTALL_DIR}/.profile; \
|
|
|
|
fi
|
1999-08-22 19:01:07 +00:00
|
|
|
@ ${CHOWN} -R ${PGSQL_UID}:${PGSQL_GID} ${PREFIX}/${INSTALL_DIR}
|
1998-09-08 15:30:19 +00:00
|
|
|
@ ${ECHO} 'Initializing PostgreSQL Databases - this may take a few minutes...'
|
|
|
|
@ ${LDCONFIG} -m ${PREFIX}/${INSTALL_DIR}/lib
|
1999-01-01 07:19:45 +00:00
|
|
|
@ /usr/bin/su -l ${PGSQL_UID} -c '${PREFIX}/${INSTALL_DIR}/bin/initdb --pglib=${PREFIX}/${INSTALL_DIR}/lib --pgdata=${PREFIX}/${INSTALL_DIR}/data'
|
1998-09-08 15:30:19 +00:00
|
|
|
@ ${SED} "s=!!PG_PATH!!=${PREFIX}/${INSTALL_DIR}=g ; s=!!PGSQL_UID!!=${PGSQL_UID}=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_GID} ${PREFIX}/etc/rc.d/pgsql.sh
|
1998-09-08 15:30:19 +00:00
|
|
|
@ ${INSTALL_DATA} ${FILESDIR}/post-install-notes ${PREFIX}/${INSTALL_DIR}
|
|
|
|
.if !defined(NOPORTDOCS)
|
|
|
|
${MKDIR} ${PREFIX}/share/doc/${INSTALL_DIR}
|
1999-11-23 11:04:43 +00:00
|
|
|
${CP} -R ${WRKDIR}/${DISTNAME}/doc/* ${PREFIX}/share/doc/${INSTALL_DIR}
|
|
|
|
.for f in . src src/sgml src/sgml/ref src/graphics
|
|
|
|
@${RM} -rf ${PREFIX}/share/doc/${INSTALL_DIR}/$f/CVS
|
|
|
|
@${RM} -f ${PREFIX}/share/doc/${INSTALL_DIR}/$f/#cvs*
|
1999-04-16 17:03:02 +00:00
|
|
|
.endfor
|
1998-09-08 15:30:19 +00:00
|
|
|
.endif
|
|
|
|
.if !defined(BATCH)
|
|
|
|
@ more -e ${FILESDIR}/post-install-notes
|
|
|
|
.endif
|
|
|
|
|
1999-01-01 07:19:45 +00:00
|
|
|
.include <bsd.port.post.mk>
|