Date: Sat, 1 Apr 2000 21:08:12 -0500 (EST) From: adrian@ubergeeks.com To: FreeBSD-gnats-submit@freebsd.org Subject: ports/17744: adding INSTALL script so postgresql can be packaged Message-ID: <200004020208.VAA60822@newbie.cho.cstone.net>
next in thread | raw e-mail | index | archive | help
>Number: 17744 >Category: ports >Synopsis: postgresql cannot be packaged because it needs a user created >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Apr 1 18:10:01 PST 2000 >Closed-Date: >Last-Modified: >Originator: Adrian Filipi-Martin >Release: FreeBSD 3.4-RELEASE i386 >Organization: Ubergeeks Consulting >Environment: ports cvsup'd on 4/1/00. >Description: The port is marked with NO_PACKAGE because it need a user id created when it is installed. This is doable as is exemplified by the mysql322-server port which also needs an id created when being installed. >How-To-Repeat: cd /usr/ports/databases/posgresql make package >Fix: Apply this trivial patch to the Makefile and install the attached file as postgresql/pkg/INSTALL and make it executible. It is a slightly modified version of the mysql322-server/pkg/INSTALL script. The only differences are the user name, uid and the full name. -------snip-snip--------------------- --- Makefile.orig Mon Jan 3 01:45:51 2000 +++ Makefile Sat Apr 1 20:49:05 2000 @@ -42,7 +42,6 @@ SCRIPTS_ENV+= JAVA_HOME=${JAVA_HOME} .endif -NO_PACKAGE= "Requires pgsql uid" WRKSRC= ${WRKDIR}/${DISTNAME}/src USE_GMAKE= YES -------snip-snip--------------------- #!/bin/sh PATH=/bin:/usr/sbin if [ -z "${DB_DIR}" ]; then DB_DIR=/var/db/mysql 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 >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200004020208.VAA60822>