Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Aug 1998 17:11:12 -0700 (PDT)
From:      asami@FreeBSD.ORG (Satoshi Asami)
To:        obrien@NUXI.com, ac199@hwcn.org, ports@FreeBSD.ORG
Subject:   Re: cvs commit: ports/lang/glibstdc++28 Makefile
Message-ID:  <199808180011.RAA02418@silvia.hip.berkeley.edu>
In-Reply-To: <199808172304.QAA25899@silvia.hip.berkeley.edu> (asami@FreeBSD.org)

next in thread | previous in thread | raw e-mail | index | archive | help
Here's a diff (only slightly tested!).  It now creates ${TMPPLIST}
between do-instal and post-install.  Also, I moved the test of missing
package files right before that.  (The -f ${PLIST} should have been a
shell test and not exists() anyway...or it won't work if people need
to generate ${PLIST} in pre-install or do-install.)

I took out the .if make(real-package) part of the test, in case people 
need to frob with the generated ${TMPPLIST}.  Otherwise porters need
to do same frobbing in post-package too.  The downside of this is that 
if you are testing a port and change pkg/PLIST, you need to run "make
generate-plist" (or just "make reinstall" if you can't remember that
name) to regenerate ${TMPPLIST} for your changes to take effect.  But
I think that will be fine as long as we document it.

I also got rid of NO_PKG_REGISTER which wasn't used in any port, it
was cluttering up all sorts of conditionals for no real purpose.  I
have no idea what I was thinking when I added it in the first place.

One thing we can easily add is to substitute stuff in DESCR.  Things
like PREFIX come to mind.  I'm not sure if it's worth the complication
though.

Comments welcome.

Satoshi
-------
Index: bsd.port.mk
===================================================================
RCS file: /usr/cvs/src/share/mk/bsd.port.mk,v
retrieving revision 1.227.2.46
diff -u -r1.227.2.46 bsd.port.mk
--- bsd.port.mk	1998/08/15 17:37:46	1.227.2.46
+++ bsd.port.mk	1998/08/18 00:05:04
@@ -117,7 +117,6 @@
 # NO_LATEST_LINK - Do not install the "Latest" link for package.  Define this
 #				  if this port is a beta version of another stable port
 #				  which is also in the tree.
-# NO_PKG_REGISTER - Don't register a port install as a package.
 # NO_WRKSUBDIR	- Assume port unpacks directly into ${WRKDIR}.
 # NO_WRKDIR		- There's no work directory at all; port does this someplace
 #				  else.
@@ -1194,7 +1193,7 @@
 	@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} build-depends lib-depends misc-depends
 .endif
 .if make(real-install)
-.if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
+.if !defined(FORCE_PKG_REGISTER)
 	@if [ -d ${PKG_DBDIR}/${PKGNAME} ]; then \
 		${ECHO_MSG} "===>  ${PKGNAME} is already installed - perhaps an older version?"; \
 		${ECHO_MSG} "      If so, you may wish to \`\`make deinstall'' and install"; \
@@ -1229,19 +1228,16 @@
 	fi
 .endif
 .endif
-.if (make(real-install) || make(real-package)) && exists(${PLIST})
-	@>${TMPPLIST}
-.for man in ${__MANPAGES}
-	@${ECHO} ${man} >> ${TMPPLIST}
-.endfor
-	@${SED} ${_sedsubplist} ${PLIST} >> ${TMPPLIST}
-.endif
 	@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/pre-/}
 	@if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/} ]; then \
 		cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
 			${SCRIPTDIR}/${.TARGET:S/^real-/pre-/}; \
 	fi
 	@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/do-/}
+# put here so ports can change the contents of ${TMPPLIST} if necessary
+.if make(real-install)
+	@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} generate-plist
+.endif
 	@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/post-/}
 	@if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/post-/} ]; then \
 		cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
@@ -1260,7 +1256,7 @@
 .endfor
 .endif
 .endif
-.if make(real-install) && !defined(NO_PKG_REGISTER)
+.if make(real-install)
 	@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} fake-pkg
 .endif
 .if !make(real-fetch) \
@@ -1788,13 +1784,25 @@
 .endif
 .endif
 
+# Generate packing list.  Also tests to make sure all required package
+# files exist.
+
+.if !target(generate-plist)
+generate-plist:
+	@if [ ! -f ${PLIST} -o ! -f ${COMMENT} -o ! -f ${DESCR} ]; then ${ECHO} "** Missing package files for ${PKGNAME}."; exit 1; fi
+	@>${TMPPLIST}
+.for man in ${__MANPAGES}
+	@${ECHO} ${man} >> ${TMPPLIST}
+.endfor
+	@${SED} ${_sedsubplist} ${PLIST} >> ${TMPPLIST}
+.endif
+
 # Fake installation of package so that user can pkg_delete it later.
 # Also, make sure that an installed port is recognized correctly in
 # accordance to the @pkgdep directive in the packing lists
 
 .if !target(fake-pkg)
 fake-pkg:
-	@if [ ! -f ${TMPPLIST} -o ! -f ${COMMENT} -o ! -f ${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}

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



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