Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jun 2011 20:00:38 +0100
From:      Chris Rees <utisoft@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/157667: Fix port: databases/postgresql91-server should use USERS
Message-ID:  <BLU0-SMTP13110406874DE5B1C2FD1F0A9600@phx.gbl>
Resent-Message-ID: <201106061910.p56JA7OU081640@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         157667
>Category:       ports
>Synopsis:       Fix port: databases/postgresql91-server should use USERS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 06 19:10:07 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Chris Rees
>Release:        FreeBSD 8.2-RELEASE-p1 i386
>Organization:
bayofrum
>Environment:
System: FreeBSD zeus.bayofrum.net 8.2-RELEASE-p1 FreeBSD 8.2-RELEASE-p1 #0: Sat Apr 30 15:09:06 BST 2011 root@zeus.bayofrum.net:/usr/obj/usr/src/sys/ZEUS i386


	
>Description:
	

	This port uses pkg-install to create new users instead of using USERS= and GROUPS=

>How-To-Repeat:
	
>Fix:

	

	- Use USERS and GROUPS
	- Remove quotes from BROKEN to make portlint happy

	Submitted by: Chris Rees (utisoft@gmail.com)


--- databases-postgresql91-server.patch begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/databases/postgresql91-server/Makefile,v
retrieving revision 1.217
diff -u -r1.217 Makefile
--- Makefile	28 Apr 2011 07:46:15 -0000	1.217
+++ Makefile	2 Jun 2011 13:47:19 -0000
@@ -35,7 +35,6 @@
 
 PG_USER?=	pgsql
 PG_GROUP?=	pgsql
-PG_UID?=	70
 
 LDFLAGS+=	-L${LOCALBASE}/lib
 INCLUDES+=	-I${LOCALBASE}/include
@@ -62,6 +61,8 @@
 USE_PGSQL=	yes
 WANT_PGSQL_VER=	${PORTVERSION:C/([0-9][0-9]*)\.([0-9][0-9]*).*/\1\2/g}
 SUB_FILES+=	502.pgsql
+USERS=		${PG_USER}
+GROUPS=		${PG_GROUP}
 .endif
 
 .if !defined(SLAVE_ONLY)
@@ -173,7 +174,7 @@
 
 .  if defined(WITH_MIT_KRB5)
 .    if exists(/usr/lib/libkrb5.so) || exists(/usr/bin/krb5-config)
-BROKEN=		"You must remove heimdal's /usr/bin/krb5-config and /usr/lib/libkrb5.so*, and set NO_KERBEROS=true in /etc/make.conf to build successfully with MIT-KRB"
+BROKEN=		You must remove heimdal's /usr/bin/krb5-config and /usr/lib/libkrb5.so*, and set NO_KERBEROS=true in /etc/make.conf to build successfully with MIT-KRB
 .    endif
 # Allow defining a home built MIT Kerberos by setting KRB5_HOME
 .    if defined(KRB5_HOME) && exists(${KRB5_HOME}/lib/libgssapi_krb5.a) && exists(${KRB5_HOME}/bin/krb5-config)
@@ -309,20 +310,10 @@
 .  endif
 .  if exists(${FILESDIR}/pkg-install${PKGNAMESUFFIX}.in)
 SUB_FILES+=     pkg-install${PKGNAMESUFFIX}
-SUB_LIST=       PG_GROUP=$(PG_GROUP) \
-                PG_USER=$(PG_USER) \
-                PG_UID=$(PG_UID)
-PLIST_SUB+=     PG_USER=$(PG_USER)
 PKGINSTALL=     ${WRKDIR}/pkg-install${PKGNAMESUFFIX}
 .  endif
 .endif
 
-.if defined(SERVER_ONLY)
-pre-su-install:
-	@ ${SETENV} PKG_PREFIX=${PREFIX} PG_USER=$(PG_USER) PG_GROUP=$(PG_GROUP) \
-		${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
-.endif
-
 .if !defined(NO_BUILD)
 post-patch:
 	@${REINPLACE_CMD} s/@PTHREAD_LIBS@// ${WRKSRC}/src/Makefile.global.in
Index: pkg-plist-server
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/databases/postgresql91-server/pkg-plist-server,v
retrieving revision 1.32
diff -u -r1.32 pkg-plist-server
--- pkg-plist-server	28 Apr 2011 07:46:15 -0000	1.32
+++ pkg-plist-server	4 Jun 2011 13:49:46 -0000
@@ -756,9 +756,8 @@
 share/postgresql/tsearch_data/synonym_sample.syn
 share/postgresql/tsearch_data/thesaurus_sample.ths
 @dirrmtry share/postgresql/tsearch_data
-@unexec echo "Warning: If you will *NOT* use this package anymore, please remove the pgsql user manually."
 @dirrmtry share/postgresql
 @dirrmtry etc/periodic/daily
 @dirrmtry etc/periodic
 @dirrmtry lib/postgresql
-@dirrmtry %%PG_USER%%
+@dirrmtry pgsql
Index: files/pkg-install-server.in
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/databases/postgresql91-server/files/pkg-install-server.in,v
retrieving revision 1.1
diff -u -r1.1 pkg-install-server.in
--- files/pkg-install-server.in	18 Apr 2011 23:34:27 -0000	1.1
+++ files/pkg-install-server.in	2 Jun 2011 13:46:03 -0000
@@ -3,9 +3,6 @@
 # $FreeBSD: ports/databases/postgresql91-server/files/pkg-install-server.in,v 1.1 2011/04/18 23:34:27 girgen Exp $
 
 PATH=/bin:/usr/bin:/usr/sbin
-PG_USER=%%PG_USER%%
-PG_GROUP=%%PG_GROUP%%
-PG_UID=%%PG_UID%%
 
 backupwarning() { echo "
 
@@ -23,43 +20,6 @@
 }
 
 case $2 in
-PRE-INSTALL)
-	backupwarning
-	PGUSER=${PGUSER:-${PG_USER}}
-	PGGROUP=${PGGROUP:-${PG_GROUP}}
-	DB_DIR=${PKG_PREFIX}/${PGUSER}
-	UID=${PG_UID}
-	GID=${PG_UID}
-
-	if pw group show "${PGGROUP}" 2>/dev/null; then
-		echo "You already have a group \"${PGGROUP}\", so I will use it."
-	else
-		if pw groupadd ${PGGROUP} -g ${GID}; then
-			echo "Added group \"${PGGROUP}\"."
-		else
-			echo "Adding group \"${PGGROUP}\" failed..."
-			exit 1
-		fi
-	fi
-
-	if pw user show "${PGUSER}" 2>/dev/null; then
-		echo "You already have a user \"${PGUSER}\", so I will use it."
-	else
-		if pw useradd ${PGUSER} -u ${UID} -g ${PGGROUP} -h - \
-			-d ${DB_DIR} -c "PostgreSQL Daemon"
-		then
-			echo "Added user \"${PGUSER}\"."
-		else
-			echo "Adding user \"${PGUSER}\" failed..."
-			exit 1
-		fi
-	fi
-
-	if ! [ -x ~${PGUSER} ] ; then 
-		install -m 755 -o ${PGUSER} -g ${PGGROUP} -d ${DB_DIR}
-	fi
-	;;
-
 BACKUPWARNING)
 	backupwarning
 	;;
--- databases-postgresql91-server.patch ends here ---



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BLU0-SMTP13110406874DE5B1C2FD1F0A9600>