Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Oct 2011 02:21:44 GMT
From:      Jan Mikkelsen <janm@transactionware.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/161951: mail/dovecot2-antispam-plugin hangs fails when built without $HOME set and no ksh
Message-ID:  <201110240221.p9O2LiIs066026@red.freebsd.org>
Resent-Message-ID: <201110240230.p9O2U1lX055578@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         161951
>Category:       ports
>Synopsis:       mail/dovecot2-antispam-plugin hangs fails when built without $HOME set and no ksh
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 24 02:30:01 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Jan Mikkelsen
>Release:        8.2-p4
>Organization:
Transactionware
>Environment:
FreeBSD valhalla.transactionware.com 8.2-RELEASE-p4 FreeBSD 8.2-RELEASE-p4 #0: Fri Oct  7 18:19:51 EST 2011     root@valhalla.transactionware.com:/home/janm/p4/freebsd-image-std-2008.2/work/base-freebsd/home/janm/p4/freebsd-image-std-2008.2/FreeBSD/src/sys/GENERIC  amd64
>Description:
Building the mail/dovecot2-antispam-plugin port fails when ksh is not installed and $HOME is not set. Installing shells/pdksh makes the build hang rather than complete, so adding that as a build dependency does not help.

The cause is the txt2man script in the port that attempts to figure out whether it has a modern /bin/sh and feeds itself to ksh if it doesn't. FreeBSD has a modern /bin/sh and doesn't always have ksh, so the test can cause problems.

See attached patch for resolution.
>How-To-Repeat:
Attempt to build the port after clearing the environment. "sudo env - make package" in the port directory should be sufficient.

Build command that demonstrated  the problem was:

/usr/sbin/chroot /home/janm/p4/freebsd-image-std-2008.2/work/build-chroot \
 /usr/bin/env - \
 PATH=/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin \
 /bin/sh -cxe '
 cd /usr/ports/mail/dovecot2-antispam-plugin
 env NO_MTREE="true" make package WRKDIRPREFIX=/ports-work PKGFILE='/ports-packages/dovecot2-antispam-plugin-20101222.tbz' BATCH=yes NODEPENDS=yes PACKAGE_BUILDING=yes'
>Fix:
Put the following into mail/dovecot2-antispam-plugin/files/patch-txt2man 
*** doc/txt2man.orig	Fri Oct  7 17:45:27 2011
--- doc/txt2man	Fri Oct  7 17:45:35 2011
***************
*** 1,5 ****
  #!/bin/sh
- test "$HOME" = ~ || exec ksh $0 "$@"    # try ksh if sh too old (not yet POSIX)
  
  # Copyright (C) 2001, 2002, 2003 Marc Vertes
  
--- 1,4 ----


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110240221.p9O2LiIs066026>