ports/157668: Fix port: mail/fetchmail should use USERS

Chris Rees utisoft at gmail.com
Mon Jun 6 19:10:08 UTC 2011


>Number:         157668
>Category:       ports
>Synopsis:       Fix port: mail/fetchmail 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 at 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

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

	Please bear in mind that pkg-install has been removed


--- mail-fetchmail.patch begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/fetchmail/Makefile,v
retrieving revision 1.214
diff -u -r1.214 Makefile
--- Makefile	11 Dec 2010 22:27:06 -0000	1.214
+++ Makefile	4 Jun 2011 12:40:36 -0000
@@ -25,6 +25,9 @@
 
 RUN_DEPENDS=	${LOCALBASE}/share/certs/ca-root-nss.crt:${PORTSDIR}/security/ca_root_nss
 
+USERS=		${PORTNAME}
+GROUPS=		${USERS}
+
 USE_RC_SUBR=	fetchmail
 FETCHMAILRC=	${PREFIX}/etc/fetchmailrc
 SUB_FILES=	pkg-message
@@ -113,9 +116,6 @@
 post-build:
 	@cd ${WRKSRC} && ${MAKE} check
 
-pre-su-install:
-	@${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
-
 post-install:
 .if !defined(NOPORTDOCS)
 	${INSTALL} -d -m 555 -o ${DOCOWN} -g ${DOCGRP} ${DOCSDIR}
Index: pkg-install
===================================================================
RCS file: pkg-install
diff -N pkg-install
--- pkg-install	15 May 2006 21:18:39 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,46 +0,0 @@
-#!/bin/sh
-#
-#	$FreeBSD: ports/mail/fetchmail/pkg-install,v 1.2 2006/05/15 21:18:39 barner Exp $
-#
-
-PKG_PREFIX=${PKG_PREFIX:=/usr/local}
-
-if [ -x /usr/sbin/nologin ]; then
-	NOLOGIN=/usr/sbin/nologin
-else
-	NOLOGIN=/sbin/nologin
-fi
-
-if [ x"$2" = xPRE-INSTALL ]; then
-	USER=fetchmail
-	UID=124
-	GROUP=fetchmail
-	GID=124
-
-	if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
-		echo "You already have a group \"${GROUP}\", so I will use it."
-	else
-		if /usr/sbin/pw groupadd ${GROUP} -g ${GID}
-		then
-			echo "Added group \"${GROUP}\"."
-		else
-			echo "Adding group \"${GROUP}\" failed..."
-			echo "Please create it, and try again."
-			exit 1
-		fi
-	fi
-
-	if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
-		 echo "You already have a user \"${USER}\", so I will use it."
-	else
-		if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - -d /var/run/fetchmail -s ${NOLOGIN} -c "Fetchmail mail-retrieval daemon"; then
-			echo "Added user \"${USER}\"."
-		else
-			echo "Adding user \"${USER}\" failed..."
-			echo "Please create it, and try again."
-			exit 1
-		fi
-	fi
-fi
-
-/usr/bin/install -d -m 755 -o fetchmail -g fetchmail /var/run/fetchmail
Index: pkg-plist
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/fetchmail/pkg-plist,v
retrieving revision 1.29
diff -u -r1.29 pkg-plist
--- pkg-plist	4 Nov 2009 10:47:33 -0000	1.29
+++ pkg-plist	4 Jun 2011 12:39:09 -0000
@@ -36,6 +36,7 @@
 %%NLS%%share/locale/tr/LC_MESSAGES/fetchmail.mo
 %%NLS%%share/locale/vi/LC_MESSAGES/fetchmail.mo
 %%NLS%%share/locale/zh_CN/LC_MESSAGES/fetchmail.mo
+ at exec /usr/bin/install -d -m 755 -o fetchmail -g fetchmail /var/run/fetchmail
 @unexec if cmp -s %D/etc/fetchmailrc.sample %D/etc/fetchmailrc; then rm -f %D/etc/fetchmailrc; fi
 etc/fetchmailrc.sample
 @exec if [ ! -f %D/etc/fetchmailrc ] ; then cp -p %D/%F %B/fetchmailrc; fi
--- mail-fetchmail.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:



More information about the freebsd-ports-bugs mailing list