summaryrefslogtreecommitdiff
path: root/databases/postgresql-server
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2001-11-19 16:23:08 +0000
committerjlam <jlam@pkgsrc.org>2001-11-19 16:23:08 +0000
commitb23d2e86260aaa8ed2013bf77ad605b63e34b0ed (patch)
treed5fafec9bfc1b14f6b1c5da4d0c45beb2b4758b4 /databases/postgresql-server
parentc850f81b615ba9e58563fe40c1075ad3aea9ffa4 (diff)
downloadpkgsrc-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/postgresql-server')
-rw-r--r--databases/postgresql-server/DEINSTALL38
-rw-r--r--databases/postgresql-server/INSTALL69
-rw-r--r--databases/postgresql-server/Makefile51
-rw-r--r--databases/postgresql-server/files/pgsql.sh6
4 files changed, 17 insertions, 147 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"