Changeset 2293 for trunk/www


Ignore:
Timestamp:
Mar 17, 2003, 6:05:47 AM (17 years ago)
Author:
fkr
Message:

Bug:
Submitted by:
Reviewed by: landonf@
Approved by:
Obtained from:

remove references to contents-lists and instead mention install.destroot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/portfileHOWTO.php

    r1327 r2293  
    33//
    44// File     : portfileHOWTO.php
    5 // Version  : $Id: portfileHOWTO.php,v 1.9 2002/12/06 07:15:40 michaelm Exp $
     5// Version  : $Id: portfileHOWTO.php,v 1.10 2003/03/17 06:05:47 fkr Exp $
    66// Location : /projects/darwinports/portfileHOWTO.php
    77//
     
    1515</h2>
    1616<pre><tt>
    17 Kevin Van Vechten | <a href="mailto:kevin@opendarwin.org">kevin@opendarwin.org</a>
    18 8-Oct-2002
     17Kevin Van Vechten (<a href="mailto:kevin@opendarwin.org">kevin@opendarwin.org</a>), Felix Kronlage (<a href="mailto:fkr@opendarwin.org">fkr@opendarwin.org</a>)
     1815-Mar-2003
    1919</tt></pre>
    2020<h3>
     
    3434</p>
    3535<p>
    36 Since you're interested in writing a Portfile, let's change some configuration options that will help in debugging as we go.  Edit the file <tt>/etc/ports/ports.conf</tt> to contain the following (you'll likely have to use <tt>sudo</tt> to edit this file):
    37 </p>
    38 <pre><tt>
    39 ports_debug     yes
    40 ports_verbose   yes
    41 </tt></pre>
    42 <p>
    43 This will display useful debugging messages that are usually suppressed while running DarwinPorts.
     36Since you're interested in writing a Portfile, you should invoke the <tt>port</tt> command with the <tt>-v</tt> (verbose output) and the <tt>-d</tt> (debugging output) switches. This will display useful debugging messages that are usually suppressed while running DarwinPorts.
    4437</p>
    4538<p>
     
    6356<ul>
    6457<li><a href="#portfilelist">Portfile Listing</a></li>
    65 <li><a href="#contentslist">Contents Listing</a></li>
    6658</ul>
    6759
     
    7870categories      irc
    7971maintainers     kevin@opendarwin.org
     72description     an IRC and ICB client
     73long_description        The ircII program is a full screen, termcap based interface to Internet Relay \
     74                        Chat. It gives full access to all of the normal IRC functions, plus a variety \
     75                        of additional options.
     76homepage        http://www.eterna.com.au/ircii/
    8077master_sites    ftp://ircftp.au.eterna.com.au/pub/ircII/
    8178</tt></pre>
    8279<p>
    83 A Portfile consists of key/value pairs.  The <tt>name</tt> and <tt>version</tt> key describe the name and version of the software.  The <tt>categories</tt> key is a list of the logical categories to which the software belongs; this is used for organizational purposes.  The first entry in <tt>categories</tt> should match the directory in which the port's directory resides in the port tree.  The <tt>maintainers</tt> key should contain your email address, and the <tt>master_sites</tt> key should contain a list of sites where the distribution sources may be downloaded. DarwinPorts uses the terms 'keys' and 'options' interchangeably since most keys are used as options of a particular task in the porting process.
     80A Portfile consists of key/value pairs.  The <tt>name</tt> and <tt>version</tt> key describe the name and version of the software.  The <tt>categories</tt> key is a list of the logical categories to which the software belongs; this is used for organizational purposes.  The first entry in <tt>categories</tt> should match the directory in which the port's directory resides in the port tree.  The <tt>maintainers</tt> key should contain your email address. <tt>description</tt> provides a short description of the port, while <tt>long_description</tt> holds a more detailed description of the Software. The <tt>master_sites</tt> key should contain a list of sites where the distribution sources may be downloaded.  To refer to the main website of the software, the <tt>homepage</tt> key is used. DarwinPorts uses the terms 'keys' and 'options' interchangeably since most keys are used as options of a particular task in the porting process.
    8481</p>
    8582<p>
     
    172169<a name="install"></a>Installing the Finished Product on the System
    173170</h3>
    174 <p>
    175 Portfiles are required to have a <tt>contents</tt> option which specifies which files are installed.  DarwinPorts uses this information to catalog what files belong to which piece of software so they may be later uninstalled.  Each parameter to <tt>contents</tt> is a path to a file.  All paths are relative to the <tt>${prefix}</tt> variable.  As a convenient way to determine exactly what files are installed as part of ircII, let's use the find command to compose a manifest of the files in the <tt>${prefix}</tt> tree.  After installing we'll re-run the find command, and use the differences to generate our contents list.
    176 </p>
    177 <p>
    178 Using the unidiff format, we'll compare the list of existing files with the new list of files, only paying attention to the lines that were added.  Since the contents paths are supposed to be relative to <tt>${prefix}</tt>, we'll pipe through <tt>sed</tt> and delete the prefix (<tt>/opt/local/</tt>), storing the result in a file named <tt>contents</tt> in our port directory.  We can do this with the following commands:
    179 </p>
    180 <!--
    181 .........|.........|.........|.........|.........|.........|.........|.........|
    182 -->
    183 <pre><tt>
    184 % find /opt/local > /tmp/existing.files
    185 % sudo port install
    186 % find /opt/local > /tmp/more.files
    187 % diff -u /tmp/existing.files /tmp/more.files | grep ^\+\/ | \
    188   sed -e 's|^\+/opt/local/*||g' > contents
    189 </tt></pre>
    190 <p>
    191 Now that we have a contents file in our port directory, we should edit it to begin with <tt>contents {</tt> and end with a closing <tt>}</tt>.  (It is important to note that any other process using the <tt>${prefix}</tt> tree may interfere with the accuracy of the <tt>find</tt> command.  You should audit the resulting <tt>contents</tt> file to look for any files that appear out of place, specifically some DarwinPorts temporary files such as <tt>/var/db/dports/receipts/ircii-20020912.tmp</tt>.)
    192 It's also important to review the contents file and make sure directories are listed <i>after</i> the files they contain for the uninstall process to work correctly.
    193 Next we should edit the Portfile to include our contents file:
    194 </p>
    195 <pre><tt>
    196 include contents
    197 </tt></pre>
    198 <p>
    199 If the list of files installed by the port does not extends beyond one page of an 80x24 terminal, the <tt>contents</tt> option should be included in the Portfile.
    200 Instead of <tt>include contents</tt>, one would use:
    201 </p>
    202 <pre><tt>
    203 contents    bin/irc \
    204             bin/irc-20020912 \
    205             man/man1/irc.1 \
    206             man/man1/ircbug.1 \
    207             man/man1/ircII.1 \
    208             man/man1
    209 </pre></tt>
     171<p>The former method of including a <tt>contents</tt> list has been made obsolete by the <tt>destroot</tt> mechanism. With <tt>destroot</tt> the software is installed into a directory-tree below in the <tt>work</tt> directory. While some software (like ircII) does not require any special tweaks to be installed into the <tt>destroot</tt>, others (like <a href="http://www.opendarwin.org/cgi-bin/cvsweb.cgi/proj/darwinports/dports/net/ncftp/">ncftp</a>) need the <tt>install.destroot</tt> option in order to correctly install into the <tt>destroot</tt>.
     172</p>
     173<pre><tt>
     174install.destroot        mandir=${destroot}${prefix}/man prefix=${destroot}${prefix}
     175</tt></pre>
     176<p>Take a look at some of our ports to see more examples on how to use the <tt>install.destroot</tt> option.</p>
    210177<p>
    211178Now we have a complete portfile.  Re-run the installation step to add your port to your own registry:
     
    293260categories      irc
    294261maintainers     kevin@opendarwin.org
     262description     an IRC and ICB client
     263long_description        The ircII program is a full screen, termcap based interface to Internet Relay \
     264                        Chat. It gives full access to all of the normal IRC functions, plus a variety \
     265                        of additional options.
     266homepage        http://www.eterna.com.au/ircii/
    295267master_sites    ftp://ircftp.au.eterna.com.au/pub/ircII/
    296268checksums       md5 2ae68c015698f58763a113e9bc6852cc
    297269configure.args  --disable-ipv6
    298 include         contents
    299270
    300271post-configure {
     
    308279</tt></pre>
    309280
    310 <h3>
    311 <a name="contentslist"></a>Contents Listing
    312 </h3>
    313 <p>
    314 The following is a partial listing of the ircII contents file:
    315 </p>
    316 <pre><tt>
    317 contents {
    318 bin/irc
    319 bin/irc-20020912
    320 ... omitted ...
    321 man/man1/irc.1
    322 man/man1/ircbug.1
    323 man/man1/ircII.1
    324 man/man1
    325 man
    326 ... omitted ...
    327 }
    328 </tt></pre>
    329 
    330 
    331281<?
    332282        od_print_footer("en");
Note: See TracChangeset for help on using the changeset viewer.