Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Jan 2010 23:42:05 GMT
From:      Sevan Janiyan <venture37@geeklan.co.uk>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        ale@FreeBSD.org
Subject:   ports/143384: [PATCH] databases/mysql-server: switch to using USERS & GROUPS in Makefile 
Message-ID:  <201001302342.o0UNg5v3079108@newbie.thingamajig-systems.co.uk>
Resent-Message-ID: <201001302350.o0UNo7Sb040166@freefall.freebsd.org>

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

>Number:         143384
>Category:       ports
>Synopsis:       [PATCH] databases/mysql-server: switch to using USERS & GROUPS in Makefile
>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:   Sat Jan 30 23:50:07 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Sevan Janiyan
>Release:        FreeBSD 8.0-RELEASE-p2 amd64
>Organization:
>Environment:
System: FreeBSD newbie.thingamajig-systems.co.uk 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan  5 21:11:58 UTC
>Description:
instead of manually creating a users via pkg-install, use $USERS & $GROUPS in makefile to specify the users & groups required by the port
this insures that the removal of accounts is taken care of when the port is removed

Removed file(s):
- pkg-install

Port maintainer (ale@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- mysql-server-5.0.89.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/databases/mysql50-server/Makefile,v
retrieving revision 1.250
diff -u -r1.250 Makefile
--- Makefile	11 Jan 2010 11:58:38 -0000	1.250
+++ Makefile	30 Jan 2010 23:38:09 -0000
@@ -31,6 +31,9 @@
 		--with-comment='FreeBSD port: ${PKGNAME}' \
 		--enable-thread-safe-client
 
+USERS=		mysql
+GROUPS=		mysql
+
 .ifdef USE_MYSQL
 .error You have `USE_MYSQL' variable defined either in environment or in make(1) arguments. Please undefine and try again.
 .endif
@@ -177,7 +180,6 @@
 
 post-install:
 .if !defined(PACKAGE_BUILDING)
-	@${SETENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
 	@${CAT} ${PKGMESSAGE}
 .endif
 
Index: pkg-install
===================================================================
RCS file: pkg-install
diff -N pkg-install
--- pkg-install	6 Apr 2005 13:38:28 -0000	1.6
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-PATH=/bin:/usr/sbin
-
-case $2 in
-POST-INSTALL)
-	USER=mysql
-	GROUP=${USER}
-	UID=88
-	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 /nonexistent -s /sbin/nologin -c "MySQL Daemon"
-		then
-			echo "Added user \"${USER}\"."
-		else
-			echo "Adding user \"${USER}\" failed..."
-			exit 1
-		fi
-	fi
-	;;
-esac
--- mysql-server-5.0.89.patch ends here ---

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



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