diff options
author | jlam <jlam@pkgsrc.org> | 2001-11-19 16:23:08 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2001-11-19 16:23:08 +0000 |
commit | b23d2e86260aaa8ed2013bf77ad605b63e34b0ed (patch) | |
tree | d5fafec9bfc1b14f6b1c5da4d0c45beb2b4758b4 /databases | |
parent | c850f81b615ba9e58563fe40c1075ad3aea9ffa4 (diff) | |
download | pkgsrc-b23d2e86260aaa8ed2013bf77ad605b63e34b0ed.tar.gz |
Adapt to use shared INSTALL/DEINSTALL scripts by using the logic in
bsd.pkg.install.mk:
* Remove old DEINSTALL/INSTALL scripts.
* Move some text printed at POST-INSTALL time into the MESSAGE file.
* Adjust rc.d scripts to respect rc.conf settings, so that the
script may be directly copied into /etc/rc.d.
Diffstat (limited to 'databases')
-rw-r--r-- | databases/postgresql-server/DEINSTALL | 38 | ||||
-rw-r--r-- | databases/postgresql-server/INSTALL | 69 | ||||
-rw-r--r-- | databases/postgresql-server/Makefile | 51 | ||||
-rw-r--r-- | databases/postgresql-server/files/pgsql.sh | 6 | ||||
-rw-r--r-- | databases/unixodbc/DEINSTALL | 100 | ||||
-rw-r--r-- | databases/unixodbc/INSTALL | 62 | ||||
-rw-r--r-- | databases/unixodbc/Makefile | 32 | ||||
-rw-r--r-- | databases/unixodbc/Makefile.common | 4 |
8 files changed, 27 insertions, 335 deletions
diff --git a/databases/postgresql-server/DEINSTALL b/databases/postgresql-server/DEINSTALL index 78f834b41c8..aab9c52f4b3 100644 --- a/databases/postgresql-server/DEINSTALL +++ b/databases/postgresql-server/DEINSTALL @@ -1,17 +1,4 @@ -#!/bin/sh -# -# $NetBSD: DEINSTALL,v 1.1 2001/11/01 00:12:41 zuntum Exp $ -# - -PKGNAME=$1 -STAGE=$2 - -USER="@PGUSER@" -GROUP="@PGGROUP@" -PGHOME="@PGHOME@" - -CAT="@CAT@" -RM="@RM@" +# $NetBSD: DEINSTALL,v 1.2 2001/11/19 16:23:08 jlam Exp $ case ${STAGE} in DEINSTALL) @@ -30,27 +17,4 @@ perform the databases dump. =========================================================================== EOF ;; - -POST-DEINSTALL) - ${CAT} << EOF -=========================================================================== -If you won't be using ${PKGNAME} any longer, you may want -to remove: - - * the \`${USER}' user - - * the \`${GROUP}' group - - * the following directories: - - ${PGHOME} -=========================================================================== -EOF - ;; - -*) - echo "Unexpected argument: ${STAGE}" - exit 1 - ;; esac -exit 0 diff --git a/databases/postgresql-server/INSTALL b/databases/postgresql-server/INSTALL deleted file mode 100644 index 6bd3f913bed..00000000000 --- a/databases/postgresql-server/INSTALL +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# -# $NetBSD: INSTALL,v 1.1 2001/11/01 00:12:41 zuntum Exp $ - -PKGNAME=$1 -STAGE=$2 - -USER=@PGUSER@ -GROUP=@PGGROUP@ -PGHOME=@PGHOME@ - -ADDUSER="@ADDUSER@" -ADDGROUP="@ADDGROUP@" -CHGRP="@CHGRP@" -CHOWN="@CHOWN@" -ID="@ID@" -MKDIR="@MKDIR@" -RM="@RM@" -SU="@SU@" -TOUCH="@TOUCH@" - -case ${STAGE} in -PRE-INSTALL) - # 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. - # - ${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..." - ${ADDGROUP} ${GROUP} - echo "Done." - fi - ${RM} -f "/tmp/grouptest.$$" - - # Use `id' to be able to use NIS. - # - ${ID} ${USER} 2>/dev/null >/dev/null - if [ $? -eq 0 ] - then - echo "User '${USER}' already exists...proceeding." - else - echo "Creating '${USER}' user..." - ${ADDUSER} \ - -c "PostgreSQL database administrator" \ - -d ${PGHOME} \ - -g ${GROUP} \ - -s /bin/sh \ - ${USER} - ${RM} -f ${PGHOME}/.profile - echo "Done." - fi - ${MKDIR} ${PGHOME} - ${CHOWN} -R ${USER}:${GROUP} ${PGHOME} - ;; - -POST-INSTALL) - ;; - -*) - echo "Unexpected argument: ${STAGE}" - exit 1 - ;; -esac -exit 0 diff --git a/databases/postgresql-server/Makefile b/databases/postgresql-server/Makefile index 164d623db1c..201f5f3552e 100644 --- a/databases/postgresql-server/Makefile +++ b/databases/postgresql-server/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.12 2001/08/20 03:55:32 jlam Exp $ +# $NetBSD: Makefile,v 1.13 2001/11/19 16:23:08 jlam Exp $ .include "../../databases/postgresql/Makefile.common" .include "../../databases/postgresql/Makefile.ssl" @@ -23,46 +23,22 @@ DIRS_TO_BUILD= src/backend # PGGROUP group of the database administrator # PGHOME home directory of the database administrator and location of # the databases - +# PGUSER?= pgsql PGGROUP?= pgsql PGHOME?= ${PREFIX}/${PGUSER} BUILD_DEFS= PGUSER PGROUP PGHOME -.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 -.else -ADDUSER= useradd -ADDGROUP= groupadd -.endif - -DEINSTALL_FILE= ${WRKDIR}/DEINSTALL -INSTALL_FILE= ${WRKDIR}/INSTALL - -FILES_SUBST= PREFIX=${PREFIX} -FILES_SUBST+= PGUSER=${PGUSER} -FILES_SUBST+= PGGROUP=${PGGROUP} -FILES_SUBST+= PGHOME=${PGHOME} - -FILES_SUBST+= ADDUSER=${ADDUSER:Q} -FILES_SUBST+= ADDGROUP=${ADDGROUP:Q} -FILES_SUBST+= CAT=${CAT:Q} -FILES_SUBST+= CHGRP=${CHGRP:Q} -FILES_SUBST+= CHOWN=${CHOWN:Q} -FILES_SUBST+= ID=${ID:Q} -FILES_SUBST+= MKDIR=${MKDIR:Q} -FILES_SUBST+= RM=${RM:Q} -FILES_SUBST+= SU=${SU:Q} -FILES_SUBST+= TOUCH=${TOUCH:Q} - -FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/} +PKG_USER= ${PGUSER} +PKG_USER_DESCR= PostgreSQL database administrator +PKG_USER_HOME= ${PGHOME} +PKG_USER_SHELL= ${SH} +PKG_GROUP= ${PGGROUP} + +RCD_SCRIPTS= ${PREFIX}/etc/rc.d/pgsql /etc/rc.d/pgsql +OWN_DIRS_PERMS= ${PGHOME} ${PGUSER} ${PGGROUP} 0755 + +DEINSTALL_EXTRA_TMPL= ${PKGDIR}/DEINSTALL do-build: .for DIR in ${DIRS_TO_BUILD} @@ -84,8 +60,6 @@ pre-install: esac ${SED} ${FILES_SUBST_SED} ${FILESDIR}/pgsql.sh > ${WRKDIR}/pgsql.sh - ${SED} ${FILES_SUBST_SED} ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE} - ${SED} ${FILES_SUBST_SED} ${PKGDIR}/INSTALL > ${INSTALL_FILE} PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL do-install: @@ -102,4 +76,5 @@ post-install: .include "../../devel/libgetopt/buildlink.mk" .include "../../databases/postgresql-lib/buildlink.mk" +.include "../../mk/bsd.pkg.install.mk" .include "../../mk/bsd.pkg.mk" diff --git a/databases/postgresql-server/files/pgsql.sh b/databases/postgresql-server/files/pgsql.sh index 7c422f2d88f..c3a19767ed2 100644 --- a/databases/postgresql-server/files/pgsql.sh +++ b/databases/postgresql-server/files/pgsql.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: pgsql.sh,v 1.4 2001/05/14 21:19:42 jlam Exp $ +# $NetBSD: pgsql.sh,v 1.5 2001/11/19 16:23:08 jlam Exp $ # # PostgreSQL database rc.d control script # @@ -8,11 +8,11 @@ # REQUIRE: DAEMON # KEYWORD: shutdown -PGHOME=@PGHOME@ +PGHOME=@PKG_USER_HOME@ name="pgsql" rcvar=$name -pgsql_user="@PGUSER@" +pgsql_user="@PKG_USER@" command="@PREFIX@/bin/pg_ctl" command_args="-s -D ${PGHOME}/data -l ${PGHOME}/errlog" diff --git a/databases/unixodbc/DEINSTALL b/databases/unixodbc/DEINSTALL deleted file mode 100644 index f12ac349993..00000000000 --- a/databases/unixodbc/DEINSTALL +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh -# -# $NetBSD: DEINSTALL,v 1.1.1.1 2001/11/06 04:08:33 jlam Exp $ - -PKGNAME=$1 -STAGE=$2 - -CAT="@CAT@" -CMP="@CMP@" -ECHO="@ECHO@" -RM="@RM@" -RMDIR="@RMDIR@" -TR="@TR@" -TRUE="@TRUE@" - -SAMPLECONFDIR=${PKG_PREFIX}/share/examples/@PKGBASE@ -CONFDIR=/etc - -CONFFILES=" \ - ${SAMPLECONFDIR}/odbcinst.ini ${CONFDIR}/odbcinst.ini : \ - /dev/null ${CONFDIR}/odbc.ini \ - " - -case ${STAGE} in -DEINSTALL) - # Remove configuration files if they don't differ from the default - # config file. - # - ${ECHO} ${CONFFILES} | ${TR} ":" "\012" | while read SAMPLEFILE FILE - do - if ${CMP} -s ${FILE} ${SAMPLEFILE} - then - ${RM} -f ${FILE} - fi - done - ;; - -POST-DEINSTALL) - modified_files='' - for FILE in ${CONFFILES} - do - if [ -f ${FILE} ] - then - modified_files="${modified_files} ${FILE}" - fi - done - - ${RMDIR} ${CONFDIR}/ODBCDataSources 2>/dev/null || ${TRUE} - - existing_dirs='' - for dir in ${CONFDIR}/ODBCDataSources - do - if [ -d ${dir} ] - then - existing_dirs="${existing_dirs} ${dir}" - fi - done - - if [ -n "${modified_files}" -o -n "${existing_dirs}" ] - then - ${CAT} << EOF -=========================================================================== -If you won't be using ${PKGNAME} any longer, you may want to remove: -EOF - if [ -n "${modified_files}" ] - then - ${CAT} << EOF - - * the following files: - -EOF - for file in ${modified_files} - do - ${ECHO} " ${file}" - done - fi - if [ -n "${existing_dirs}" ] - then - ${CAT} << EOF - - * the following directories: - -EOF - for dir in ${existing_dirs} - do - ${ECHO} " ${dir}" - done - fi - ${CAT} << EOF -=========================================================================== -EOF - fi - ;; - -*) - ${ECHO} "Unexpected argument: ${STAGE}" - exit 1 - ;; -esac -exit 0 diff --git a/databases/unixodbc/INSTALL b/databases/unixodbc/INSTALL deleted file mode 100644 index e2ede9bceca..00000000000 --- a/databases/unixodbc/INSTALL +++ /dev/null @@ -1,62 +0,0 @@ -#! /bin/sh -# -# $NetBSD: INSTALL,v 1.1.1.1 2001/11/06 04:08:33 jlam Exp $ - -PKGNAME=$1 -STAGE=$2 - -CAT="@CAT@" -CHMOD="@CHMOD@" -CP="@CP@" -ECHO="@ECHO@" -MKDIR="@MKDIR@" -TR="@TR@" - -SAMPLECONFDIR=${PKG_PREFIX}/share/examples/@PKGBASE@ -CONFDIR=/etc - -CONFFILES=" \ - ${SAMPLECONFDIR}/odbcinst.ini ${CONFDIR}/odbcinst.ini : \ - /dev/null ${CONFDIR}/odbc.ini \ - " - -case ${STAGE} in -PRE-INSTALL) - ;; - -POST-INSTALL) - ${MKDIR} ${CONFDIR}/ODBCDataSources - - ${ECHO} "Installing configuration files:" - ${ECHO} ${CONFFILES} | ${TR} ":" "\012" | while read SAMPLEFILE FILE - do - if [ -f ${FILE} ] - then - ${ECHO} " ${FILE} already exists" - else - ${ECHO} " ${FILE}" - ${CP} ${SAMPLEFILE} ${FILE} - ${CHMOD} 644 ${FILE} - fi - done - ${CAT} << EOF - -=========================================================================== -You may wish to customize the following files: - -EOF - ${ECHO} ${CONFFILES} | ${TR} ":" "\012" | while read SAMPLEFILE FILE - do - ${ECHO} " ${FILE}" - done - ${CAT} << EOF -=========================================================================== -EOF - ;; - -*) - ${ECHO} "Unexpected argument: ${STAGE}" - exit 1 - ;; -esac -exit 0 diff --git a/databases/unixodbc/Makefile b/databases/unixodbc/Makefile index 359db49ab39..4bde02d67a2 100644 --- a/databases/unixodbc/Makefile +++ b/databases/unixodbc/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1.1.1 2001/11/06 04:08:33 jlam Exp $ +# $NetBSD: Makefile,v 1.2 2001/11/19 16:23:09 jlam Exp $ PKGNAME= unixodbc-${ODBC_VERS} ODBC_PKG_VERS= # empty @@ -11,37 +11,20 @@ USE_BUILDLINK_ONLY= YES CONFIGURE_ARGS+= --disable-gui -EGDIR= ${PREFIX}/share/examples/${PKGBASE} - -DEINSTALL_FILE= ${WRKDIR}/DEINSTALL -INSTALL_FILE= ${WRKDIR}/INSTALL - -PLIST_SUBST+= PKGBASE=${PKGBASE} PLIST_SUBST+= UNIXODBC_DRIVERS_DIR=${UNIXODBC_DRIVERS_DIR} - -FILES_SUBST+= PKGBASE=${PKGBASE} FILES_SUBST+= UNIXODBC_DRIVERS_DIR=${UNIXODBC_DRIVERS_DIR} -FILES_SUBST+= PREFIX=${PREFIX} -FILES_SUBST+= PKGBASE=${PKGBASE} -FILES_SUBST+= CAT=${CAT:Q} -FILES_SUBST+= CHMOD=${CHMOD:Q} -FILES_SUBST+= CMP=${CMP:Q} -FILES_SUBST+= CP=${CP:Q} -FILES_SUBST+= ECHO=${ECHO:Q} -FILES_SUBST+= MKDIR=${MKDIR:Q} -FILES_SUBST+= RM=${RM:Q} -FILES_SUBST+= RMDIR=${RMDIR:Q} -FILES_SUBST+= TR=${TR:Q} -FILES_SUBST+= TRUE=${TRUE:Q} -FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/} + +EGDIR= ${PREFIX}/share/examples/${PKGBASE} + +CONF_FILES= ${EGDIR}/odbcinst.ini ${CONFDIR}/odbcinst.ini +CONF_FILES+= /dev/null ${CONFDIR}/odbc.ini +OWN_DIRS= ${CONFDIR}/ODBCDataSources post-patch: fix-driver-installation pre-install: ${SED} ${FILES_SUBST_SED} ${FILESDIR}/odbcinst.ini.in \ > ${WRKDIR}/odbcinst.ini - ${SED} ${FILES_SUBST_SED} ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE} - ${SED} ${FILES_SUBST_SED} ${PKGDIR}/INSTALL > ${INSTALL_FILE} PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL post-install: @@ -50,4 +33,5 @@ post-install: PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL .include "../../devel/readline/buildlink.mk" +.include "../../mk/bsd.pkg.install.mk" .include "../../mk/bsd.pkg.mk" diff --git a/databases/unixodbc/Makefile.common b/databases/unixodbc/Makefile.common index 2e17e6ace0d..81d2737940c 100644 --- a/databases/unixodbc/Makefile.common +++ b/databases/unixodbc/Makefile.common @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.common,v 1.2 2001/11/07 06:12:19 jlam Exp $ +# $NetBSD: Makefile.common,v 1.3 2001/11/19 16:23:09 jlam Exp $ DISTNAME= unixODBC-${ODBC_DIST_VERS} CATEGORIES= databases @@ -23,7 +23,7 @@ USE_LIBTOOL= YES LIBTOOL_OVERRIDE= ${WRKSRC}/libtool GNU_CONFIGURE= YES -CONFIGURE_ARGS+= --sysconfdir=/etc +CONFIGURE_ARGS+= --sysconfdir=${CONFDIR} CONFIGURE_ARGS+= --enable-threads CONFIGURE_ARGS+= --enable-gnuthreads CONFIGURE_ARGS+= --with-pth=${BUILDLINK_DIR} |