From utisoft@hotmail.com  Sat Jun  4 09:40:52 2011
Return-Path: <utisoft@hotmail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5911E106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  4 Jun 2011 09:40:52 +0000 (UTC)
	(envelope-from utisoft@hotmail.com)
Received: from blu0-omc1-s32.blu0.hotmail.com (blu0-omc1-s32.blu0.hotmail.com [65.55.116.43])
	by mx1.freebsd.org (Postfix) with ESMTP id 190138FC22
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  4 Jun 2011 09:40:51 +0000 (UTC)
Received: from BLU0-SMTP63 ([65.55.116.8]) by blu0-omc1-s32.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675);
	 Sat, 4 Jun 2011 02:40:51 -0700
Received: from zeus.bayofrum.net ([90.221.7.100]) by BLU0-SMTP63.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675);
	 Sat, 4 Jun 2011 02:40:50 -0700
Received: from zeus.bayofrum.net (crees@localhost [127.0.0.1])
	by zeus.bayofrum.net (8.14.4/8.14.4) with ESMTP id p549ePmj014962
	(version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 4 Jun 2011 10:40:25 +0100 (BST)
	(envelope-from chris@zeus.bayofrum.net)
Received: (from crees@localhost)
	by zeus.bayofrum.net (8.14.4/8.14.4/Submit) id p549eOXx014961;
	Sat, 4 Jun 2011 10:40:24 +0100 (BST)
	(envelope-from chris)
Message-Id: <BLU0-SMTP6311DB73F9B8A5EDA51C4CA97E0@phx.gbl>
Date: Sat, 4 Jun 2011 10:40:24 +0100
From: Chris Rees <utisoft@gmail.com>
Sender: <utisoft@hotmail.com>
Reply-To: Chris Rees <utisoft@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] Fix port: devel/fossology should use USERS
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         157593
>Category:       ports
>Synopsis:       [PATCH] Fix port: devel/fossology should use USERS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    crees
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 04 09:50:10 UTC 2011
>Closed-Date:    Tue Aug 09 11:30:46 UTC 2011
>Last-Modified:  Tue Aug  9 11:40:10 UTC 2011
>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=

	I've attached the most likely fix, however I've been unable to tinderbox it because it's marked BROKEN. I will send an email out to ports@ to see if anyone's interested otherwise it should be deprecated.
>How-To-Repeat:
	
>Fix:

	

	- Use USERS and GROUPS

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


--- devel-fossology.patch begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/devel/fossology/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- Makefile	2 May 2011 12:44:31 -0000	1.7
+++ Makefile	2 Jun 2011 14:18:42 -0000
@@ -40,6 +40,8 @@
 
 BROKEN=		does not compile
 
+USERS=		fossy
+GROUPS=		${USERS}
 USE_APACHE=	2.0+
 USE_CDRTOOLS=	yes
 USE_GMAKE=	yes
Index: files/patch-common__fo-postinstall.in
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/devel/fossology/files/patch-common__fo-postinstall.in,v
retrieving revision 1.1
diff -u -r1.1 patch-common__fo-postinstall.in
--- files/patch-common__fo-postinstall.in	24 Jul 2009 06:30:56 -0000	1.1
+++ files/patch-common__fo-postinstall.in	2 Jun 2011 14:17:01 -0000
@@ -1,100 +1,116 @@
---- common/fo-postinstall.in.orig	2009-07-13 21:51:17.000000000 +0000
-+++ common/fo-postinstall.in	2009-07-15 00:37:37.000000000 +0000
-@@ -8,22 +8,15 @@
+--- common/fo-postinstall.in	2011-06-02 15:16:35.611277082 +0100
++++ common/fo-postinstall.in.orig	2011-06-02 15:12:07.679891820 +0100
+@@ -7,14 +7,23 @@
+ # idempotent, meaning that running it repeatedly will still do the
  # right thing, regardless of the success of previous runs.
  
- ## Options parsing and setup
--# parse options
--OPTS=`getopt -o adwseoh --long agent,database,web,web-only,scheduler,scheduler-only,everything,overwrite,help -n 'fo-postinstall' -- "$@"`
- 
--if [ $? != 0 ]; then
--   echo "ERROR: Bad option specified."
--   OPTS="--help"
--fi
--
--eval set -- "$OPTS"
-+# FIXME: joint options do not work (i.e. "-as" instead of "-a -s")
+-# FIXME: joint options do not work (i.e. "-as" instead of "-a -s")
++## Options parsing and setup
++# parse options
++OPTS=`getopt -o adwseoh --long agent,database,web,web-only,scheduler,scheduler-only,everything,overwrite,help -n 'fo-postinstall' -- "$@"`
++
++if [ $? != 0 ]; then
++   echo "ERROR: Bad option specified."
++   OPTS="--help"
++fi
++
++eval set -- "$OPTS"
  
  # if no options or just -o then do everything
--if [ "$OPTS" = " --" -o "$OPTS" = " -o --" ]; then
-+if [ $# -eq 0 -o "$1" = "-o" ]; then
+-if [ $# -eq 0 -o "$1" = "-o" ]; then
++if [ "$OPTS" = " --" -o "$OPTS" = " -o --" ]; then
     EVERYTHING=1
  fi
  
--while true; do
-+while [ $# -gt 0 ]; do
+-while [ $# -gt 0 ]; do
++while true; do
     case "$1" in
        -a|--agent) AGENT=1; shift;;
        -d|--database) DATABASE=1; shift;;
-@@ -105,15 +98,10 @@
-    echo "*** Creating user and group ***"
+@@ -93,12 +102,53 @@
+    # documentation.
  
-    # check for group
--   if grep -q "^{$PROJECTGROUP}:" /etc/group; then
-+   if pw groupshow {$PROJECTGROUP} 2>/dev/null 1>&2; then
-       echo "NOTE: group '{$PROJECTGROUP}' already exists, good."
-    else
--      # use addgroup if it exists since it supports --system
--      if [ -f /usr/sbin/addgroup -a ! -L /usr/sbin/addgroup ]; then
--         addgroup --system {$PROJECTGROUP}
--      else
--         groupadd {$PROJECTGROUP}
--      fi
-+      pw groupadd {$PROJECTGROUP} -g 901
-       if [ "$?" != "0" ] ; then
-          echo "ERROR: Unable to create group '{$PROJECTGROUP}'"
-          exit 1
-@@ -123,25 +111,18 @@
-    fi
- 
-    # check for user
--   if grep -q "^{$PROJECTUSER}:" /etc/passwd; then
-+   if pw usershow {$PROJECTUSER} 2>/dev/null 1>&2; then
-       echo "NOTE: user '{$PROJECTUSER}' already exists, good."
-       USERSHELL=`grep "^{$PROJECTUSER}:" /etc/passwd |cut -d: -f 7`
--      if [ "$USERSHELL" = "/bin/false" ]; then
-+      if [ "$USERSHELL" = "/usr/sbin/nologin" ]; then
-          echo "ERROR: {$PROJECTUSER} shell must be a real shell"
-          exit 1
-       fi
-    else
-       # ensure that the full parent path of the HOME exists first
-       mkdir -p $\{REPO%/*/*\}
--      # use adduser if it exists since it supports --system, but
--      # not if it's a symlink (probably to /usr/sbin/useradd)
--      if [ -f /usr/sbin/adduser -a ! -L /usr/sbin/adduser ]; then
--         adduser --gecos "{$PROJECT}" --ingroup {$PROJECTGROUP} --system \
--           --shell /bin/bash --home "$\{REPO%/*\}" {$PROJECTUSER}
--      else
--         useradd -c "{$PROJECT}" -g {$PROJECTGROUP} -m \
--           -s /bin/bash -d "$\{REPO%/*\}" {$PROJECTUSER}
--      fi
-+      pw useradd {$PROJECTUSER} -u 901 -g {$PROJECTGROUP} -h - \
-+          -s "/bin/bash" -d "$\{REPO%/*\}" -c "FOSSology user"
-       if [ "$?" != "0" ] ; then
-          echo "ERROR: Unable to create user '{$PROJECTUSER}'"
-          exit 1
-@@ -284,19 +265,12 @@
-    echo "*** Setting up the web interface ***"
- 
-    # See if web server user exists, if so add to the group.
--   # check for www-data (Debian, etc)
--   grep -q "^www-data:" /etc/passwd
--   if [ $? == 0 ] ; then
--     echo "NOTE: Adding user www-data to group {$PROJECTGROUP}"
--     # this is smart enough to not add multiple times so it's ok to repeat
--     usermod -G {$PROJECTGROUP} -a www-data
--   fi
--   # check for apache (RHEL/CentOS, etc)
--   grep -q "^apache:" /etc/passwd
-+   # check for www (FreeBSD)
-+   grep -q "^www:" /etc/passwd
-    if [ $? == 0 ] ; then
--     echo "NOTE: Adding user apache to group {$PROJECTGROUP}"
-+     echo "NOTE: Adding user www to group {$PROJECTGROUP}"
-      # this is smart enough to not add multiple times so it's ok to repeat
--     usermod -G {$PROJECTGROUP} -a apache
-+     pw groupmod {$PROJECTGROUP} -m www
-    fi
+    # Make sure the user and group exist, if not then create
+-
+-	# We do this in the port Makefile
+-
+-   #echo "*** Creating user and group ***"
++   echo "*** Creating user and group ***"
  
- fi # end of WEBONLY
+    # check for group
++   if grep -q "^{$PROJECTGROUP}:" /etc/group; then
++      echo "NOTE: group '{$PROJECTGROUP}' already exists, good."
++   else
++      # use addgroup if it exists since it supports --system
++      if [ -f /usr/sbin/addgroup -a ! -L /usr/sbin/addgroup ]; then
++         addgroup --system {$PROJECTGROUP}
++      else
++         groupadd {$PROJECTGROUP}
++      fi
++      if [ "$?" != "0" ] ; then
++         echo "ERROR: Unable to create group '{$PROJECTGROUP}'"
++         exit 1
++      else
++         echo "NOTE: group '{$PROJECTGROUP}' created"
++      fi
++   fi
++
++   # check for user
++   if grep -q "^{$PROJECTUSER}:" /etc/passwd; then
++      echo "NOTE: user '{$PROJECTUSER}' already exists, good."
++      USERSHELL=`grep "^{$PROJECTUSER}:" /etc/passwd |cut -d: -f 7`
++      if [ "$USERSHELL" = "/bin/false" ]; then
++         echo "ERROR: {$PROJECTUSER} shell must be a real shell"
++         exit 1
++      fi
++   else
++      # ensure that the full parent path of the HOME exists first
++      mkdir -p $\{REPO%/*/*\}
++      # use adduser if it exists since it supports --system, but
++      # not if it's a symlink (probably to /usr/sbin/useradd)
++      if [ -f /usr/sbin/adduser -a ! -L /usr/sbin/adduser ]; then
++         adduser --gecos "{$PROJECT}" --ingroup {$PROJECTGROUP} --system \
++           --shell /bin/bash --home "$\{REPO%/*\}" {$PROJECTUSER}
++      else
++         useradd -c "{$PROJECT}" -g {$PROJECTGROUP} -m \
++           -s /bin/bash -d "$\{REPO%/*\}" {$PROJECTUSER}
++      fi
++      if [ "$?" != "0" ] ; then
++         echo "ERROR: Unable to create user '{$PROJECTUSER}'"
++         exit 1
++      else
++         echo "NOTE: user '{$PROJECTUSER}' created"
++      fi
++   fi
+ 
+    ## check for existance/ownership/permissions of needed directories
+    echo "*** Making sure needed dirs exist with right ownership/permissions ***"
+@@ -230,5 +280,28 @@
+ 
+ ########################################################################
+ 
++if [ $WEBONLY ]; then
++   echo "*** Setting up the web interface ***"
++
++   # See if web server user exists, if so add to the group.
++   # check for www-data (Debian, etc)
++   grep -q "^www-data:" /etc/passwd
++   if [ $? == 0 ] ; then
++     echo "NOTE: Adding user www-data to group {$PROJECTGROUP}"
++     # this is smart enough to not add multiple times so it's ok to repeat
++     usermod -G {$PROJECTGROUP} -a www-data
++   fi
++   # check for apache (RHEL/CentOS, etc)
++   grep -q "^apache:" /etc/passwd
++   if [ $? == 0 ] ; then
++     echo "NOTE: Adding user apache to group {$PROJECTGROUP}"
++     # this is smart enough to not add multiple times so it's ok to repeat
++     usermod -G {$PROJECTGROUP} -a apache
++   fi
++
++fi # end of WEBONLY
++
++########################################################################
++
+ echo "FOSSology postinstall complete, but sure to complete the remaining"
+ echo "  steps in the INSTALL instructions."
--- devel-fossology.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:
Responsible-Changed-From-To: freebsd-ports-bugs->pgollucci 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Jun 4 09:50:21 UTC 2011 
Responsible-Changed-Why:  
pgollucci@ wants his PRs (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157593 
Responsible-Changed-From-To: pgollucci->crees 
Responsible-Changed-By: crees 
Responsible-Changed-When: Wed Jun 22 16:53:34 UTC 2011 
Responsible-Changed-Why:  
Invalid autoassignment 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157593 
Responsible-Changed-From-To: crees->freebsd-ports-bugs 
Responsible-Changed-By: crees 
Responsible-Changed-When: Wed Jun 22 17:02:06 UTC 2011 
Responsible-Changed-Why:  
To pool to correct assign message 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157593 
Responsible-Changed-From-To: freebsd-ports-bugs->crees 
Responsible-Changed-By: crees 
Responsible-Changed-When: Wed Jun 22 17:24:41 UTC 2011 
Responsible-Changed-Why:  
Invalid autoassignment to pgollucci 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157593 
State-Changed-From-To: open->feedback 
State-Changed-By: crees 
State-Changed-When: Tue Jul 5 21:18:42 UTC 2011 
State-Changed-Why:  
Sent to ports@ for volunteers 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157593 
State-Changed-From-To: feedback->patched 
State-Changed-By: crees 
State-Changed-When: Sat Jul 9 09:48:46 UTC 2011 
State-Changed-Why:  
Marked for deprecation on 9/Aug 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157593 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/157593: commit references a PR
Date: Sat,  9 Jul 2011 09:47:47 +0000 (UTC)

 crees       2011-07-09 09:47:33 UTC
 
   FreeBSD ports repository
 
   Modified files:
     devel/fossology      Makefile 
     devel/fossology/files patch-common__fo-postinstall.in 
   Log:
   - Use USERS and GROUPS
   - Deprecate -- broken and no volunteers on ports@ after two reminders
   
   PR:             ports/157593
   Submitted by:   crees
   Approved by:    rene (mentor, implicit)
   
   Revision  Changes    Path
   1.8       +5 -0      ports/devel/fossology/Makefile
   1.2       +104 -88   ports/devel/fossology/files/patch-common__fo-postinstall.in
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: crees 
State-Changed-When: Tue Aug 9 11:30:44 UTC 2011 
State-Changed-Why:  
Port removed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157593 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/157593: commit references a PR
Date: Tue,  9 Aug 2011 11:30:20 +0000 (UTC)

 crees       2011-08-09 11:30:05 UTC
 
   FreeBSD ports repository
 
   Modified files:
     .                    MOVED 
     devel                Makefile 
   Removed files:
     devel/fossology      Makefile distinfo pkg-descr pkg-plist 
     devel/fossology/files fossology.in patch-common__Makefile 
                           patch-common__fo-postinstall.in 
                           patch-db__Makefile patch-db__dbcreate.in 
                           patch-scheduler__lockfs.c 
                           patch-scheduler__mkschedconf.c 
                           patch-scheduler__selftest.c 
                           pkg-message.in 
   Log:
   Remove expired port
   2011-08-09 devel/fossology: Broken for four months with no-one caring
   
   PR:             ports/157593
   
   Revision  Changes    Path
   1.2559    +2 -1      ports/MOVED
   1.4478    +0 -1      ports/devel/Makefile
   1.9       +0 -125    ports/devel/fossology/Makefile (dead)
   1.3       +0 -2      ports/devel/fossology/distinfo (dead)
   1.4       +0 -39     ports/devel/fossology/files/fossology.in (dead)
   1.2       +0 -24     ports/devel/fossology/files/patch-common__Makefile (dead)
   1.3       +0 -116    ports/devel/fossology/files/patch-common__fo-postinstall.in (dead)
   1.2       +0 -17     ports/devel/fossology/files/patch-db__Makefile (dead)
   1.2       +0 -11     ports/devel/fossology/files/patch-db__dbcreate.in (dead)
   1.2       +0 -64     ports/devel/fossology/files/patch-scheduler__lockfs.c (dead)
   1.2       +0 -19     ports/devel/fossology/files/patch-scheduler__mkschedconf.c (dead)
   1.2       +0 -11     ports/devel/fossology/files/patch-scheduler__selftest.c (dead)
   1.2       +0 -58     ports/devel/fossology/files/pkg-message.in (dead)
   1.2       +0 -24     ports/devel/fossology/pkg-descr (dead)
   1.3       +0 -969    ports/devel/fossology/pkg-plist (dead)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
