From tom@eborcom.com  Thu Jan  7 13:51:31 1999
Received: from mail12.svr.pol.co.uk (mail12.svr.pol.co.uk [195.92.193.215])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA13367
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 7 Jan 1999 13:51:30 -0800 (PST)
          (envelope-from tom@eborcom.com)
Received: from modem-45.rocknroll.dialup.pol.co.uk ([62.136.105.173])
	by mail12.svr.pol.co.uk with esmtp (Exim 2.10 #1)
	id 0zyNKV-0000Y2-00
	for FreeBSD-gnats-submit@freebsd.org; Thu, 7 Jan 1999 21:51:00 +0000
Received: (qmail 15633 invoked by uid 5000); 7 Jan 1999 21:23:36 -0000
Message-Id: <19990107212336.15632.qmail@eborcom.com>
Date: 7 Jan 1999 21:23:36 -0000
From: Tom Hukins <tom@eborcom.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Handbook addition: Automated PLIST building for ports
X-Send-Pr-Version: 3.2

>Number:         9375
>Category:       docs
>Synopsis:       Information on how to build PLIST automatically
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan  7 14:00:00 PST 1999
>Closed-Date:    Sat Jun 5 14:38:00 PDT 1999
>Last-Modified:  Sat Jun  5 14:38:50 PDT 1999
>Originator:     Tom Hukins
>Release:        FreeBSD 2.2.8-RELEASE i386
>Organization:
eBORcOM
>Environment:

	

>Description:

As per the recent thread on the freebsd-doc mailing list (Suggestion
for "Making a port yourself" in the Handbook), here is a patch to
the Handbook which contains information on building a packing list
automatically.

This information should be in the handbook because ports may contain
many files, making manual packing list creation unnecessarily
time-consuming.

I'm not entirely sure whether I've put this in the right section of
the document, but if anyone objects it can easily be moved.

>How-To-Repeat:

	

>Fix:

--- porting.sgml.orig	Sat Jan  2 12:37:34 1999
+++ porting.sgml	Thu Jan  7 21:00:30 1999
@@ -154,6 +154,36 @@
 	    sorted alphabetically.  It will make verifying the changes 
 	    when you upgrade the port much easier.
 
+	  <p>Creating a packing list manually can be a very tedious
+	    task.  It is often best to generate the packing list
+	    automatically.
+
+      <sect2>
+	<heading>Creating the packing list automatically</heading>
+	  <p>First, make sure your port is almost complete, with
+	    only the <tt>PLIST</tt> file missing.  Create an empty
+	    <tt>PLIST</tt> with the `<tt>touch files/PLIST</tt>'
+	    command.
+
+	  <p>Next, create a new set of directories which your port
+	    can be installed in with the `<tt>mtree -U -f
+	    /etc/mtree/BSD.local.dist -d -e -p /var/tmp/MY-PORT</tt>'
+	    command.  Store the directory structure in a new file
+	    with `<tt>(cd /var/tmp/MY-PORT && find * -type d) &gt;
+	    OLD-DIRS</tt>'.
+
+	  <p>If your port honours the PREFIX variable (which it
+	    should), you can then type `<tt>make install
+	    PREFIX=/var/tmp/MY-PORT</tt>'.  Once the port has been
+	    installed successfully, create the packing list with
+	    `<tt>(cd /var/tmp/MY-PORT && find * \! -type d) &gt;
+	    pkg/PLIST</tt>'.
+
+	  <p>You also need to add any newly created directories to
+	    the packing list.  To do this, type `<tt>(cd
+	    /var/tmp/MY-PORT && find * -type d) | comm -13 OLD-DIRS
+	    - | sed -e 's#^#@dirrm #' &gt;&gt; pkg/PLIST</tt>'.
+
       <sect2>
 	<heading>Creating the checksum file</heading>
 
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-doc->freebsd-ports 
Responsible-Changed-By: hoek 
Responsible-Changed-When: Thu Jan 7 17:01:22 PST 1999 
Responsible-Changed-Why:  
Really a ports pr. 

From: Tim Vanderhoek <vanderh@ecf.utoronto.ca>
To: Tom Hukins <tom@eborcom.com>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: docs/9375: Handbook addition: Automated PLIST building for ports
Date: Thu, 7 Jan 1999 20:11:17 -0500

 On Thu, Jan 07, 1999 at 09:23:36PM -0000, Tom Hukins wrote:
 > 
 > As per the recent thread on the freebsd-doc mailing list (Suggestion
 > for "Making a port yourself" in the Handbook), here is a patch to
 > the Handbook which contains information on building a packing list
 > automatically.
 
 I believe one of the other *BSDs has something built-into their
 bsd.port.mk, as well as some other advice in assorted
 documents/collective mailing-list knowledge.
 
 
 > +	  <p>If your port honours the PREFIX variable (which it
 > +	    should), you can then type `<tt>make install
 > +	    PREFIX=/var/tmp/MY-PORT</tt>'.  Once the port has been
 > +	    installed successfully, create the packing list with
 > +	    `<tt>(cd /var/tmp/MY-PORT && find * \! -type d) &gt;
 > +	    pkg/PLIST</tt>'.
 
 Don't forget to remove any user configuration files from the PLIST
 (unless they were installed as config-file.sample as they should
 be).  Don't forget to make sure that files listed were actually
 installed by the port for whom the plist is being made (ie.  not
 installed by a dependency!!).  Manpages need to be removed.
 
 
 -- 
 This .sig is not innovative, witty, or profund.

From: Tom Hukins <tom@eborcom.com>
To: Tim Vanderhoek <vanderh@ecf.utoronto.ca>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: docs/9375: Handbook addition: Automated PLIST building for ports
Date: Fri, 8 Jan 1999 11:55:18 +0000

 On Thu, Jan 07, 1999 at 05:20:02PM -0800, Tim Vanderhoek wrote:
 >  
 >I believe one of the other *BSDs has something built-into their
 >bsd.port.mk, as well as some other advice in assorted
 >documents/collective mailing-list knowledge.
 
 I'll look into this - any pointers would be welcome!
 
 >  Don't forget to remove any user configuration files from the PLIST
 >  (unless they were installed as config-file.sample as they should
 >  be).  Don't forget to make sure that files listed were actually
 >  installed by the port for whom the plist is being made (ie.  not
 >  installed by a dependency!!).  Manpages need to be removed.
 
 The man pages and configuration files slipped my mind... As for the
 dependencies, I hadn't considered this. It looks like I need to put
 a bit more work into this - I'll send in a revised patch when
 everything is ready.
 
 Thanks,
 Tom

From: VANDERHOEK TIMOTHY MICHAEL <vanderh@ecf.utoronto.ca>
To: Tom Hukins <tom@eborcom.com>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: docs/9375: Handbook addition: Automated PLIST building for ports
Date: Fri, 8 Jan 1999 11:26:43 -0500

 On Fri, 8 Jan 1999, Tom Hukins wrote:
 
 > >I believe one of the other *BSDs has something built-into their
 > >bsd.port.mk, as well as some other advice in assorted
 > >documents/collective mailing-list knowledge.
 > 
 > I'll look into this - any pointers would be welcome!
 
 OpenBSD has a ``make plist'' target in bsd.port.mk.  It looks like it
 shouldn't be too hard to extract as a shell script for users.  I don't
 know how well it works.
 
 [I don't think we should have a plist target in our bsd.port.mk].
 
 Feel free to mention multiple ways to generate the plist --- the other
 stuff you wrote would still be good even in the face of such a shell
 script.
 
 
 -- 
 Me.  Who'd you think sent this?
 

From: Tom Hukins <tom@eborcom.com>
To: VANDERHOEK TIMOTHY MICHAEL <vanderh@ecf.utoronto.ca>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: docs/9375: Handbook addition: Automated PLIST building for ports
Date: Thu, 14 Jan 1999 17:21:40 +0000

 On Fri, Jan 08, 1999 at 08:30:02AM -0800, VANDERHOEK TIMOTHY MICHAEL wrote:
 >  
 >  OpenBSD has a ``make plist'' target in bsd.port.mk.  It looks like it
 >  shouldn't be too hard to extract as a shell script for users.  I don't
 >  know how well it works.
 
 Me neither, but I've used it as inspiration for my modified patch -
 thanks! It would be possible to write a script to deal with this,
 but I'm not going to start on one until I know I'll have time to
 finish it.
 
 We couldn't just lift OpenBSD's "make plist", however, because we
 would have to deal with ELF libraries too (and possibly other
 things, too).
 
 >  [I don't think we should have a plist target in our bsd.port.mk].
 
 Why? bsd.port.mk is a small, simple file. Surely one extra target
 wouldn't hurt? ;-)
 
 I've included a modified patch, which I hope deals with all the
 important issues. I'd appreciate scrutiny of the SGML and
 assumptions about how the ports system works - my knowledge of both
 is far from perfect.
 
 Regards,
 Tom
 
 
 --- porting.sgml.orig	Mon Jan 11 19:21:54 1999
 +++ porting.sgml	Thu Jan 14 17:06:05 1999
 @@ -154,6 +154,11 @@
  	    sorted alphabetically.  It will make verifying the changes 
  	    when you upgrade the port much easier.
  
 +	  <p>Creating a packing list manually can be a very tedious
 +	    task.  If the port installs a large number of files,
 +	    <ref id="porting:autoplist" name="creating the packing
 +	    list automatically"> might save time.
 +
        <sect2>
  	<heading>Creating the checksum file</heading>
  
 @@ -866,7 +871,7 @@
  	you create a port.  This section explains the most common of those.
  
  	<sect2>
 -	  <heading><tt/ldconfig/</heading>
 +	  <heading><tt/ldconfig/<label id="porting:ldconfig"></heading>
  
  	<p>If your port installs a shared library, add a
  	  <tt>post-install</tt> target to your Makefile that runs
 @@ -2375,6 +2380,43 @@
   [and then the epilogue]
   .include <bsd.port.mk>
  </verb></tscreen>
 +
 +    <sect1>
 +      <heading>Automated packing list creation<label
 +      id="porting:autoplist"></heading>
 +
 +      <p>First, make sure your port is almost complete, with only
 +	the <tt/PLIST/ file missing.  Create an empty <tt/PLIST/
 +	with the `<tt>touch files/PLIST</tt>' command.
 +
 +      <p>Next, create a new set of directories which your port can
 +	be installed in with the `<tt>mtree -U -f
 +	/etc/mtree/BSD.local.dist -d -e -p /var/tmp/MY-PORT</tt>'
 +	command.  Then, install any dependencies with `<tt>make
 +	depends PREFIX=/var/tmp/MY-PORT</tt>'.  Store the directory
 +	structure in a new file with `<tt>(cd /var/tmp/MY-PORT &&
 +	find * -type d) &gt; OLD-DIRS</tt>'.
 +
 +      <p>If your port honours the PREFIX variable (which it should),
 +	you can then type `<tt>make install
 +	PREFIX=/var/tmp/MY-PORT</tt>'.  Once the port has been
 +	installed successfully, create the packing list with
 +	`<tt>(cd /var/tmp/MY-PORT && find * \! -type d) &gt;
 +	pkg/PLIST</tt>'.
 +
 +      <p>You also need to add any newly created directories to the
 +	packing list.  To do this, type `<tt>(cd /var/tmp/MY-PORT &&
 +	find * -type d) | comm -13 OLD-DIRS - | sed -e 's#^#@dirrm
 +	#' &gt;&gt; pkg/PLIST</tt>'.
 +
 +      <p>Finally, you need to tidy up the packing list by hand.  I
 +	lied when I said this was all automated.  Manual pages
 +	should be listed in the port's <tt/Makefile/ under
 +	<tt/MANx/, not the packing list.  User configuration files
 +	should be removed, or installed as <tt/config-file.sample/.
 +	Any libraries installed by the port should be listed as
 +	specified in the <ref id="porting:ldconfig" name="ldconfig">
 +	section.
  
      <sect1>
        <heading>Package Names<label id="porting:pkgname"></heading>
State-Changed-From-To: open->closed 
State-Changed-By: nik 
State-Changed-When: Sat Jun 5 14:38:00 PDT 1999 
State-Changed-Why:  
Added the proposed text (with minor changes).  Thanks. 
>Unformatted:
