Subject: the first "big" near show-stopper for pkgsrc support on older systems...
To: NetBSD Packages Technical Discussion List <tech-pkg@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: tech-pkg
Date: 05/03/2002 21:57:11
I've just encountered what might be the first big and nearly show-
stopping issue with using pkgsrc-current on older NetBSD systems.

It is sysutils/user, which is not even remotely portable code, and not
even backwards portable to older NetBSD systems.  (There are also other
lesser issues with the whole idea, including the use in mk/install/*.)

For the moment I've simply assumed the QPOPPER_USER will exist:

Index: Makefile
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/mail/qpopper/Makefile,v
retrieving revision 1.31
diff -c -c -r1.31 Makefile
*** Makefile	2 May 2002 16:16:50 -0000	1.31
--- Makefile	4 May 2002 01:47:07 -0000
***************
*** 12,18 ****
  
  MAINTAINER=		mellon@fugue.com
  HOMEPAGE=		http://www.eudora.com/qpopper/
! COMMENT=		Qualcomm's POP server for Eudora
  
  VERSION=		4.0.4
  USE_BUILDLINK_ONLY=	# defined
--- 12,18 ----
  
  MAINTAINER=		mellon@fugue.com
  HOMEPAGE=		http://www.eudora.com/qpopper/
! COMMENT=		"Qualcomm's POP server for Eudora"
  
  VERSION=		4.0.4
  USE_BUILDLINK_ONLY=	# defined
***************
*** 22,28 ****
  
  .include "Makefile.common"
  
! .if exists(/usr/sbin/user)
  USER_CMD=		/usr/sbin/user
  GROUP_CMD=		/usr/sbin/group
  .else
--- 22,33 ----
  
  .include "Makefile.common"
  
! .if defined(QPOPPER_USER_EXISTS)
! USER_CMD=		:
! GROUP_CMD=		:
! .else
! # WARNING: this test breaks if LOCALBASE=/usr and sysutils/user is installed
! .if exists(/usr/sbin/user) && exists(/usr/sbin/group)
  USER_CMD=		/usr/sbin/user
  GROUP_CMD=		/usr/sbin/group
  .else
***************
*** 30,35 ****
--- 35,41 ----
  USER_CMD=		${LOCALBASE}/sbin/user
  GROUP_CMD=		${LOCALBASE}/sbin/group
  .endif
+ .endif
  
  pre-build:
  	${SED} 's"/usr/local/lib"${LOCALBASE}/libexec"' \
***************
*** 37,54 ****
  	${MV} -f ${WRKSRC}/man/popper.8.$$ ${WRKSRC}/man/popper.8
  
  post-build:
! 	for FILE in DEINSTALL INSTALL; do \
! 		${SED}	-e 's|@BINGRP@|${BINGRP}|g' \
! 			-e 's|@CHGRP@|${CHGRP}|g' \
! 			-e 's|@CHOWN@|${CHOWN}|g' \
! 			-e 's|@DB_SUFFIX@|${DB_SUFFIX}|g' \
! 			-e 's|@USER_CMD@|${USER_CMD}|g' \
! 			-e 's|@QPOPPER_USER@|${QPOPPER_USER}|g' \
! 			-e 's|@PKG_PREFIX@|${PREFIX}|g' \
! 			-e 's|@QPOPPER_APOP_AUTH@|${QPOPPER_APOP_AUTH}|g' \
! 			-e 's|@INSTALL_DATA@|${INSTALL_DATA}|g' \
! 			< ${PKGDIR}/$${FILE} > ${WRKDIR}/$${FILE}; \
! 	done
  
  pre-install:
  	PKG_PREFIX=${LOCALBASE} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL
--- 43,60 ----
  	${MV} -f ${WRKSRC}/man/popper.8.$$ ${WRKSRC}/man/popper.8
  
  post-build:
! .for FILE in DEINSTALL INSTALL
! 	${SED}	-e 's|@BINGRP@|${BINGRP}|g' \
! 		-e 's|@CHGRP@|${CHGRP}|g' \
! 		-e 's|@CHOWN@|${CHOWN}|g' \
! 		-e 's|@DB_SUFFIX@|${DB_SUFFIX}|g' \
! 		-e 's|@USER_CMD@|${USER_CMD}|g' \
! 		-e 's|@QPOPPER_USER@|${QPOPPER_USER}|g' \
! 		-e 's|@PKG_PREFIX@|${PREFIX}|g' \
! 		-e 's|@QPOPPER_APOP_AUTH@|${QPOPPER_APOP_AUTH}|g' \
! 		-e 's|@INSTALL_DATA@|${INSTALL_DATA}|g' \
! 		< ${PKGDIR}/${FILE} > ${WRKDIR}/${FILE}
! .endfor
  
  pre-install:
  	PKG_PREFIX=${LOCALBASE} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL


-- 
								Greg A. Woods

+1 416 218-0098;  <gwoods@acm.org>;  <g.a.woods@ieee.org>;  <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>