ports/157609: Fix port: irc/bitlbee-otr should use USERS

Chris Rees utisoft at gmail.com
Sat Jun 4 12:30:08 UTC 2011


>Number:         157609
>Category:       ports
>Synopsis:       Fix port: irc/bitlbee-otr 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:   Sat Jun 04 12:30: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 note that files/pkg-deinstall.in and files/pkg-install.in have been removed


--- irc-bitlbee-ort.patch begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/irc/bitlbee-otr/Makefile,v
retrieving revision 1.59
diff -u -r1.59 Makefile
--- Makefile	8 Aug 2010 16:41:53 -0000	1.59
+++ Makefile	4 Jun 2011 10:49:17 -0000
@@ -16,6 +16,7 @@
 COMMENT=	An IRC to other chat networks gateway with support for OTR
 
 SUB_FILES=	pkg-message
+SUB_LIST+=	BITLBEEUSER=${BITLBEEUSER}
 MAN5=		bitlbee.conf.5
 MAN8=		bitlbee.8
 PORTDOCS=	AUTHORS CHANGES CREDITS FAQ README
@@ -45,22 +46,12 @@
 
 BITLBEEUSER?=	bitlbee
 BITLBEEGROUP?=	bitlbee
-BITLBEEDIR?=	/nonexistent
-
-BITLBEEUID=	914
-BITLBEEGID=	${BITLBEEUID}
+USERS=		${BITLBEEUSER}
+GROUPS=		${BITLBEEGROUP}
 
 PLIST_SUB=	BITLBEEUSER=${BITLBEEUSER} \
 		BITLBEEGROUP=${BITLBEEGROUP}
 
-SUB_LIST+=	BITLBEEUSER=${BITLBEEUSER} \
-		BITLBEEGROUP=${BITLBEEGROUP} \
-		BITLBEEDIR=${BITLBEEDIR} \
-		BITLBEEUID=${BITLBEEUID} \
-		BITLBEEGID=${BITLBEEGID}
-
-SUB_FILES+=	pkg-install pkg-deinstall
-
 .include <bsd.port.options.mk>
 
 .if !defined(WITHOUT_MSN)
@@ -127,9 +118,6 @@
 	@${REINPLACE_CMD} -e "s:-iquote:-I:g" ${WRKSRC}/configure
 .endif
 
-pre-install:
-	@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
-
 post-install:
 	${MKDIR} ${PREFIX}/etc/bitlbee
 	${MKDIR} -m 0700 /var/db/bitlbee
Index: files/pkg-deinstall.in
===================================================================
RCS file: files/pkg-deinstall.in
diff -N files/pkg-deinstall.in
--- files/pkg-deinstall.in	15 Nov 2008 22:13:14 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,17 +0,0 @@
-#!/bin/sh -
-#
-# $FreeBSD: ports/irc/bitlbee-otr/files/pkg-deinstall.in,v 1.2 2008/11/15 22:13:14 miwi Exp $
-#
-
-BITLBEEUSER=%%BITLBEEUSER%%
-BITLBEEGROUP=%%BITLBEEGROUP%%
-
-if [ "$2" = "POST-DEINSTALL" ]; then
-  if /usr/sbin/pw group show "${BITLBEEGROUP}" 2>&1 >/dev/null; then
-    echo "You should manually remove the \"${BITLBEEGROUP}\" group."
-  fi
-
-  if /usr/sbin/pw user show "${BITLBEEUSER}" 2>&1 >/dev/null; then
-    echo "You should manually remove the \"${BITLBEEUSER}\" user."
-  fi
-fi
Index: files/pkg-install.in
===================================================================
RCS file: files/pkg-install.in
diff -N files/pkg-install.in
--- files/pkg-install.in	15 Nov 2008 22:13:14 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,74 +0,0 @@
-#!/bin/sh -
-#
-# $FreeBSD: ports/irc/bitlbee-otr/files/pkg-install.in,v 1.2 2008/11/15 22:13:14 miwi Exp $
-#
-
-BITLBEEDIR=%%BITLBEEDIR%%
-BITLBEEUSER=%%BITLBEEUSER%%
-BITLBEEGROUP=%%BITLBEEGROUP%%
-BITLBEEUID=%%BITLBEEUID%%
-BITLBEEGID=%%BITLBEEGID%%
-
-ask() {
-  local question default answer
-
-  question=$1
-  default=$2
-  if [ -z "${PACKAGE_BUILDING}" ]; then
-    read -p "${question} [${default}]? " answer
-  fi
-  if [ "x${answer}" = "x" ]; then
-    answer=${default}
-  fi
-  echo ${answer}
-}
-
-yesno() {
-  local default question answer
-
-  question=$1
-  default=$2
-  while :; do
-    answer=$(ask "${question}" "${default}")
-    case "${answer}" in
-      [Yy][Ee][Ss]|[Yy])
-        return 0
-        ;;
-      [Nn][Oo]|[Nn])
-        return 1
-        ;;
-    esac
-    echo "Please answer yes or no."
-   done
-}
-
-if [ "$2" = "PRE-INSTALL" ]; then
-  if /usr/sbin/pw group show "${BITLBEEGROUP}" 2>&1 >/dev/null; then
-    echo "You already have a \"${BITLBEEGROUP}\" group, so I will use it."
-  else
-    echo "You need a \"${BITLBEEGROUP}\" group."
-    if yesno "Would you like me to create it" "YES"; then
-      /usr/sbin/pw groupadd "${BITLBEEGROUP}" -g "${BITLBEEGID}" -h - || \
-        /usr/sbin/pw groupadd "${BITLBEEGROUP}" -h - || exit
-      echo "Done."
-    else
-      echo "Please create the \"${BITLBEEGROUP}\" group manually and try again."
-      exit 1
-    fi
-  fi
-
-  if /usr/sbin/pw user show "${BITLBEEUSER}" 2>&1 >/dev/null; then
-    echo "You already have a \"${BITLBEEUSER}\" user, so I will use it."
-  else
-    echo "You need a \"${BITLBEEUSER}\" user."
-    if yesno "Would you like me to create it" "YES"; then
-      /usr/sbin/pw useradd "${BITLBEEUSER}" -u "${BITLBEEUID}" -g "${BITLBEEGROUP}" -h - -d "${BITLBEEDIR}" \
-        -s /sbin/nologin -c "Bitlbee pseudo-user" || \
-        /usr/sbin/pw useradd "${BITLBEEUSER}" -g "${BITLBEEGROUP}" -h - -d "${BITLBEEDIR}" \
-        -s /sbin/nologin -c "Bitlbee pseudo-user" || exit
-    else
-      echo "Please create the \"${BITLBEEUSER}\" user manually and try again."
-      exit 1
-    fi
-  fi
-fi
--- irc-bitlbee-ort.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