Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Jan 1997 02:59:49 -0800 (PST)
From:      asami@cs.berkeley.edu (Satoshi Asami)
To:        ports@freebsd.org
Subject:   on-the-fly PLIST generation
Message-ID:  <199701031059.CAA01347@silvia.HIP.Berkeley.EDU>

next in thread | raw e-mail | index | archive | help
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



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