docs/94151: [PATCH] Porter's Handbook: plist-autoplist improvement
Roman Neuhauser
neuhauser at sigpipe.cz
Mon Mar 6 23:00:23 UTC 2006
>Number: 94151
>Category: docs
>Synopsis: [PATCH] Porter's Handbook: plist-autoplist improvement
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-doc
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Mon Mar 06 23:00:22 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Roman Neuhauser
>Release: FreeBSD 4.11-STABLE i386
>Organization:
>Environment:
System: FreeBSD isis.sigpipe.cz 4.11-STABLE FreeBSD 4.11-STABLE #0: Fri Jan 27 13:39:33 CET 2006 root at isis.sigpipe.cz:/usr/obj/usr/src/sys/FREEPUPPY2_6 i386
>Description:
The attached patch slightly improves the "Automated package list
creation" section in Porter's Handbook by making the code listings
directly copypastable.
A more ambitious person could also reflow the section so that the text
lists the complete code at one place somewhere.
>How-To-Repeat:
Try updating a port's plist when you're extra lazy.
>Fix:
--- doc::en::books::porters-handbook.sgml-portname,0.patch begins here ---
Index: book.sgml
===================================================================
RCS file: /home/ncvs/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml,v
retrieving revision 1.685
diff -u -u -r1.685 book.sgml
--- book.sgml 26 Feb 2006 10:41:25 -0000 1.685
+++ book.sgml 6 Mar 2006 21:20:50 -0000
@@ -6176,13 +6176,13 @@
for ports which install into the directory hierarchy of XFree86 4
or an earlier XFree86 release, respectively.</para>
- <screen>&prompt.root; <userinput>mkdir /var/tmp/<replaceable>port-name</replaceable></userinput>
-&prompt.root; <userinput>mtree -U -f /etc/mtree/BSD.<replaceable>port-type</replaceable>.dist -d -e -p /var/tmp/<replaceable>port-name</replaceable></userinput>
-&prompt.root; <userinput>make depends PREFIX=/var/tmp/<replaceable>port-name</replaceable></userinput></screen>
+ <screen>&prompt.root; <userinput>mkdir /var/tmp/$(make -V PORTNAME)</userinput>
+&prompt.root; <userinput>mtree -U -f $(make -V MTREE_FILE) -d -e -p /var/tmp/$(make -V PORTNAME)</userinput>
+&prompt.root; <userinput>make depends PREFIX=/var/tmp/$(make -V PORTNAME)</userinput></screen>
<para>Store the directory structure in a new file.</para>
- <screen>&prompt.root; <userinput>(cd /var/tmp/<replaceable>port-name</replaceable> && find -d * -type d) | sort > OLD-DIRS</userinput></screen>
+ <screen>&prompt.root; <userinput>(cd /var/tmp/$(make -V PORTNAME) && find -d * -type d) | sort > OLD-DIRS</userinput></screen>
<para>Create an empty <filename>pkg-plist</filename> file:</para>
@@ -6191,13 +6191,13 @@
<para>If your port honors <makevar>PREFIX</makevar> (which it should)
you can then install the port and create the package list.</para>
- <screen>&prompt.root; <userinput>make install PREFIX=/var/tmp/<replaceable>port-name</replaceable></userinput>
-&prompt.root; <userinput>(cd /var/tmp/<replaceable>port-name</replaceable> && find -d * \! -type d) | sort > pkg-plist</userinput></screen>
+ <screen>&prompt.root; <userinput>make install PREFIX=/var/tmp/$(make -V PORTNAME)</userinput>
+&prompt.root; <userinput>(cd /var/tmp/$(make -V PORTNAME) && find -d * \! -type d) | sort > pkg-plist</userinput></screen>
<para>You must also add any newly created directories to the packing
list.</para>
- <screen>&prompt.root; <userinput>(cd /var/tmp/<replaceable>port-name</replaceable> && find -d * -type d) | sort | comm -13 OLD-DIRS - | sort -r | sed -e 's#^#@dirrm #' >> pkg-plist</userinput></screen>
+ <screen>&prompt.root; <userinput>(cd /var/tmp/$(make -V PORTNAME) && find -d * -type d) | sort | comm -13 OLD-DIRS - | sort -r | sed -e 's#^#@dirrm #' >> pkg-plist</userinput></screen>
<para>Finally, you need to tidy up the packing list by hand; it is not
<emphasis>all</emphasis> automated. Manual pages should be listed in
@@ -6221,12 +6221,12 @@
<command>make depends</command>. Then build and install the
port:</para>
- <screen>&prompt.root; <userinput>make install PREFIX=/var/tmp/<replaceable>port-name</replaceable></userinput></screen>
+ <screen>&prompt.root; <userinput>make install PREFIX=/var/tmp/$(make -V PORTNAME)</userinput></screen>
<para>And let <command>plist</command> create the
<filename>pkg-plist</filename> file:</para>
- <screen>&prompt.root; <userinput>/usr/ports/Tools/scripts/plist -Md -m /etc/mtree/BSD.<replaceable>port-type</replaceable>.dist /var/tmp/<replaceable>port-name</replaceable> > pkg-plist</userinput></screen>
+ <screen>&prompt.root; <userinput>/usr/ports/Tools/scripts/plist -Md -m $(make -V MTREE_FILE) /var/tmp/$(make -V PORTNAME) > pkg-plist</userinput></screen>
<para>The packing list still has to be tidied up by hand as
stated above.</para>
@@ -6525,7 +6525,7 @@
<filename>/usr/local</filename> instead of <makevar>PREFIX</makevar>.
A quick test for this is to do this is:</para>
- <screen>&prompt.root; <userinput>make clean; make package PREFIX=/var/tmp/<replaceable>port-name</replaceable></userinput></screen>
+ <screen>&prompt.root; <userinput>make clean; make package PREFIX=/var/tmp/$(make -V PORTNAME)</userinput></screen>
<para>If anything is installed outside of <makevar>PREFIX</makevar>,
the package creation process will complain that it
@@ -6535,7 +6535,7 @@
<para>This does not test for the existence of internal references,
or correct use of <makevar>LOCALBASE</makevar> for references to
files from other ports. Testing the installation in
- <filename>/var/tmp/<replaceable>port-name</replaceable></filename>
+ <filename>/var/tmp/$(make -V PORTNAME)</filename>
to do that while you have it installed would do that.</para>
<para>Do not set <makevar>USE_X_PREFIX</makevar> unless your port
--- doc::en::books::porters-handbook.sgml-portname,0.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-doc
mailing list