ports/157631: Fix port: databases/gnats should use USERS
Chris Rees
utisoft at gmail.com
Sun Jun 5 18:40:10 UTC 2011
>Number: 157631
>Category: ports
>Synopsis: Fix port: databases/gnats 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: Sun Jun 05 18:40:09 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=
I've discussed on IRC with linimon about leaving gnats4 alone -- it chooses the wrong directory for its home, but the UIDs entry for gnats user matches this port fine.
Unfortunately because of the FORBIDDEN status I haven't been able to Tinderbox it... if you want to bin this PR feel free, I just didn't want to throw away the patch I'd written without sticking it up for review!
>How-To-Repeat:
>Fix:
- Use USERS
Submitted by: Chris Rees (utisoft at gmail.com)
--- databases-gnats.patch begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/databases/gnats/Makefile,v
retrieving revision 1.55
diff -u -r1.55 Makefile
--- Makefile 30 Dec 2005 18:57:00 -0000 1.55
+++ Makefile 2 Jun 2011 12:32:40 -0000
@@ -31,6 +31,7 @@
MAN7= gnats.7
MAN8= mkcat.8 rmcat.8 mkdist.8 queue-pr.8 file-pr.8 gen-index.8
INFO= gnats send-pr
+USERS= ${PORTNAME}
# this stops the configuration program from pulling installation
# information in from the standard freebsd send-pr program
@@ -48,9 +49,6 @@
(cd ${WRKSRC}/gnats; ${MAKE} info)
(cd ${WRKSRC}/send-pr; ${MAKE} info)
-pre-install:
- @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
-
post-install:
(cd ${DATADIR} && ${MV} gnats-db gnats-db.dist)
.if defined(WANT_FREEFALL_CFG)
Index: pkg-install
===================================================================
RCS file: pkg-install
diff -N pkg-install
--- pkg-install 24 Jan 1998 22:17:14 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,95 +0,0 @@
-#!/bin/sh
-# an installation script for GNATS
-
-check_pw()
-{
- if which -s pw; then
- :
- else
- cat <<EOF
-
-This system looks like a pre-2.2 version of FreeBSD. We see that it
-is missing the "pw" utility. We need this utility. Please get and
-install it, and try again. You can get the source from:
-
- ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.sbin/pw.tar.gz
-
-Otherwise, just manually create the gnats user.
-
-EOF
- exit 1
- fi
-}
-
-ask() {
- local question default answer
-
- question=$1
- default=$2
- if [ -z "${PACKAGE_BUILDING}" ]; then
- read -p "${question} (y/n) [${default}]? " answer
- fi
- if [ x${answer} = x ]; then
- answer=${default}
- fi
- echo ${answer}
-}
-
-yesno() {
- local dflt question answer
-
- question=$1
- dflt=$2
- while :; do
- answer=$(ask "${question}" "${dflt}")
- case "${answer}" in
- [Yy]*) return 0;;
- [Nn]*) return 1;;
- esac
- echo "Please answer yes or no."
- done
-}
-
-case $2 in
-PRE-INSTALL)
-printenv > /tmp/pe
- ## Hack /etc/master.passwd ##
- # check
- id_61=`id -u 61 2> /dev/null`
- id_gnats=`id -u gnats 2> /dev/null`
- if [ X"$id_gnats" != X ];then
- exit 0
- elif [ X"$id_61" != X ]; then
- cat <<EOF
-
-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-This system already has an account whose name is not 'gnats' and UID
-number is 61.
-
- '`id 61`'
-
-The new FreeBSD standard userid for the gnats user is 61, however you can
-actually pick and UID number if you create the 'gnats' user by hand.
-
-Please try to install this package again after you manually create a 'gnats'
-account.
-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-EOF
- exit 1
- fi
-
- # add an account 'gnats' to this system
- echo ""
- echo "You need to create a user called 'gnats'"
- if yesno "Would you like to create it automatically?" y; then
- # We need a command 'pw(8)'
- check_pw
- pw useradd gnats -u 61 -g 1 -h - -d ${PKG_PREFIX}/share/gnats/gnats-db \
- -c 'GNATS database owner' || exit
- grep -s gnats /etc/ftpusers || echo gnats >>/etc/ftpusers
- else
- echo "Please create it, and try again."
- exit 1
- fi
- ;;
-esac
--- databases-gnats.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