From girgen@partitur.se  Wed Mar 14 19:28:27 2001
Return-Path: <girgen@partitur.se>
Received: from bastuba.partitur.se (bastuba.partitur.se [212.209.169.194])
	by hub.freebsd.org (Postfix) with ESMTP id C836337B718
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 14 Mar 2001 19:28:26 -0800 (PST)
	(envelope-from girgen@partitur.se)
Received: from elbas.partitur.se (elbas.partitur.se [212.209.169.222])
	by bastuba.partitur.se (8.11.1/8.11.1) with ESMTP id f2F3SPb01464
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 15 Mar 2001 04:28:26 +0100 (CET)
	(envelope-from girgen@partitur.se)
Received: (from girgen@localhost)
	by elbas.partitur.se (8.11.1/8.11.1) id f2F3SPc45603;
	Thu, 15 Mar 2001 04:28:25 +0100 (CET)
	(envelope-from girgen)
Message-Id: <200103150328.f2F3SPc45603@elbas.partitur.se>
Date: Thu, 15 Mar 2001 04:28:25 +0100 (CET)
From: girgen@partitur.se
Reply-To: girgen@partitur.se
To: FreeBSD-gnats-submit@freebsd.org
Subject: Maintainer patch: fix postgres pkg build problems
X-Send-Pr-Version: 3.2

>Number:         25817
>Category:       ports
>Synopsis:       Maintainer patch: fix postgres pkg build problems
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 14 19:30:00 PST 2001
>Closed-Date:    Wed Mar 14 23:23:42 PST 2001
>Last-Modified:  Wed Mar 14 23:24:10 PST 2001
>Originator:     Palle Girgensohn
>Release:        FreeBSD 4.2-RELEASE i386
>Organization:
Partituration of PR author (multiple lines)>
>Environment:

	

>Description:
This patch fixes problems when installing postgresql7 with pkg_add
- pkg-install used wrong uid#
- chown lib dir *after* it is created
- pkg-install created data dir where Makefile didn't
- add pkg-deinstall and remove user & group
- don't chown data dir, since we don't create it anymore
- spell and documentation fixes in the rc.d script

Thanks to:
         Koshy <jkoshy@FreeBSD.org>
         Dag-Erling Smorgrav <des@thinksec.com>
         Clive Lin <clive@CirX.ORG>
	

>How-To-Repeat:

	

>Fix:

Index: pkg-install
===================================================================
RCS file: /net/elbas/opt/ncvs/ports/databases/postgresql7/pkg-install,v
retrieving revision 1.3
diff -u -u -r1.3 pkg-install
--- pkg-install	2001/01/30 07:27:00	1.3
+++ pkg-install	2001/03/15 03:11:06
@@ -4,15 +4,13 @@
 
 PATH=/bin:/usr/sbin
 
-if [ -z "${DB_DIR}" ]; then
-	DB_DIR=${PKG_PREFIX}/pgsql/data
-fi
+DB_DIR=${PKG_PREFIX}/pgsql
 
 case $2 in
-POST-INSTALL)
+PRE-INSTALL)
 	USER=pgsql
 	GROUP=${USER}
-	UID=89
+	UID=70
 	GID=${UID}
 
 	if pw group show "${GROUP}" 2>/dev/null; then
@@ -39,6 +37,6 @@
 		fi
 	fi
 
-	chown -R ${USER}.${GROUP} ${DB_DIR}
 	;;
+
 esac
Index: pkg-plist
===================================================================
RCS file: /net/elbas/opt/ncvs/ports/databases/postgresql7/pkg-plist,v
retrieving revision 1.28
diff -u -u -r1.28 pkg-plist
--- pkg-plist	2001/02/22 21:06:03	1.28
+++ pkg-plist	2001/03/14 15:23:27
@@ -55,7 +55,6 @@
 pgsql/include/utils/geo_decls.h
 pgsql/include/utils/mcxt.h
 pgsql/include/utils/palloc.h
-@exec chown root:wheel %D/pgsql/lib
 pgsql/lib/global1.bki.source
 pgsql/lib/global1.description
 pgsql/lib/libecpg.a
@@ -78,6 +77,7 @@
 pgsql/lib/pg_options.sample
 pgsql/lib/plpgsql.so
 pgsql/lib/postmaster.opts.default.sample
+@exec chown -R root:wheel %D/pgsql/lib
 pgsql/post-install-notes
 @dirrm pgsql/bin
 @dirrm pgsql/include/access
@@ -92,4 +92,5 @@
 @dirrm pgsql/man/man1
 @dirrm pgsql/man/manl
 @dirrm pgsql/man
+@unexec rmdir %D/pgsql/data 2>/dev/null || true
 @unexec rmdir %D/pgsql 2>/dev/null || true
Index: files/dot.profile.in
===================================================================
RCS file: /net/elbas/opt/ncvs/ports/databases/postgresql7/files/dot.profile.in,v
retrieving revision 1.1
diff -u -u -r1.1 dot.profile.in
--- files/dot.profile.in	2000/12/11 03:22:07	1.1
+++ files/dot.profile.in	2001/02/14 15:42:47
@@ -1,14 +1,14 @@
 PATH=${PATH}:%%PREFIX%%/pgsql/bin
 PGLIB=%%PREFIX%%/pgsql/lib
 
-# note: PGDATA overwrites the -D startup option
+# note: PGDATA can be overridden by the -D startup option
 PGDATA=%%PREFIX%%/pgsql/data
 
 export PATH MANPATH PGLIB PGDATA
 
 #You might want to set some locale stuff here
 #PGDATESTYLE=ISO
-#LC_ALL=sv_SE.ISO_88591-1
+#LC_ALL=sv_SE.ISO_8859-1
 #export PGDATESTYLE LC_ALL
 
 # if you want to make regression tests use this TZ
--- /dev/null	Thu Mar 15 04:14:12 2001
+++ pkg-deinstall	Mon Mar 12 11:56:09 2001
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# remove postgresql users
+
+case $2 in 
+
+POST-DEINSTALL)
+	pw groupdel pgsql
+	pw userdel pgsql
+	;;
+
+esac
	

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: clive 
State-Changed-When: Wed Mar 14 23:23:42 PST 2001 
State-Changed-Why:  
Committed, thanks ! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=25817 
>Unformatted:
