Subject: pkg/13191: x11/xbanner fixes for xpkgwedge and more
To: None <gnats-bugs@gnats.netbsd.org>
From: None <John.P.Darrow@wheaton.edu>
List: netbsd-bugs
Date: 06/13/2001 14:42:11
>Number:         13191
>Category:       pkg
>Synopsis:       x11/xbanner fixes for xpkgwedge and more
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 13 12:40:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     John Darrow
>Release:        NetBSD/i386 1.5.1_BETA2 20010602; pkgsrc 20010607
>Organization:
Computing Services, Wheaton College, Wheaton, IL
>Environment:
NetBSD rebekah.wheaton.edu 1.5.1_BETA2 NetBSD 1.5.1_BETA2 (REBEKAH) #0: Thu Jun  7 06:19:18 CDT 2001     jdarrow@michal.wheaton.edu:/var/src/sys/arch/i386/compile/REBEKAH i386


>Description:
This pr attempts to address three issues with the x11/xbanner package:

1. The package attempts to force install itself into X11BASE, even
with xpkgwedge installed.  This causes the 'make package' to fail.

2. The build also compiles a program called random_effect, and installs
the documentation for it (share/doc/xbanner/rnd_doc.html) but doesn't
install the random_effect program itself.

3. The install hardcoded '-s -m 0755 -o root -g bin' instead of using
STRIPFLAG, BINMODE, BINOWN, BINGRP (or the INSTALL_PROGRAM macro).

I at first tried to get the BINOWN et. al. stuff into the Imakefile via
patch-aa (which was where the X11BASE causing issue 1 was located), but
couldn't find a good way to do so.  I decided that, since the package
already included a post-install target to install the documentation, I'd
just go ahead and change it into a do-install for all the files.  This
also took care of issues 2 and 3.

Another more general issue comes up as to the use of X11PREFIX vs. PREFIX
in install commands.  I feel that for consistency's sake, a program should
always use PREFIX when referring to its own files, and only use X11PREFIX
the same way it uses LOCALBASE - for referring to files from other
packages.  The patch provided reflects this.

From the bulk build:

[...]
gcc -o xb_check -O2      -L/usr/pkg/lib -L/usr/X11R6/lib  xb_check.o     -L/usr/
X11R6/lib       -Wl,-rpath,/usr/pkg/lib:/usr/X11R6/lib -Wl,-rpath,/usr/X11R6/lib
xb_check.o: In function `main':
xb_check.o(.text+0xd6b): warning: this program uses gets(), which is unsafe.
gcc -O2     -I/usr/pkg/include -I/usr/X11R6/include  -DCSRG_BASED   -DFUNCPROTO=
15 -DNARROWPROTO  -DHAS_XPM -DX11BASE=\"/usr/X11R6\"  -c random_effect.c
rm -f random_effect
gcc -o random_effect -O2      -L/usr/pkg/lib -L/usr/X11R6/lib  random_effect.o  
   -L/usr/X11R6/lib       -Wl,-rpath,/usr/pkg/lib:/usr/X11R6/lib -Wl,-rpath,/usr
/X11R6/lib
===> Installing for xbanner-1.31
install -c  -s -m 0755 -o root -g bin  xbanner  /usr/X11R6/bin/xbanner
install -c  -s -m 0755 -o root -g bin  freetemp  /usr/X11R6/bin/freetemp
install -c  -s -m 0755 -o root -g bin  xb_check  /usr/X11R6/bin/xb_check
install in . done
for f in Changes.txt Credits.txt Resource_Reference.html         XBanner_Users_M
anual.html email.gif fonttips.html       index.html red_line.gif rnd_doc.html st
ars.gif          xb_check.html; do                                       install
 -c -o root -g wheel -m 444 /var/pkgsrc.orig/x11/xbanner/work/XBanner1.31/docs/$
f /usr/pkg/share/doc/xbanner;  done
install -c -o root -g wheel -m 444 /var/pkgsrc.orig/x11/xbanner/work/XBanner1.31
/samples/XBanner.ad  /usr/pkg/lib/X11/app-defaults/XBanner
ls: /usr/pkg/bin/freetemp: No such file or directory
ls: /usr/pkg/bin/xb_check: No such file or directory
ls: /usr/pkg/bin/xbanner: No such file or directory
===> Registering installation for xbanner-1.31
pkg_create: can't stat `/usr/pkg/bin/xbanner'
pkg_create: can't stat `/usr/pkg/bin/freetemp'
pkg_create: can't stat `/usr/pkg/bin/xb_check'
xbanner-1.31 requires installed package xpm-3.4k
===> Building binary package for xbanner-1.31
pkg_create: can't stat `/usr/pkg/bin/xbanner'
pkg_create: can't stat `/usr/pkg/bin/freetemp'
pkg_create: can't stat `/usr/pkg/bin/xb_check'
tar: can't add file bin/xbanner : No such file or directory
tar: can't add file bin/freetemp : No such file or directory
tar: can't add file bin/xb_check : No such file or directory
pkg_create: tar command failed with code 768
Creating package /nsource/packages/i386/1.5/All/xbanner-1.31.tgz
Registering depends: xpm-3.4k.
Using SrcDir value of /usr/pkg
Creating gzip'd tar ball in '/nsource/packages/i386/1.5/All/xbanner-1.31.tgz'
*** Error code 1

Stop.
*** Error code 1

Stop.
*** Error code 1

Stop.
BULK> xbanner-1.31 was marked as broken:
-rw-r--r--  1 root  wheel  6236 Jun  7 14:07 .broken

>How-To-Repeat:
( cd x11/xbanner && make package ) with xpkgwedge installed

>Fix:
Apply the following patch to Makefile, replace pkg/PLIST and
patches/patch-aa with the provided versions, and rebuild distinfo.
(PLIST is also now sorted.)

--- /source/sup/current/pkgsrc/x11/xbanner/Makefile	Sun Feb 25 07:20:40 2001
+++ /bulkbuild/var/pkgsrc.orig/x11/xbanner/Makefile	Wed Jun 13 14:03:21 2001
@@ -14,15 +14,18 @@
 
 NO_INSTALL_MANPAGES=	YES
 
-post-install:
-	@${INSTALL_DATA_DIR} ${X11PREFIX}/share/doc/xbanner
+do-install:
+	for f in xbanner freetemp xb_check random_effect; do		\
+		${INSTALL_PROGRAM} ${WRKSRC}/$$f ${PREFIX}/bin;		\
+	done
+	@${INSTALL_DATA_DIR} ${PREFIX}/share/doc/xbanner
 	for f in Changes.txt Credits.txt Resource_Reference.html	\
 		XBanner_Users_Manual.html email.gif fonttips.html	\
 		index.html red_line.gif rnd_doc.html stars.gif		\
 		xb_check.html; do					\
-		${INSTALL_DATA} ${WRKSRC}/docs/$$f ${X11PREFIX}/share/doc/xbanner; \
+		${INSTALL_DATA} ${WRKSRC}/docs/$$f ${PREFIX}/share/doc/xbanner; \
 	done
 	${INSTALL_DATA} ${WRKSRC}/samples/XBanner.ad \
-		${X11PREFIX}/lib/X11/app-defaults/XBanner
+		${PREFIX}/lib/X11/app-defaults/XBanner
 
 .include "../../mk/bsd.pkg.mk"


@comment $NetBSD: PLIST,v 1.2 1998/08/18 22:31:59 tron Exp $
bin/freetemp
bin/random_effect
bin/xb_check
bin/xbanner
lib/X11/app-defaults/XBanner
share/doc/xbanner/Changes.txt
share/doc/xbanner/Credits.txt
share/doc/xbanner/Resource_Reference.html
share/doc/xbanner/XBanner_Users_Manual.html
share/doc/xbanner/email.gif
share/doc/xbanner/fonttips.html
share/doc/xbanner/index.html
share/doc/xbanner/red_line.gif
share/doc/xbanner/rnd_doc.html
share/doc/xbanner/stars.gif
share/doc/xbanner/xb_check.html
@dirrm share/doc/xbanner

$NetBSD: patch-aa,v 1.3 1998/11/12 15:01:17 agc Exp $

--- Imakefile.orig	Thu May 15 22:38:25 1997
+++ Imakefile	Wed Aug 19 00:21:21 1998
@@ -6,15 +6,15 @@
 
 XCOMM Install directory:
 
-LOCALBINDIR=/usr/X11/bin
-ETCDIR=/etc/X11/xdm
+LOCALBINDIR=${PREFIX}/bin
+ETCDIR=${X11BASE}/lib/X11/xdm
 
 XCOMM ***** No need to touch anything below this! *****
 
 XCOMM Compile directives
 
 XCOMM *** Remove following line if you don't have XPM!
-DEFINES=-DHAS_XPM
+DEFINES=-DHAS_XPM -DX11BASE=\"${X11BASE}\"
 
 AllTarget($(PROGRAMS))
 SingleProgramTarget(xbanner, backg.o colors.o effect.o linger.o pix.o plasma.o ripples.o util.o xbanner.o xres.o , /**/ , -lXpm -lX11 -lm )
>Release-Note:
>Audit-Trail:
>Unformatted: