docs/69271: Porter's Handbook: hint on proper pkg-message usage

Alexey Dokuchaev danfe at regency.nsu.ru
Mon Jul 19 09:10:09 UTC 2004


>Number:         69271
>Category:       docs
>Synopsis:       Porter's Handbook: hint on proper pkg-message usage
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 19 09:10:07 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Alexey Dokuchaev
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
CNIT NSU
>Environment:
System: FreeBSD regency.nsu.ru 4.9-STABLE FreeBSD 4.9-STABLE #1: Wed Mar 3 13:17:54 NOVT 2004 root at regency.nsu.ru:/usr/src/sys/compile/REGENCY i386
>Description:
Sometimes porter might want to alter supplied pkg-message so it reflects
the reality better, with information available at run-time.  Special
care should be taken here, as to ensure coherent pkg-message would go
into package.  Since it's not that obvious to an average porter, and
straightforward solution is, in fact, wrong, I therefore propose the
following text to be added to Porter's Handbook (see below).
>How-To-Repeat:
N/A (but you can see games/fuhquake/Makefile for real-life usage).
>Fix:
%%%
Index: book.sgml
===================================================================
RCS file: /home/pub/ftp/pub/FreeBSD/development/FreeBSD-CVS/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml,v
retrieving revision 1.461
diff -u -r1.461 book.sgml
--- book.sgml	12 Jul 2004 08:24:15 -0000	1.461
+++ book.sgml	19 Jul 2004 03:47:03 -0000
@@ -4986,6 +5004,22 @@
 	    package, so you should probably display it from the
 	    <maketarget>post-install</maketarget> target yourself.</para>
 	</note>
+
+	<para>Sometimes you have your <filename>pkg-message</filename> semi-ready,
+	  that is, having to substitute some text in it with actual run-time
+	  value.  In this case, make sure you preserve modified
+	  <filename>pkg-message</filename> since you likely need it to make the
+	  package.  For example:</para>
+
+	<programlisting>post-install:
+	@${SED} -e 's|$${DATADIR}|${DATADIR}|g' ${.CURDIR}/pkg-message > ${PKGMESSAGE}
+	@${CAT} ${PKGMESSAGE}</programlisting>
+
+	<para>Contrary, wrong way would be:</para>
+
+	<programlisting>post-install:
+	@${SED} -e 's|$${DATADIR}|${DATADIR}|g' ${PKGMESSAGE}</programlisting>
+
       </sect1>
 
       <sect1 id="pkg-install">
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-doc mailing list