Changeset 31933 for trunk/doc-new


Ignore:
Timestamp:
Dec 12, 2007, 7:55:14 AM (12 years ago)
Author:
markd@…
Message:

Add a port style section, that adds some rewritten content from the old
portstyle man page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc-new/guide/xml/portfiledev.xml

    r31898 r31933  
    8383
    8484    <para>Here we list the individual Portfile components for an application
    85     that conforms to the the standard <command> configure</command>,
     85    that conforms to the the standard<command> configure</command>,
    8686    <command>make</command>, and <command>make install</command> steps of most
    8787    open source application installs.</para>
     
    427427
    428428      <para>If you wish to contribute modifications or fixes to a Portfile,
    429       you should do so in the form of a patch.</para>
     429      you should do so in the form of a patch. Follow the steps below to
     430      create Portfile patch files</para>
    430431
    431432      <orderedlist>
     
    490491      <para>Necessary or useful patches to application source code should be
    491492      sent to the application developer (not the port author) so the
    492       modifications may be included in the next version, and the port patch
    493       eventually removed.</para>
     493      modifications may be included in the next version; then the port patch
     494      may be removed after an updated tarball is released.</para>
    494495
    495496      <orderedlist>
     
    544545        <listitem>
    545546          <para>Now you may place the patch
    546           <filename>patch-Makefile.in</filename> in the path ${portpath}/files
    547           of a local repository (or commit it to subversion) and use it in a
    548           port using the <code>patchfiles</code> keyword.</para>
     547          <filename>patch-Makefile.in</filename> in location
     548          <varname>${portpath}</varname>/files (either a local repository or
     549          after committing to the MacPorts subversion port repository) and use
     550          it in a port using the <code>patchfiles</code> keyword.</para>
    549551
    550552          <programlisting>patchfiles              patch-Makefile.in</programlisting>
    551553
    552554          <note>
    553             <para>You should make a patch file for each file to be patched,
    554             though if you obtain a patch from another source that patches
    555             multiple files it is permissible to use it that way. Patch
    556             filenames should generally be of the form
    557             "patch-&lt;directory&gt;-&lt;filename&gt;", as shown in this
    558             example: <filename>patch-src-Makefile.in</filename>.</para>
     555            <para>You should create one patch file for each file to be
     556            patched, though it is permissible to use existing patches you find
     557            that patch multiple files. Patchfiles filenames should generally
     558            be of the form
     559            <filename>patch-</filename><replaceable>&lt;directory&gt;</replaceable>-<replaceable>&lt;filename&gt;</replaceable>,
     560            as shown in this example:
     561            <filename>patch-src-Makefile.in</filename>.</para>
    559562          </note>
    560563        </listitem>
     
    670673    sections are on the TODO list.</para>
    671674
     675    <section id="development.practices.portstyle">
     676      <title>Port Style</title>
     677
     678      <para>Portfiles may be thought of as a table of keys and values in two
     679      columns separated by whitespace (not tabs), so you should set your
     680      editor to use soft tabs, which are tabs emulated by spaces. By default,
     681      the top line of all Portfiles should use a modeline that defines soft
     682      tabs for the vim and emacs editors as shown.</para>
     683
     684      <programlisting># -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; \
     685c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4</programlisting>
     686
     687      <para>The left column should consist of single words, and will be
     688      separated from the more complex right side by spaces in multiples of
     689      four. Variable assignments ("set libver") and variant declarations
     690      ("variant mysql5") are exceptions, and may be considered a single word
     691      on the left side, with a single space between words.</para>
     692
     693      <para>Frequently multiple items are necessary in the second column. For
     694      example, to set multiple source download locations, multiple
     695      "master_sites" must be defined. Unless the second column items are few
     696      and short you should use multiple lines, separate lines with a
     697      backslash, and (to emphasize the unity of the block) indent the first
     698      line at a deeper level than the following lines as shown in this
     699      example.</para>
     700
     701      <programlisting>destroot.keepdirs     ${destroot}${prefix}/var/run \
     702                        ${destroot}${prefix}/var/log \
     703                        ${destroot}${prefix}/var/cache/mrtg</programlisting>
     704    </section>
     705
    672706    <section id="development.practices.dont-overwrite">
    673707      <title>Don't Overwrite Config Files</title>
Note: See TracChangeset for help on using the changeset viewer.