Changeset 38647 for trunk/doc-new


Ignore:
Timestamp:
Jul 27, 2008, 5:16:02 AM (11 years ago)
Author:
markd@…
Message:

Refine the MacPorts and the Shell section.

File:
1 edited

Legend:

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

    r38633 r38647  
    99  Tools) are Mac OS X specific. If you wish to install MacPorts on another
    1010  platform, first make sure you have X11 and gcc installed, and then begin at
    11   section 3.2 by performing a <ulink url="installing.macports.source">MacPorts
    12   install from source code</ulink> and proceed to the end of the
    13   chapter.</para>
     11  section 3.2 by performing <link
     12  linkend="installing.macports.source">MacPorts install from source</link> and
     13  proceed to the end of the chapter.</para>
    1414
    1515  <section id="installing.x11">
     
    277277    <para>MacPorts requires that some environmental variables be set in the
    278278    shell. When MacPorts is installed using the Mac OS X package installer, a
    279     <quote>postflight</quote> script is run after installation that places a
    280     <filename>.profile</filename> file in the home directory containing the
    281     required variables. If a current <filename>.profile</filename> file exists
    282     at installation time it is renamed to
    283     <quote>mpsaved_$timestamp</quote>.</para>
     279    <quote>postflight</quote> script is run after installation that
     280    automatically copies a <filename>.profile</filename> containing variables
     281    according to the rules described in the following section. Those <link
     282    linkend="installing.macports.source">installing MacPorts from source
     283    code</link> must modify their environment manually using the rules as a
     284    guide.</para>
    284285
    285286    <note>
     
    291292    </note>
    292293
    293     <para>The postflight script automatically copies a
    294     <filename>.profile</filename> containing variables according to the rules
    295     described below. Those <link
    296     linkend="installing.macports.source">installing MacPorts from source
    297     code</link> must modify their environment manually using the rules below
    298     as a guide.</para>
    299 
    300     <note>
    301       <para>Be sure to notice in the rules below that the variables MANPATH
    302       and DISPLAY are only needed under certain conditions.</para>
    303     </note>
    304 
    305     <itemizedlist>
    306       <listitem>
    307         <para>A <varname>PATH</varname> variable is set by the postflight
    308         script that appends the MacPorts executable paths to the front of the
    309         default path as shown below so MacPorts libraries will take precedence
    310         over vendor-supplied libraries for ported software at runtime.</para>
    311 
    312         <programlisting>export PATH=/opt/local/bin:/opt/local/sbin:$PATH</programlisting>
    313 
    314         <note>
    315           <para>The user environment's $PATH affects ported software at
    316           runtime, i. e. after port installation, because the $PATH is
    317           scrubbed before a port is installed. To change the search path for
    318           locating system executables (rsync, tar, etc.) during port
    319           installation, see the <link
    320           linkend="internals.configuration-files.macports-conf">macports.conf</link>
    321           file variable <varname>binpath</varname>, though changing this
    322           variable is not generally needed or recomended, and for advanced
    323           users only.</para>
    324         </note>
    325       </listitem>
    326 
    327       <listitem>
    328         <para>Optional: If prior to MacPorts installation, a
    329         <varname>MANPATH</varname> variable exists in a current
    330         <filename>.profile</filename> file that does not include the value
    331         <filename>${prefix}/share/man,</filename> nor any empty values, the
    332         postflight script sets a <varname>MANPATH</varname> variable as shown
    333         below. Otherwise, the manpath variable is omitted.</para>
    334 
    335         <programlisting>export MANPATH=/opt/local/share/man:$MANPATH</programlisting>
    336 
    337         <para>Here are some examples of paths that contain empty
    338         values:</para>
    339 
    340         <simplelist>
    341           <member>/usr/share/man:</member>
    342 
    343           <member>:/usr/share/man</member>
    344 
    345           <member>/usr/share/man::/usr/X11R6/man</member>
    346         </simplelist>
    347       </listitem>
    348 
    349       <listitem>
    350         <para>Optional: To support X11 applications for Mac OS X versions
    351         earlier than 10.5 (Leopard), if a<filename> .profile</filename> file
    352         exists at time of MacPorts installation without a
    353         <varname>DISPLAY</varname> variable, the postflight script sets a
    354         <varname>DISPLAY</varname> variable as shown below. The
    355         <varname>DISPLAY</varname> variable is not needed for Mac OS X 10.5 or
    356         higher.</para>
    357 
    358         <programlisting>export DISPLAY=:0.0</programlisting>
    359       </listitem>
    360     </itemizedlist>
    361 
    362     <note>
    363       <para>Changes to <filename>~/.profile</filename> do not take effect
    364       until a new terminal session is opened. Type <command>env</command> in
    365       the terminal to verify the current environment settings. Example output
    366       for the <command>env</command> command is shown below.</para>
    367     </note>
    368 
    369     <screen>MANPATH=
     294    <section id="installing.shell.postflight">
     295      <title>The Postflight Script</title>
     296
     297      <para>The postflight script automatically copies a
     298      <filename>.profile</filename> containing the <varname>PATH</varname>
     299      variable, and optionally the <varname>MANPATH</varname> and
     300      <varname>DISPLAY</varname> variables according to the rules described
     301      below. If a current <filename>.profile</filename> file exists at
     302      installation time it is renamed to <quote>mpsaved_$timestamp</quote>.
     303      Those <link linkend="installing.macports.source">installing MacPorts
     304      from source code</link> must modify their environment manually using the
     305      rules as a guide.</para>
     306
     307      <itemizedlist>
     308        <listitem>
     309          <para>Required: <varname>PATH</varname> variable</para>
     310
     311          <para>This variable is set by the postflight script to append the
     312          MacPorts executable paths to the default path as shown. The MacPorts
     313          paths are appended at the front of <varname>PATH</varname> so the
     314          MacPorts libraries will take precedence over vendor-supplied
     315          libraries for ported software at runtime.</para>
     316
     317          <programlisting>export PATH=/opt/local/bin:/opt/local/sbin:$PATH</programlisting>
     318
     319          <note>
     320            <para>The user environment's $PATH is not in effect while ports
     321            are being installed, because the $PATH is scrubbed before ports
     322            are installed, and restored afterwards. To change the search path
     323            for locating system executables (rsync, tar, etc.) during port
     324            installation, see the <link
     325            linkend="internals.configuration-files.macports-conf">macports.conf</link>
     326            file variable <varname>binpath</varname>. But changing this
     327            variable is for advanced users only, and is not generally needed
     328            or recomended.</para>
     329          </note>
     330        </listitem>
     331
     332        <listitem>
     333          <para>Optional: <varname>MANPATH</varname> variable</para>
     334
     335          <para>Condition: If prior to MacPorts installation a
     336          <varname>MANPATH</varname> variable exists in a current
     337          <filename>.profile</filename> that contains neither the value
     338          <filename>${prefix}/share/man,</filename> nor any empty values, the
     339          postflight script sets the <varname>MANPATH</varname> variable as
     340          shown below. Otherwise, the <varname>MANPATH</varname> variable is
     341          omitted.</para>
     342
     343          <programlisting>export MANPATH=/opt/local/share/man:$MANPATH</programlisting>
     344
     345          <para>Here are some examples of paths that contain empty
     346          values:</para>
     347
     348          <simplelist>
     349            <member>/usr/share/man:</member>
     350
     351            <member>:/usr/share/man</member>
     352
     353            <member>/usr/share/man::/usr/X11R6/man</member>
     354          </simplelist>
     355        </listitem>
     356
     357        <listitem>
     358          <para>Optional: <varname>DISPLAY</varname> variable</para>
     359
     360          <para>Condition: If installing on a Mac OS X version earlier than
     361          10.5 (Leopard), and if a<filename> .profile</filename> file exists
     362          at time of MacPorts installation without a
     363          <varname>DISPLAY</varname> variable, the postflight script sets a
     364          <varname>DISPLAY</varname> variable as shown below. The
     365          <varname>DISPLAY</varname> variable is always omitted on Mac OS X
     366          10.5 or higher.</para>
     367
     368          <programlisting>export DISPLAY=:0.0</programlisting>
     369        </listitem>
     370      </itemizedlist>
     371    </section>
     372
     373    <section id="installing.shell.verifyprofile">
     374      <title>Verify the .profile</title>
     375
     376      <para>To verify that the <filename>.profile</filename> containing the
     377      MacPorts variables is in effect, type <command>env</command> in the
     378      terminal to verify the current environment settings after the
     379      <filename>.profile</filename> has been created. Example output for the
     380      <command>env</command> command is shown below.</para>
     381
     382      <note>
     383        <para>Changes to <filename>~/.profile</filename> do not take effect
     384        until a new terminal session is opened.</para>
     385      </note>
     386
     387      <screen>MANPATH=
    370388TERM_PROGRAM=Apple_Terminal
    371389TERM=xterm-color
     
    383401SECURITYSESSIONID=b0cea0
    384402_=/usr/bin/env</screen>
     403    </section>
     404
     405    <section id="installing.shell.editorvar">
     406      <title>Optional EDITOR Variable</title>
     407
     408      <para>A useful environment variable to set in
     409      <filename>.profile</filename> is the <varname>EDITOR</varname> variable.
     410      Setting this variable allows you to use the edit option to the port
     411      command to edit Portfiles quickly and easily. Set the
     412      <varname>EDITOR</varname> variable to point to your favorite text
     413      editor.</para>
     414
     415      <para>For example, to use the nano editor, add this line to your
     416      <filename>~/.profile</filename>:</para>
     417
     418      <programlisting>export EDITOR=/usr/bin/nano</programlisting>
     419
     420      <para>To use the user-friendly GUI editor <ulink
     421      url="http://www.barebones.com/products/textwrangler/">TextWrangler</ulink>
     422      (installation required), add this line to your
     423      <filename>~/.profile</filename>:</para>
     424
     425      <programlisting>export EDITOR=/usr/bin/edit</programlisting>
     426    </section>
    385427  </section>
    386428</chapter>
Note: See TracChangeset for help on using the changeset viewer.