1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-31 21:57:12 +00:00
freebsd-ports/japanese/postgresql7/pkg-install
Akinori MUSHA 386c36c2bc Update to 7.0.2 + jumbo 20001025 patch.
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.
2000-11-03 09:34:13 +00:00

45 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