Changeset 2384 for trunk/www


Ignore:
Timestamp:
Mar 31, 2003, 4:56:03 PM (17 years ago)
Author:
fkr
Message:

additions should be added to the correct file. *sigh*

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/en/portfileHOWTO.php

    r1646 r2384  
    33//
    44// File     : portfileHOWTO.php
    5 // Version  : $Id: portfileHOWTO.php,v 1.12 2003/01/13 17:42:01 fkr Exp $
     5// Version  : $Id: portfileHOWTO.php,v 1.13 2003/03/31 16:56:03 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>
     
    3131</h3>
    3232<p>
    33 In order to work with DarwinPorts, you'll need to download and install it on your system.  The DarwinPorts project <a href="http://opendarwin.org/projects/darwinports/en/">homepage</a> describes how to get and install it.
     33In order to work with DarwinPorts, you'll need to download and install it on your system.  The DarwinPorts project <a href="http://opendarwin.org/projects/darwinports/">homepage</a> describes how to get and install it.
    3434</p>
    3535<p>
     
    5656<ul>
    5757<li><a href="#portfilelist">Portfile Listing</a></li>
    58 <li><a href="#contentslist">Contents Listing</a></li>
    5958</ul>
    6059
     
    6665</p>
    6766<pre><tt>
     67# &#36;Id: &#36;
    6868PortSystem 1.0
    6969name            ircii
     
    7575                        Chat. It gives full access to all of the normal IRC functions, plus a variety \
    7676                        of additional options.
     77homepage        http://www.eterna.com.au/ircii/
    7778master_sites    ftp://ircftp.au.eterna.com.au/pub/ircII/
    7879</tt></pre>
    7980<p>
    80 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. <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. DarwinPorts uses the terms 'keys' and 'options' interchangeably since most keys are used as options of a particular task in the porting process.
     81A Portfile consists of key/value pairs. Every Portfile starts with <tt># &#36;Id: &#36;</tt> which is a commented out RCS Id tag. Following the RCS Id tag comes the <tt>PortSystem</tt> declaration. Currently the only valid declaration is <tt>PortSystem 1.0</tt>. 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.
    8182</p>
    8283<p>
     
    169170<a name="install"></a>Installing the Finished Product on the System
    170171</h3>
    171 <p>
    172 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.
    173 </p>
    174 <p>
    175 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:
    176 </p>
    177 <!--
    178 .........|.........|.........|.........|.........|.........|.........|.........|
    179 -->
    180 <pre><tt>
    181 % find /opt/local > /tmp/existing.files
    182 % sudo port install
    183 % find /opt/local > /tmp/more.files
    184 % diff -u /tmp/existing.files /tmp/more.files | grep ^\+\/ | \
    185   sed -e 's|^\+/opt/local/*||g' > contents
    186 </tt></pre>
    187 <p>
    188 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>.)
    189 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.
    190 Next we should edit the Portfile to include our contents file:
    191 </p>
    192 <pre><tt>
    193 include contents
    194 </tt></pre>
    195 <p>
    196 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.
    197 Instead of <tt>include contents</tt>, one would use:
    198 </p>
    199 <pre><tt>
    200 contents    bin/irc \
    201             bin/irc-20020912 \
    202             man/man1/irc.1 \
    203             man/man1/ircbug.1 \
    204             man/man1/ircII.1 \
    205             man/man1
    206 </pre></tt>
     172<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>.
     173</p>
     174<pre><tt>
     175install.destroot        mandir=${destroot}${prefix}/man prefix=${destroot}${prefix}
     176</tt></pre>
     177<p>Take a look at some of our ports to see more examples on how to use the <tt>install.destroot</tt> option.</p>
    207178<p>
    208179Now we have a complete portfile.  Re-run the installation step to add your port to your own registry:
     
    285256</p>
    286257<pre><tt>
     258# &#36;Id: &#36;
    287259PortSystem 1.0
    288260name            ircii
     
    294266                        Chat. It gives full access to all of the normal IRC functions, plus a variety \
    295267                        of additional options.
     268homepage        http://www.eterna.com.au/ircii/
    296269master_sites    ftp://ircftp.au.eterna.com.au/pub/ircII/
    297270checksums       md5 2ae68c015698f58763a113e9bc6852cc
    298271configure.args  --disable-ipv6
    299 include         contents
    300272
    301273post-configure {
     
    309281</tt></pre>
    310282
    311 <h3>
    312 <a name="contentslist"></a>Contents Listing
    313 </h3>
    314 <p>
    315 The following is a partial listing of the ircII contents file:
    316 </p>
    317 <pre><tt>
    318 contents {
    319 bin/irc
    320 bin/irc-20020912
    321 ... omitted ...
    322 man/man1/irc.1
    323 man/man1/ircbug.1
    324 man/man1/ircII.1
    325 man/man1
    326 man
    327 ... omitted ...
    328 }
    329 </tt></pre>
    330 
    331 
    332283<?
    333284        od_print_footer("en");
Note: See TracChangeset for help on using the changeset viewer.