From b17e00bb5f3e1cc2730e6b65406da79f153ed65b Mon Sep 17 00:00:00 2001 From: jlam Date: Mon, 11 Dec 2000 16:43:11 +0000 Subject: Cosmetic adjustments. --- databases/postgresql/Makefile | 54 +++++++++++++++++++++---------- databases/postgresql/Makefile.common | 7 +++-- databases/postgresql/pkg/DEINSTALL | 20 +++++++++--- databases/postgresql/pkg/INSTALL | 61 +++++++++++++++++++++++++----------- databases/tcl-postgresql/Makefile | 18 ++++++----- databases/tk-postgresql/Makefile | 22 +++++++------ 6 files changed, 122 insertions(+), 60 deletions(-) (limited to 'databases') diff --git a/databases/postgresql/Makefile b/databases/postgresql/Makefile index 6fab898c58e..10e9b411977 100644 --- a/databases/postgresql/Makefile +++ b/databases/postgresql/Makefile @@ -1,23 +1,19 @@ -# $NetBSD: Makefile,v 1.56 2000/12/07 16:57:54 jlam Exp $ +# $NetBSD: Makefile,v 1.57 2000/12/11 16:43:11 jlam Exp $ # FreeBSD Id: Makefile,v 1.22 1997/12/24 01:21:37 alex Exp # +.include "../../databases/postgresql/Makefile.common" + +# NetBSD libedit's readline emulation doesn't support enough features, yet. 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 +.include "../../mk/bsd.prefs.mk" + # PGUSER username of the database administrator # PGGROUP group of the database administrator # @@ -39,6 +35,20 @@ CONFIGURE_ARGS+= --without-perl --without-odbc --without-tcl CONFIGURE_ARGS+= --with-includes="${LOCALBASE}/include" CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" +.if ${OPSYS} == "NetBSD" +.if exists(/usr/sbin/user) +ADDUSER= /usr/sbin/useradd +ADDGROUP= /usr/sbin/groupadd +.else +DEPENDS+= user>=20000313:../../sysutils/user +ADDUSER= ${LOCALBASE}/sbin/useradd +ADDGROUP= ${LOCALBASE}/sbin/groupadd +.endif +.elif ${OPSYS} == "SunOS" +ADDUSER= useradd +ADDGROUP= groupadd +.endif + pre-install: @case "X${PGUSER}" in \ Xbin|Xetc|Xinclude|Xinfo|Xlib|Xlibdata|Xlibexec|Xman|Xsbin|Xshare) \ @@ -53,10 +63,23 @@ pre-install: esac ${SED} -e 's|@PGUSER@|${PGUSER}|g' \ + -e "s,@PGGROUP@,${PGGROUP},g" \ + -e "s,@CAT@,${CAT},g" \ < ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE} - ${SED} -e 's|@PGUSER@|${PGUSER}|g' \ - -e 's|@PGGROUP@|${PGGROUP}|g' \ - -e 's|@USERDIR@|${USERDIR}|g' \ + ${SED} -e "s,@PGUSER@,${PGUSER},g" \ + -e "s,@PGGROUP@,${PGGROUP},g" \ + -e "s,@ADDUSER@,${ADDUSER},g" \ + -e "s,@ADDGROUP@,${ADDGROUP},g" \ + -e "s,@CAT@,${CAT},g" \ + -e "s,@CHGRP@,${CHGRP},g" \ + -e "s,@CHMOD@,${CHMOD},g" \ + -e "s,@CHOWN@,${CHOWN},g" \ + -e "s,@CP@,${CP},g" \ + -e "s,@GREP@,${GREP},g" \ + -e "s,@MKDIR@,${MKDIR},g" \ + -e "s,@RM@,${RM},g" \ + -e "s,@SU@,${SU},g" \ + -e "s,@TOUCH@,${TOUCH},g" \ < ${PKGDIR}/INSTALL > ${INSTALL_FILE} PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL @@ -88,8 +111,7 @@ post-install: ${SED} -e "s|@PREFIX@|${PREFIX}|g" \ -e "s|@PGUSER@|${PGUSER}|g" \ < ${FILESDIR}/pgsql.sh.tmpl > ${WRKDIR}/pgsql.sh - ${INSTALL} -c -o root -g ${PGGROUP} -m 554 \ - ${WRKDIR}/pgsql.sh ${PREFIX}/etc/rc.d/pgsql + ${INSTALL_SCRIPT} ${WRKDIR}/pgsql.sh ${PREFIX}/etc/rc.d/pgsql ${CAT} ${FILESDIR}/exclude ${FILESDIR}/man.tcl ${FILESDIR}/man.tk \ | ${SED} "s,^#.*,," \ @@ -109,4 +131,4 @@ post-install: PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL -.include "../../databases/postgresql/Makefile.common" +.include "../../mk/bsd.pkg.mk" diff --git a/databases/postgresql/Makefile.common b/databases/postgresql/Makefile.common index 4eaa7f77d7f..e7d327763f7 100644 --- a/databases/postgresql/Makefile.common +++ b/databases/postgresql/Makefile.common @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.common,v 1.6 2000/12/08 17:16:32 jlam Exp $ +# $NetBSD: Makefile.common,v 1.7 2000/12/11 16:43:11 jlam Exp $ # # This file is included by the following packages: # @@ -51,10 +51,11 @@ CONFIGURE_ARGS+= --enable-multibyte=${PG_MB_ENCODING} CONFIGURE_ARGS+= --enable-multibyte # accept default .endif +# Pass CFLAGS from environment into the PostgreSQL build. +MAKE_ENV+= COPT="${CFLAGS}" + post-extract: ${CP} ${FILESDIR}/Makefile.custom ${WRKSRC} pre-configure: cd ${WRKSRC} && autoreconf - -.include "../../mk/bsd.pkg.mk" diff --git a/databases/postgresql/pkg/DEINSTALL b/databases/postgresql/pkg/DEINSTALL index 8fa07fc6f2b..a4be1f0cce5 100644 --- a/databases/postgresql/pkg/DEINSTALL +++ b/databases/postgresql/pkg/DEINSTALL @@ -1,12 +1,16 @@ #!/bin/sh # -# $NetBSD: DEINSTALL,v 1.3 2000/12/07 16:56:41 jlam Exp $ +# $NetBSD: DEINSTALL,v 1.4 2000/12/11 16:43:12 jlam Exp $ # PKGNAME=$1 STAGE=$2 -USER=@PGUSER@ +USER="@PGUSER@" +GROUP="@PGGROUP@" + +CAT="@CAT@" + PGHOME=${PKG_PREFIX}/${USER} case ${STAGE} in @@ -14,10 +18,16 @@ DEINSTALL) ;; POST-DEINSTALL) - cat << EOF + ${CAT} << EOF =========================================================================== -If you won't be using ${PKGNAME} any longer, you may want to -remove the \`${USER}' user and the following directories: +If you won't be using ${PKGNAME} any longer, you may want +to remove: + + * the \`${USER}' user + + * the \`${GROUP}' group + + * the following directories: ${PGHOME} =========================================================================== diff --git a/databases/postgresql/pkg/INSTALL b/databases/postgresql/pkg/INSTALL index 9fccc75d701..b2a181ca822 100644 --- a/databases/postgresql/pkg/INSTALL +++ b/databases/postgresql/pkg/INSTALL @@ -1,40 +1,58 @@ #!/bin/sh # -# $NetBSD: INSTALL,v 1.2 2000/12/07 16:56:41 jlam Exp $ +# $NetBSD: INSTALL,v 1.3 2000/12/11 16:43:12 jlam Exp $ PKGNAME=$1 STAGE=$2 USER=@PGUSER@ GROUP=@PGGROUP@ -USERDIR=@USERDIR@ + +ADDUSER="@ADDUSER@" +ADDGROUP="@ADDGROUP@" +CAT="@CAT@" +CHGRP="@CHGRP@" +CHMOD="@CHMOD@" +CHOWN="@CHOWN@" +CP="@CP@" +GREP="@GREP@" +MKDIR="@MKDIR@" +RM="@RM@" +SU="@SU@" +TOUCH="@TOUCH@" + PGHOME=${PKG_PREFIX}/${USER} case ${STAGE} in PRE-INSTALL) - echo ------------------------------------------------------------ - echo Dump existing databases, before installing new db version !! - echo ------------------------------------------------------------ - + ${CAT} << EOF +------------------------------------------------------------ +Dump existing databases, before installing new db version !! +------------------------------------------------------------ +EOF # Group... the default's shipped with NetBSD # We need to check that ${GROUP} exists before adding the user. + # Do it with chgrp to be able to use NIS. # - if ${USERDIR}/group info -e ${GROUP} + ${TOUCH} "/tmp/grouptest.$$" + ${CHGRP} ${GROUP} "/tmp/grouptest.$$" >/dev/null 2>&1 + if [ $? -eq 0 ] then echo "Group '${GROUP}' already exists...proceeding." else echo "Creating '${GROUP}' group..." - ${USERDIR}/group add ${GROUP} + ${ADDGROUP} ${GROUP} echo "Done." fi + ${RM} -f "/tmp/grouptest.$$" - # use finger to be able to use NIS, ... + # Use `finger' to be able to use NIS. # - mkdir -p ${PGHOME} - if finger ${USER} 2>&1 | grep >/dev/null "no such user" + finger ${USER} 2>&1 | ${GREP} -q "no such user" + if [ $? -eq 0 ] then echo "Creating '${USER}' user..." - ${USERDIR}/user add \ + ${ADDUSER} \ -c "PostgreSQL database administrator" \ -b ${PKG_PREFIX} \ -g ${GROUP} -s /bin/sh ${USER} @@ -42,20 +60,25 @@ PRE-INSTALL) else echo "User '${USER}' already exists...proceeding." fi - chown -R ${USER}:${GROUP} ${PGHOME} + ${MKDIR} ${PGHOME} + ${CHOWN} -R ${USER}:${GROUP} ${PGHOME} ;; + POST-INSTALL) if [ ! -f ${PGHOME}/.profile ]; then - cp ${PGHOME}/.profile.pgsql ${PGHOME}/.profile + ${CP} ${PGHOME}/.profile.pgsql ${PGHOME}/.profile + ${CHMOD} 644 ${PGHOME}/.profile fi - echo ------------------------------------------------------------------ - echo Initializing PostgreSQL Databases - this may take a few minutes... - echo ------------------------------------------------------------------ - echo "${PKG_PREFIX}/bin/initdb --pglib=${PKG_PREFIX}/share/postgresql --pgdata=${PGHOME}/data" | su -l ${USER} + ${CAT} << EOF +------------------------------------------------------------------ +Initializing PostgreSQL Databases - this may take a few minutes... +------------------------------------------------------------------ +EOF + echo "${PKG_PREFIX}/bin/initdb --pglib=${PKG_PREFIX}/share/postgresql --pgdata=${PGHOME}/data" | ${SU} -l ${USER} ;; *) - echo "Unexpected argument: $2" + echo "Unexpected argument: ${STAGE}" exit 1 ;; esac diff --git a/databases/tcl-postgresql/Makefile b/databases/tcl-postgresql/Makefile index edbabafe9c5..5cde60b2ebe 100644 --- a/databases/tcl-postgresql/Makefile +++ b/databases/tcl-postgresql/Makefile @@ -1,14 +1,16 @@ -# $NetBSD: Makefile,v 1.3 2000/09/01 14:20:17 jwise Exp $ +# $NetBSD: Makefile,v 1.4 2000/12/11 16:43:12 jlam Exp $ + +.include "../../databases/postgresql/Makefile.common" PKGNAME= tcl-${DISTNAME} DEPENDS+= postgresql-${PG_VERS}:../../databases/postgresql -DEPENDS+= tcl-8.3.2:../../lang/tcl +DEPENDS+= tcl>=8.3.2:../../lang/tcl -TCLSH= ${LOCALBASE}/bin/tclsh -TCL_INCDIR= ${LOCALBASE}/include -TCL_CONFIGDIR= ${LOCALBASE}/lib -USE_LIBTOOL= +EVAL_PREFIX+= TCLDIR=tcl +TCLSH= ${TCLDIR}/bin/tclsh +TCL_INCDIR= ${TCLDIR}/include +TCL_CONFIGDIR= ${TCLDIR}/lib MAKE_ENV+= INSTALLED_LIBPQ=1 @@ -16,7 +18,7 @@ CONFIGURE_ARGS+= --without-perl --without-odbc CONFIGURE_ARGS+= --with-tcl \ --with-tclconfig="${TCL_CONFIGDIR}" \ --with-includes="${TCL_INCDIR}" \ - --with-libraries="${LOCALBASE}/lib" + --with-libraries="${LOCALBASE}/lib ${TCLDIR}/lib" CONFIGURE_ENV+= TCLSH="${TCLSH}" DIRS_TO_BUILD= interfaces/libpgtcl \ @@ -39,4 +41,4 @@ do-install: ${WRKDIR}/${DISTNAME}/doc/man.tar.gz \ `${SED} -e "s/#.*//" ${FILESDIR}/man.tcl` -.include "../../databases/postgresql/Makefile.common" +.include "../../mk/bsd.pkg.mk" diff --git a/databases/tk-postgresql/Makefile b/databases/tk-postgresql/Makefile index 684cc532b1a..b46a8b9c72d 100644 --- a/databases/tk-postgresql/Makefile +++ b/databases/tk-postgresql/Makefile @@ -1,16 +1,20 @@ -# $NetBSD: Makefile,v 1.3 2000/09/01 14:34:21 jwise Exp $ +# $NetBSD: Makefile,v 1.4 2000/12/11 16:43:13 jlam Exp $ + +.include "../../databases/postgresql/Makefile.common" PKGNAME= tk-${DISTNAME} DEPENDS+= tcl-postgresql-${PG_VERS}:../../databases/tcl-postgresql -DEPENDS+= tk-8.3.2:../../x11/tk +DEPENDS+= tk>=8.3.2:../../x11/tk -TCLSH= ${LOCALBASE}/bin/tclsh -TCL_INCDIR= ${LOCALBASE}/include -TCL_CONFIGDIR= ${LOCALBASE}/lib +EVAL_PREFIX+= TCLDIR=tcl +TCLSH= ${TCLDIR}/bin/tclsh +TCL_INCDIR= ${TCLDIR}/include +TCL_CONFIGDIR= ${TCLDIR}/lib -TK_INCDIR= ${LOCALBASE}/include -TK_CONFIGDIR= ${LOCALBASE}/lib +EVAL_PREFIX+= TKDIR=tk +TK_INCDIR= ${TKDIR}/include +TK_CONFIGDIR= ${TKDIR}/lib USE_X11= # defined @@ -21,7 +25,7 @@ CONFIGURE_ARGS+= --with-tcl \ --with-tclconfig="${TCL_CONFIGDIR}" \ --with-tkconfig="${TK_CONFIGDIR}" \ --with-includes="${TCL_INCDIR} ${TK_INCDIR}" \ - --with-libraries="${LOCALBASE}/lib" + --with-libraries="${LOCALBASE}/lib ${TCLDIR}/lib ${TKDIR}/lib" CONFIGURE_ENV+= TCLSH="${TCLSH}" do-build: @@ -36,4 +40,4 @@ do-install: ${WRKDIR}/${DISTNAME}/doc/man.tar.gz \ `${SED} -e "s/#.*//" ${FILESDIR}/man.tk` -.include "../../databases/postgresql/Makefile.common" +.include "../../mk/bsd.pkg.mk" -- cgit v1.2.3