forked from Lainports/freebsd-ports
PR: ports/22530
Submitted by: Tomokatsu Saito <saito@a2z.co.jp> (MAINTAINER)
Prepare for the future merger with databases/postgresql7.
- Fix broken plist's by copying from those of databases/postgresql7.
- Previous plist removed all the precious user data mercilessly. :(
DO NOT PERFORM A "pkg_delete" AGAINST THE PREVIOUS INSTALLATION!
YOU WILL LOSE ALL THE DATA STORED IN "${PREFIX}/pgsql/data"!!!
- A bunch of missing entries have been added for pgacess files to
plist.tcl.
- Fix permissions for ${PREFIX}/pgsql/lib to avoid causing a security
error when doing ldconfig.
- Make scripts PREFIX-safe.
- Synchronize with databases/postgresql7.
- Standardize variable names.
- Complete user friendly messages.
- Move the Java class files to the standard directory..
- Minor cleanups.
I hope the merger will be accomplished in near future.
44 lines
927 B
Bash
44 lines
927 B
Bash
#! /bin/sh
|
|
|
|
# $FreeBSD: /tmp/pcvs/ports/japanese/postgresql7/Attic/pkg-install,v 1.5 2000-11-03 09:34:11 knu Exp $
|
|
|
|
PATH=/bin:/usr/sbin
|
|
|
|
if [ -z "${DB_DIR}" ]; then
|
|
DB_DIR=${PKG_PREFIX}/pgsql/data
|
|
fi
|
|
|
|
case $2 in
|
|
POST-INSTALL)
|
|
USER=pgsql
|
|
GROUP=${USER}
|
|
UID=89
|
|
GID=${UID}
|
|
|
|
if pw group show "${GROUP}" 2>/dev/null; then
|
|
echo "You already have a group \"${GROUP}\", so I will use it."
|
|
else
|
|
if pw groupadd ${GROUP} -g ${GID}; then
|
|
echo "Added group \"${GROUP}\"."
|
|
else
|
|
echo "Adding group \"${GROUP}\" failed..."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
if pw user show "${USER}" 2>/dev/null; then
|
|
echo "You already have a user \"${USER}\", so I will use it."
|
|
else
|
|
if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
|
|
-d ${DB_DIR} -s /sbin/nologin -c "PostgreSQL Daemon"
|
|
then
|
|
echo "Added user \"${USER}\"."
|
|
else
|
|
echo "Adding user \"${USER}\" failed..."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
chown -R ${USER}.${GROUP} ${DB_DIR}
|
|
;;
|
|
esac
|