From owner-freebsd-ports Fri Jan 3 03:00:29 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id DAA13212 for ports-outgoing; Fri, 3 Jan 1997 03:00:29 -0800 (PST) Received: from dfw-ix8.ix.netcom.com (dfw-ix8.ix.netcom.com [206.214.98.8]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id DAA13207 for ; Fri, 3 Jan 1997 03:00:27 -0800 (PST) Received: from silvia.HIP.Berkeley.EDU (ala-ca9-50.ix.netcom.com [207.93.143.114]) by dfw-ix8.ix.netcom.com (8.6.13/8.6.12) with ESMTP id CAA18251 for ; Fri, 3 Jan 1997 02:59:52 -0800 Received: (from asami@localhost) by silvia.HIP.Berkeley.EDU (8.8.4/8.6.9) id CAA01347; Fri, 3 Jan 1997 02:59:49 -0800 (PST) Date: Fri, 3 Jan 1997 02:59:49 -0800 (PST) Message-Id: <199701031059.CAA01347@silvia.HIP.Berkeley.EDU> To: ports@freebsd.org Subject: on-the-fly PLIST generation From: asami@cs.berkeley.edu (Satoshi Asami) Sender: owner-ports@freebsd.org X-Loop: FreeBSD.org Precedence: bulk How about something like the following. (1) pkg_create will use PLIST.tmp as the packing list. (2) bsd.port.mk will create it from PLIST at the end of build. (3) porters can override it by generating PLIST.tmp prior to (2) or overwriting it after (2) (the latter works because it won't be used until the end of the install: target). A quick patch: === Index: bsd.port.mk =================================================================== RCS file: /usr/cvs/src/share/mk/bsd.port.mk,v retrieving revision 1.241 diff -u -r1.241 bsd.port.mk --- bsd.port.mk 1996/12/23 02:49:35 1.241 +++ bsd.port.mk 1997/01/03 10:49:46 @@ -389,7 +389,7 @@ PKG_CMD?= /usr/sbin/pkg_create .if !defined(PKG_ARGS) -PKG_ARGS= -v -c ${PKGDIR}/COMMENT -d ${PKGDIR}/DESCR -f ${PKGDIR}/PLIST -p ${PREFIX} -P "`${MAKE} package-depends|sort -u`" +PKG_ARGS= -v -c ${PKGDIR}/COMMENT -d ${PKGDIR}/DESCR -f ${PKGDIR}/PLIST.tmp -p ${PREFIX} -P "`${MAKE} package-depends|sort -u`" .if exists(${PKGDIR}/INSTALL) PKG_ARGS+= -i ${PKGDIR}/INSTALL .endif @@ -923,7 +923,7 @@ .if !target(do-package) do-package: - @if [ -e ${PKGDIR}/PLIST ]; then \ + @if [ -e ${PKGDIR}/PLIST.tmp ]; then \ ${ECHO_MSG} "===> Building package for ${PKGNAME}"; \ if [ -d ${PACKAGES} ]; then \ if [ ! -d ${PKGREPOSITORY} ]; then \ @@ -1027,6 +1027,9 @@ .endfor .endif .endif +.if make(real-build) && !exists(${PKGDIR}/PLIST.tmp) && exists(${PKGDIR}/PLIST) + @${CP} ${PKGDIR}/PLIST ${PKGDIR}/PLIST.tmp +.endif .if make(real-install) && !defined(NO_PKG_REGISTER) @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} fake-pkg .endif @@ -1157,6 +1160,9 @@ @${MAKE} clean-depends .endif @${ECHO_MSG} "===> Cleaning for ${PKGNAME}" +.if exists(${PKGDIR}/PLIST.tmp) + @${RM} -f ${PKGDIR}/PLIST.tmp +.endif .if !defined(NO_WRKDIR) @if [ -d ${WRKDIR} ]; then \ if [ -w ${WRKDIR} ]; then \ @@ -1542,7 +1548,7 @@ .if !target(fake-pkg) fake-pkg: - @if [ ! -f ${PKGDIR}/PLIST -o ! -f ${PKGDIR}/COMMENT -o ! -f ${PKGDIR}/DESCR ]; then ${ECHO} "** Missing package files for ${PKGNAME} - installation not recorded."; exit 1; fi + @if [ ! -f ${PKGDIR}/PLIST.tmp -o ! -f ${PKGDIR}/COMMENT -o ! -f ${PKGDIR}/DESCR ]; then ${ECHO} "** Missing package files for ${PKGNAME} - installation not recorded."; exit 1; fi @if [ ! -d ${PKG_DBDIR} ]; then ${RM} -f ${PKG_DBDIR}; ${MKDIR} ${PKG_DBDIR}; fi .if defined(FORCE_PKG_REGISTER) @${RM} -rf ${PKG_DBDIR}/${PKGNAME} === Of course, the ${CP} can be changed to do all the right things (manpage compression suffix etc.) in the future. Satoshi