From owner-freebsd-ports Sat Apr 1 18:10: 8 2000 Delivered-To: freebsd-ports@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id E591737BA42 for ; Sat, 1 Apr 2000 18:10:03 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id SAA75188; Sat, 1 Apr 2000 18:10:03 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from Astrovan.cstone.net (mailstop.cstone.net [205.197.102.13]) by hub.freebsd.org (Postfix) with ESMTP id 104FB37BAE9 for ; Sat, 1 Apr 2000 18:09:10 -0800 (PST) (envelope-from ubergeek@eng.cstone.net) Received: from newbie.cho.cstone.net ([209.145.64.15]) by Astrovan.cstone.net (Post.Office MTA v3.5.3 release 223 ID# 0-59789U13500L1350S0V35) with ESMTP id net for ; Sat, 1 Apr 2000 21:03:51 -0500 Received: (from ubergeek@localhost) by newbie.cho.cstone.net (8.9.3/8.9.3) id VAA60822; Sat, 1 Apr 2000 21:08:12 -0500 (EST) (envelope-from ubergeek@mail.cstone.net) Message-Id: <200004020208.VAA60822@newbie.cho.cstone.net> Date: Sat, 1 Apr 2000 21:08:12 -0500 (EST) From: adrian@ubergeeks.com Reply-To: adrian@ubergeeks.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: ports/17744: adding INSTALL script so postgresql can be packaged Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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