Bug 83100

Summary: [PATCH] mail/simscan: Don't remove simscan user/group to portupgrade works fine
Product: Ports & Packages Reporter: Renato Botelho <freebsd>
Component: Individual Port(s)Assignee: Renato Botelho <garga>
Status: Closed FIXED    
Severity: Affects Only Me CC: toxa
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
simscan-1.1.patch none

Description Renato Botelho 2005-07-07 17:00:31 UTC
- Don't remove simscan user/group to portupgrade works fine
- Add CONFIGURE_TARGET just to remove warning

Removed file(s):
- pkg-deinstall

Port maintainer (toxa@toxahost.ru) is cc'd.

Generated with FreeBSD Port Tools 0.63
Comment 1 Roman Bogorodskiy freebsd_committer freebsd_triage 2005-07-07 17:26:45 UTC
Responsible Changed
From-To: freebsd-ports-bugs->novel

I'll take it.
Comment 2 Renato Botelho freebsd_committer freebsd_triage 2005-08-01 19:14:59 UTC
Responsible Changed
From-To: novel->garga

I'm a commiter now, so, i can take this.
Comment 3 Renato Botelho freebsd_committer freebsd_triage 2005-08-05 18:32:38 UTC
Dear maintainer,

I propose this new patch:

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/mail/simscan/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- Makefile	6 Jul 2005 19:36:24 -0000	1.2
+++ Makefile	5 Aug 2005 17:19:21 -0000
@@ -18,6 +18,7 @@
 BUILD_DEPENDS=	${QMAIL_QUEUE}:${PORTSDIR}/mail/qmail
 
 GNU_CONFIGURE=	yes
+USE_REINPLACE=	yes
 
 # A normal qmail installation puts everything into /var/qmail/.
 # Must match your qmail installation
@@ -42,7 +43,8 @@
 CONFIGURE_ARGS=--enable-clamavdb-path=/var/db/clamav \
 		--enable-qmaildir=${QMAIL_DIR} \
 	  	--enable-spamc-user=n \
-		--enable-workdir=${WORKDIR}
+		--enable-workdir=${WORKDIR} \
+		--enable-user=nobody
 
 .if defined(WITHOUT_CLAMAV)
 CONFIGURE_ARGS+=	--enable-clamav=n
@@ -130,9 +132,12 @@
 	@${ECHO_MSG} "=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~="
 	@${ECHO_MSG} ""
 
+pre-install:
+	@${REINPLACE_CMD} -e 's|nobody|simscan|g' ${WRKSRC}/Makefile
+	@${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+
 post-install:
-	@${CHMOD} 04711 ${QMAIL_DIR}/bin/simscan
-	@${CHOWN} simscan:simscan ${QMAIL_DIR}/bin/simscan ${QMAIL_DIR}/bin/simscanmk
+	@${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
 .for i in ${PORTDOCS}
Index: pkg-install
===================================================================
RCS file: /home/pcvs/ports/mail/simscan/pkg-install,v
retrieving revision 1.1
diff -u -r1.1 pkg-install
--- pkg-install	3 Apr 2005 16:04:21 -0000	1.1
+++ pkg-install	5 Aug 2005 17:19:21 -0000
@@ -43,6 +43,8 @@
 		/bin/mkdir -p "$SIMDIR" || exit 1
 		/usr/sbin/chown "$USER:$GROUP" "$SIMDIR" || exit 1
 		/bin/chmod 0750 "$SIMDIR" || exit 1
+		/bin/chmod 04711 ${QMAIL_DIR}/bin/simscan
+		/bin/chown $USER:$GROUP ${QMAIL_DIR}/bin/simscan ${QMAIL_DIR}/bin/simscanmk
 	fi
 fi
 
Index: scripts/configure
===================================================================
RCS file: scripts/configure
diff -N scripts/configure
--- scripts/configure	3 Apr 2005 16:04:21 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,36 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD: ports/mail/simscan/scripts/configure,v 1.1 2005/04/03 16:04:21 novel Exp $
-
-USER=simscan
-GROUP=${USER}
-UID=74
-GID=${UID}
-
-echo adding simscan user
-
-
-        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 "Simscan User"
-                then
-                        echo "Added user \"${USER}\"."
-                else
-                        echo "Adding user \"${USER}\" failed..."
-                        exit 1
-                fi
-        fi

Do you approve it?
-- 
Renato Botelho <garga @ FreeBSD.org>
               <freebsd @ galle.com.br>
GnuPG Key: http://people.freebsd.org/~garga/pubkey.asc

Genetics explains why you look like your father, and if you don't, why
you should.
Comment 4 Renato Botelho freebsd_committer freebsd_triage 2005-08-05 18:32:58 UTC
State Changed
From-To: open->feedback

Ask maintainer for approval.
Comment 5 Renato Botelho freebsd_committer freebsd_triage 2005-08-09 14:58:55 UTC
State Changed
From-To: feedback->closed

Committed.