Bug 17744

Summary: postgresql cannot be packaged because it needs a user created
Product: Ports & Packages Reporter: adrian <adrian>
Component: Individual Port(s)Assignee: andreas <andreas>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description adrian 2000-04-02 03:10:01 UTC
	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.

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---------------------


-------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--JIZQSPDEXjCFQWm5vDi037x8NPPvlT2XHwnYxJG7E3RCgmq5
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- 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
How-To-Repeat: 
	cd /usr/ports/databases/posgresql
	make package
Comment 1 adrian 2000-04-07 02:48:46 UTC
>Submitter-Id:   current-users
>Originator:     Adrian Filipi-Martin
>Organization:   Ubergeeks Consulting
>Confidential:   no
>Synopsis:       correction to previous submission
>Severity:       non-critical
>Priority:       medium
>Category:       ports
>Release:        FreeBSD 3.4-RELEASE i386
>Class:          change-request
>Environment: 

	same as ports/17744

>Description: 

	Missed setting the homedirectory for pgsql properly.  Accidentally
	left it set to mysql's home directory.

>How-To-Repeat: 

	apply ports/17744

>Fix: 
	
	Apply this patch.

--- INSTALL.orig	Thu Apr  6 21:43:46 2000
+++ INSTALL	Thu Apr  6 21:44:17 2000
@@ -2,7 +2,7 @@
 
 PATH=/bin:/usr/sbin
 if [ -z "${DB_DIR}" ]; then
-	DB_DIR=/var/db/mysql
+	DB_DIR=/usr/local/pgsql/data
 fi
 
 case $2 in
Comment 2 Akinori MUSHA freebsd_committer freebsd_triage 2000-04-16 13:24:29 UTC
Responsible Changed
From-To: freebsd-ports->andreas

Over to MAINTAINER 
Comment 3 andreas freebsd_committer freebsd_triage 2000-04-16 19:26:09 UTC
State Changed
From-To: open->closed

committed, thanks for your submission