source: trunk/doc-new/guide/xml/installing.xml @ 112491

Last change on this file since 112491 was 112491, checked in by raimue@…, 7 years ago

guide:
Provide direct links to the package installers

File size: 28.3 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"[
4<!ENTITY macports-version "2.2.0">
5]>
6<chapter id="installing">
7  <title>Installing MacPorts</title>
8
9  <para>This chapter shows you how to install MacPorts and its prerequisites
10  step-by-step. Note that the sections about <link
11  linkend="installing.x11">installing X11</link> and <link
12  linkend="installing.xcode">installing Xcode</link> are Mac OS X
13  specific. If you wish to install MacPorts on another platform, first make
14  sure you have X11 and gcc installed, and then skip ahead to <link
15  linkend="installing.macports.source">installing MacPorts from source</link>
16  and continue to the end of the chapter.</para>
17
18  <section id="installing.x11">
19    <title>Install X11</title>
20
21    <para>
22      X11.app allows you to run applications using the X Window System, which
23      is the traditional display server on most other UNIX like systems. Additionally, the
24      <ulink url="http://xquartz.macosforge.org/trac/wiki"> Xquartz</ulink>
25      project provides an updated version of the X server.
26    </para>
27
28    <note>
29      <para>
30      As of Mac OS X 10.5 Leopard, X11.app is included in the default
31      installation. You can just <link linkend="installing.xcode">skip this
32      section</link> for any later version of Mac OS X.
33      </para>
34    </note>
35
36    <orderedlist>
37      <listitem>
38        <para>Insert the <quote>Mac OS X Install Disk</quote> and run the
39        package named <quote>Optional Installs</quote>.</para>
40      </listitem>
41
42      <listitem>
43        <para>At the software selection window expand the
44        <guilabel>Applications</guilabel> category and click the check box
45        beside <guilabel>X11</guilabel> (and nothing else).</para>
46      </listitem>
47
48      <listitem>
49        <para>Click <guibutton>Install</guibutton> to install X11.</para>
50      </listitem>
51    </orderedlist>
52
53    <para>Before launching an X11 application on Mac OS X 10.4, you must open X11.app
54    and start an xterm session. Later OS versions should launch X11.app automatically when
55    an X11 application is run from the Terminal.</para>
56
57    <programlisting><prompt>%%</prompt> <userinput>xterm</userinput></programlisting>
58
59    <para>After the X11 session window opens, you may launch X11 apps from
60    another terminal window. See <link
61    linkend="installing.x11.settings">Optional X11 Settings</link> if you wish
62    to launch X11 applications from an X11 session window.</para>
63
64    <note>
65      <para>X11 and the X11SDK (from Xcode Tools) are both required for X11
66      apps. To verify the presence of both, check for files
67      <filename>com.apple.pkg.X11User.bom</filename> &amp;
68      <filename>com.apple.pkg.X11SDKLeo.bom</filename> in
69      <filename>/Library/Receipts/boms/</filename>. On Mac OS X 10.4, look for
70      files <filename>X11User.pkg</filename> &amp;
71      <filename>X11SDK.pkg</filename> in
72      <filename>/Library/Receipts/</filename>.</para>
73    </note>
74
75    <section id="installing.x11.settings">
76      <title>Optional X11 Settings</title>
77
78      <para>To launch X11 applications directly from an X11 window (instead of
79      a regular terminal window), you need to make it so X11 sessions opened
80      using the menu bar respect your <filename>.profile</filename>
81      file.</para>
82
83      <orderedlist>
84        <listitem>
85          <para>Open X11 and select <guimenuitem>Customize Menu
86          ...</guimenuitem> from the <guimenu>Applications</guimenu>
87          menu.</para>
88        </listitem>
89
90        <listitem>
91          <para>Double-click the menu item <guimenuitem>Terminal</guimenuitem>
92          and change: <quote>xterm</quote> to <quote>xterm -ls</quote></para>
93        </listitem>
94
95        <listitem>
96          <para>Click <guibutton>Done</guibutton> to save the change.</para>
97        </listitem>
98      </orderedlist>
99    </section>
100  </section>
101
102  <section id="installing.xcode">
103    <title>Install Xcode</title>
104
105    <para>
106      <ulink url="https://developer.apple.com/xcode/">Xcode</ulink>
107      is a package provided by Apple containing compilers, libraries and
108      additional tools required to develop applications for Mac OS X.
109    </para>
110
111    <note>
112      <para>Always make sure to install the latest available version of Xcode
113      for your Mac OS X release; using outdated versions of Xcode
114      may cause port install failures. Also note that Xcode is not
115      updated via Mac OS X's Software Update utility on OS versions prior
116      to 10.6, and is updated via the Mac App Store on 10.7.</para>
117    </note>
118
119    <para>Follow the instructions for your version of Mac OS X:</para>
120
121    <section id="installing.xcode.mavericks">
122      <title>Install Xcode on OS X 10.9 or later</title>
123
124      <para>
125        Download the latest version of Xcode <ulink
126        url="https://developer.apple.com/downloads/index.action"> from the
127        Apple developer website</ulink> or get it <ulink
128        url="http://itunes.apple.com/us/app/xcode/id497799835">
129        using the Mac App Store</ulink>.
130      </para>
131     
132      <para>
133        Once you have Xcode installed, open a terminal and run
134        <userinput>xcode-select --install</userinput>.
135      </para>
136    </section>
137
138    <section id="installing.xcode.lion">
139      <title>Install Xcode on OS X 10.7 Lion or OS X 10.8 Mountain Lion</title>
140
141      <para>
142        Download the latest version of Xcode <ulink
143          url="https://developer.apple.com/downloads/index.action">from the Apple developer
144          website</ulink> or get it <ulink
145          url="http://itunes.apple.com/us/app/xcode/id497799835">using the Mac
146          App Store</ulink>.
147      </para>
148
149      <section id="installing.xcode.lion.43">
150        <title>Xcode 4.3 and later</title>
151        <para>
152          Xcode 4.3 and later do not automatically install the command line tools, but
153          MacPorts requires them. To install them, open the Xcode application, go to the
154          Preferences window, to the Downloads section, and click the Install button
155          next to Command Line Tools. Be sure to return to this window after every Xcode
156          upgrade to ensure that the command line tools are also upgraded.
157        </para>
158        <para>
159          If you wish to create Installer packages with <userinput>port pkg</userinput>,
160          you will also need to install PackageMaker, which is in the <quote>Auxiliary
161          Tools for Xcode</quote> package as of Xcode 4.3. The download page for this package
162          can be opened via the Xcode -> Open Developer Tool -> More Developer Tools...
163          menu item. After downloading and mounting the disk image, drag the PackageMaker
164          application to your /Applications directory.
165        </para>
166      </section>
167    </section>
168
169    <section id="installing.xcode.snowleopard">
170      <title>Install Xcode on Mac OS X 10.6 Snow Leopard</title>
171
172      <para>If you are using Mac OS X 10.6, there are two branches of Xcode
173        which could be considered to be the latest, 3.2.x and 4.x. Xcode 4
174        costs money, but Xcode 3 is still available free of charge. There are
175        two options for downloading it:
176        <orderedlist>
177          <listitem>
178            <para>
179              <ulink url="https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20588">
180                Xcode 3.2.2</ulink> - smaller download, but you will need to run Software Update after installing to
181              get the latest version.
182            </para>
183          </listitem>
184          <listitem>
185            <para>
186              <ulink url="https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20792">
187                Xcode 3.2.6 and iOS SDK 4.3</ulink> - includes iOS SDK which is not needed for MacPorts.
188            </para>
189          </listitem>
190        </orderedlist>
191        You may also be able to install Xcode 3.2 from your Mac OS X 10.6 DVD and then run Software Update to get
192        the latest version.
193      </para>
194
195      <para>Ensure that those of the following options that are available in the
196      installer for your version of Xcode are selected:
197      <itemizedlist>
198          <listitem>
199              <guibutton>UNIX Development</guibutton>
200          </listitem>
201          <listitem>
202              <guibutton>System Tools</guibutton>
203          </listitem>
204          <listitem>
205              <guibutton>X11 SDK</guibutton>
206          </listitem>
207          <listitem>
208              <guibutton>Command Line Support</guibutton>
209          </listitem>
210        </itemizedlist>
211      </para>
212    </section>
213
214    <section id="installing.xcode.other">
215      <title>Install Xcode on older releases of Mac OS X</title>
216
217      <para>
218        If you have an earlier release of Mac OS X, you may download
219        the latest version of Xcode
220        <ulink
221          url="http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20491">for OS X 10.5 (v3.1.4)</ulink>
222        or
223        <ulink
224          url="http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=19907">for 10.4 (v2.5)</ulink>.
225      </para>
226
227      <para>Ensure that those of the following options that are available in the
228      installer for your version of Xcode are selected:
229      <itemizedlist>
230          <listitem>
231              <guibutton>UNIX Development</guibutton>
232          </listitem>
233          <listitem>
234              <guibutton>System Tools</guibutton>
235          </listitem>
236          <listitem>
237              <guibutton>X11 SDK</guibutton>
238          </listitem>
239          <listitem>
240              <guibutton>Command Line Support</guibutton>
241          </listitem>
242        </itemizedlist>
243      </para>
244    </section>
245  </section>
246
247  <section id="installing.macports">
248    <title>Install MacPorts</title>
249
250    <para>If you are using Mac OS X, you should install MacPorts using the Mac
251    OS X package installer unless you do not wish to install it to
252    <filename>/opt/local/</filename>, the default MacPorts location, or if you
253    wish to install a pre-release version of MacPorts base. However, if you
254    wish to <link linkend="installing.macports.source.multiple">install
255    multiple copies of MacPorts</link> or install MacPorts on another OS
256    platform, you must <link linkend="installing.macports.source">install
257    MacPorts from the source code</link>.</para>
258
259    <note>
260      <para>Though a distinction is made between pre-release and release
261      versions of MacPorts base, the ports collection supports no such
262      distinction or versioning. The <link
263      linkend="using.port.selfupdate">selfupdate</link> command installs the
264      latest port revisions from Subversion (at a slight delay), and updates
265      MacPorts base to the latest released version.</para>
266    </note>
267
268    <section id="installing.macports.binary">
269      <title>Mac OS X Package Install</title>
270
271      <para>The Mac OS X package installer automatically installs MacPorts,
272      <link linkend="installing.shell">sets the shell environment</link>, and
273      runs a <link linkend="using.port.selfupdate">selfupdate</link> operation
274      to update the ports tree and MacPorts base with the latest
275      release.</para>
276
277      <orderedlist>
278        <listitem>
279            <para>Download the latest <filename>MacPorts-&macports-version;-<emphasis>...</emphasis>.pkg</filename>
280          installer from the <ulink
281          url="https://distfiles.macports.org/MacPorts/">MacPorts
282          download directory</ulink>. Here are direct links for the latest versions of OS X:</para>
283
284          <variablelist>
285            <varlistentry>
286            <term>
287                OS X 10.7 Lion:
288            </term>
289            <listitem>
290               <ulink url="https://distfiles.macports.org/MacPorts/MacPorts-&macports-version;-10.7-Lion.pkg">MacPorts-&macports-version;-10.7-Lion.pkg</ulink>
291            </listitem>
292            </varlistentry>
293            <varlistentry>
294            <term>
295                OS X 10.8 Mountain Lion:
296            </term>
297            <listitem>
298               <ulink url="https://distfiles.macports.org/MacPorts/MacPorts-&macports-version;-10.8-MountainLion.pkg">MacPorts-&macports-version;-10.8-MountainLion.pkg</ulink>
299            </listitem>
300            </varlistentry>
301            <varlistentry>
302            <term>
303                OS X 10.9 Mavericks:
304            </term>
305            <listitem>
306               MacPorts-&macports-version;-10.9-Mavericks.pkg (not available yet)
307            </listitem>
308            </varlistentry>
309          </variablelist>
310        </listitem>
311
312        <listitem>
313          <para>Double-click the downloaded package installer to perform the default <quote>easy</quote> install.</para>
314        </listitem>
315      </orderedlist>
316    </section>
317
318    <section id="installing.macports.source">
319      <title>Source Install</title>
320
321      <para>If you installed MacPorts using the package installer, skip this
322      section. To install MacPorts from the source code, follow the steps
323      below.</para>
324
325      <orderedlist>
326        <listitem>
327          <para>Download and extract the <ulink url="https://distfiles.macports.org/MacPorts/MacPorts-&macports-version;.tar.bz2">
328          MacPorts &macports-version; tarball</ulink>. Either do so using your browser and the Finder, or use the given commands
329          in a terminal window.</para>
330
331          <programlisting><prompt>%%</prompt> <userinput>curl -O https://distfiles.macports.org/MacPorts/MacPorts-&macports-version;.tar.bz2</userinput>
332<prompt>%%</prompt> <userinput>tar xf MacPorts-&macports-version;.tar.bz2</userinput></programlisting>
333        </listitem>
334
335        <listitem>
336          <para>Afterwards, perform the commands shown in the terminal window. If you wish
337          to use a path other than <filename>/opt/local</filename>, follow
338          the instructions for <link linkend="installing.macports.source.multiple">installing
339          multiple copies of MacPorts</link> instead.</para>
340
341          <programlisting><prompt>%%</prompt> <userinput>cd MacPorts-&macports-version;/</userinput>
342<prompt>%%</prompt> <userinput>./configure</userinput>
343<prompt>%%</prompt> <userinput>make</userinput>
344<prompt>%%</prompt> <userinput>sudo make install</userinput></programlisting>
345        </listitem>
346      </orderedlist>
347    </section>
348
349    <section id="installing.macports.subversion">
350      <title>Subversion Install</title>
351
352      <para>If you installed MacPorts using the package installer, skip this
353      section.</para>
354
355      <para>There are times when some may want to run MacPorts from a version
356      newer than the current stable release. Maybe there's a new feature that
357      you'd like to use, or it fixes an issue you've encountered, or you just
358      like to be on the cutting edge. These steps explain how to run
359      completely from trunk, using only Subversion to keep MacPorts up to
360      date.</para>
361
362      <orderedlist>
363        <listitem>
364          <para>Check out MacPorts source</para>
365
366          <para>Pick a location to store a working copy of the MacPorts code.
367          For this example, <filename>/opt/mports</filename> will be used, but
368          you can put the source anywhere. This example will create
369          <filename>/opt/mports/trunk</filename> containing everything needed
370          for MacPorts.</para>
371
372          <programlisting><prompt>%%</prompt> <userinput>mkdir -p /opt/mports</userinput>
373<prompt>%%</prompt> <userinput>cd /opt/mports</userinput>
374<prompt>%%</prompt> <userinput>svn checkout https://svn.macports.org/repository/macports/trunk</userinput></programlisting>
375
376          <note>
377              <para>
378             You only really need the base subdirectory to run MacPorts, so you can avoid checking out the rest if you don't want to use a Subversion-based ports tree (see Step 3 below). To just get the base directory, append
379
380            <filename>/base</filename>
381
382             to the end of the svn checkout command above. The resulting directory will then be
383
384            <filename>/opt/mports/base</filename>
385
386            </para>
387          </note>
388        </listitem>
389
390        <listitem>
391          <para>Build and Install MacPorts</para>
392
393          <para>MacPorts uses autoconf and makefiles for installation. These
394          commands will build and install MacPorts to
395          <filename>/opt/local</filename>. You can add the
396          <option>--prefix</option> option to <filename>./configure</filename>
397          to relocate MacPorts to another directory if needed.</para>
398
399          <programlisting><prompt>%%</prompt> <userinput>cd /opt/mports/trunk/base</userinput>
400<prompt>%%</prompt> <userinput>./configure --enable-readline</userinput>
401<prompt>%%</prompt> <userinput>make</userinput>
402<prompt>%%</prompt> <userinput>sudo make install</userinput>
403<prompt>%%</prompt> <userinput>make distclean</userinput></programlisting>
404        </listitem>
405
406        <listitem>
407          <para>(Optional) Configure MacPorts to use port information from
408          Subversion</para>
409
410          <para>This step is useful if you want to do port development. Open
411          <filename>/opt/local/etc/macports/sources.conf</filename> in a text
412          editor. The last line which should look like this:</para>
413
414          <programlisting>rsync://rsync.macports.org/release/tarballs/ports.tar [default]</programlisting>
415
416          <para>Change it to point to the working copy you checked out:</para>
417
418          <programlisting>file:///opt/mports/trunk/dports [default]</programlisting>
419
420          <para>Now MacPorts will look for portfiles in the working
421          copy.</para>
422        </listitem>
423
424        <listitem>
425          <para>Environment</para>
426
427          <para>You should setup your PATH and other environment options
428          according to the <link linkend="installing.shell">following
429          section</link>.</para>
430        </listitem>
431      </orderedlist>
432    </section>
433
434    <section id="installing.macports.source.multiple">
435      <title>Install Multiple MacPorts Copies</title>
436
437      <para>Occasionally a MacPorts developer may wish to install more than
438      one MacPorts instance on the same host. Only one copy of MacPorts may
439      use the default prefix <filename>/opt/local</filename>, so
440      for additional installations use the option
441      <option>--prefix</option> as shown below. It's also recommended
442      to change the applications dir using
443      <option>--with-applications-dir</option> to avoid conflicts in
444      <filename>/Applications/MacPorts</filename>.</para>
445
446      <note>
447        <para>The first command temporarily removes the standard MacPorts
448        binary paths because they must not be present while installing a
449        second instance.</para>
450      </note>
451
452      <programlisting><prompt>%%</prompt> <userinput>export PATH=/bin:/sbin:/usr/bin:/usr/sbin</userinput>
453<prompt>%%</prompt> <userinput>MP_PREFIX=/opt/macports-test</userinput>
454<prompt>%%</prompt> <userinput>./configure --prefix=$MP_PREFIX --with-applications-dir=$MP_PREFIX/Applications</userinput>
455<prompt>%%</prompt> <userinput>make</userinput>
456<prompt>%%</prompt> <userinput>sudo make install</userinput>
457</programlisting>
458    </section>
459  </section>
460
461  <section id="installing.macports.upgrade">
462    <title>MacPorts Upgrade</title>
463
464    <para>MacPorts base upgrades are performed automatically (when a newer
465    release is available) during a <link
466    linkend="using.port.selfupdate">selfupdate</link> operation. To upgrade a
467    copy of MacPorts that was installed from source to the newer release of
468    the source code, simply repeat the <link
469    linkend="installing.macports.source">source install</link> with the newer
470    version of the MacPorts source code.</para>
471  </section>
472
473  <section id="installing.macports.uninstalling">
474    <title>Uninstall</title>
475
476    <para>Uninstalling MacPorts can be a drastic step, and depending on the
477    issue you are experiencing, you may not need to do so. If you are unsure,
478    ask on the
479    <ulink url="http://lists.macosforge.org/mailman/listinfo/macports-users">macports-users</ulink>
480    mailing list first.</para>
481   
482    <para>If you need to uninstall MacPorts, and your <command>port</command> command is
483    functioning, first uninstall all the installed ports by running this
484    command in the Terminal:</para>
485    <programlisting><prompt>%%</prompt> <userinput>sudo port -fp uninstall installed</userinput></programlisting>
486
487    <para>All that will be left in your installation prefix now will be files
488    that were not registered to any port. This includes configuration
489    files, databases, any files which MacPorts
490    renamed in order to allow a forced installation or upgrade, and the base
491    MacPorts software itself. You may wish to save your configuration files
492    (most are in <filename>${prefix}/etc</filename>), databases, or any other
493    unique data by moving it aside.</para>
494
495    <para>To remove all remaining traces of MacPorts, run the following
496    command in the Terminal. If you have changed <varname>prefix</varname>,
497    <varname>applications_dir</varname> or <varname>frameworks_dir</varname>
498    from their default values, then replace <filename>/opt/local</filename>
499    with your <varname>prefix</varname>, replace <filename>/Applications/MacPorts</filename>
500    with your <varname>applications_dir</varname>, and/or add your
501    <varname>frameworks_dir</varname> to the list, respectively.</para>
502    <programlisting><prompt>%%</prompt> <userinput>sudo rm -rf \
503    /opt/local \
504    /Applications/DarwinPorts \
505    /Applications/MacPorts \
506    /Library/LaunchDaemons/org.macports.* \
507    /Library/Receipts/DarwinPorts*.pkg \
508    /Library/Receipts/MacPorts*.pkg \
509    /Library/StartupItems/DarwinPortsStartup \
510    /Library/Tcl/darwinports1.0 \
511    /Library/Tcl/macports1.0 \
512    ~/.macports</userinput></programlisting>
513 
514  <para>If you use a shell other than bash (perhaps tcsh), you may need to
515  adjust the above to fit your shell's syntax. Also note that depending on which
516  version of MacPorts you have and which ports you have installed, not all of
517  the above paths will exist on your system. This is OK.</para>
518  </section>
519
520  <section id="installing.shell">
521    <title>MacPorts and the Shell</title>
522
523    <para>MacPorts requires that some environment variables be set in the
524    shell. When MacPorts is installed using the Mac OS X package installer, a
525    <quote>postflight</quote> script is run after installation that
526    automatically adds or modifies a shell configuration file in your home directory,
527    ensuring that it defines variables
528    according to the rules described in the following section. Those <link
529    linkend="installing.macports.source">installing MacPorts from source
530    code</link> must modify their environment manually using the rules as a
531    guide.</para>
532
533    <para>Depending on your shell and which configuration files already exist, the
534    installer may use <filename>.profile</filename>, <filename>.bash_login</filename>,
535    <filename>.bash_profile</filename>, <filename>.tcshrc</filename>, or
536    <filename>.cshrc</filename>.</para>
537
538    <section id="installing.shell.postflight">
539      <title>The Postflight Script</title>
540
541      <para>The postflight script automatically sets
542      the <varname>PATH</varname>
543      variable, and optionally the <varname>MANPATH</varname> and
544      <varname>DISPLAY</varname> variables according to the rules described
545      below. If a current shell configuration file exists at
546      installation time it is renamed to <quote>mpsaved_$timestamp</quote>.
547      Those <link linkend="installing.macports.source">installing MacPorts
548      from source code</link> must modify their environment manually using the
549      rules as a guide.</para>
550
551      <itemizedlist>
552        <listitem>
553          <para>Required: <varname>PATH</varname> variable</para>
554
555          <para>This variable is set by the postflight script to append the
556          MacPorts executable paths to the default path as shown. The MacPorts
557          paths are appended at the front of <varname>PATH</varname> so the
558          MacPorts libraries will take precedence over vendor-supplied
559          libraries for ported software at runtime.</para>
560
561          <programlisting>export PATH=/opt/local/bin:/opt/local/sbin:$PATH</programlisting>
562
563          <note>
564            <para>The user environment's $PATH is not in effect while ports
565            are being installed, because the $PATH is scrubbed before ports
566            are installed, and restored afterwards. To change the search path
567            for locating system executables (rsync, tar, etc.) during port
568            installation, see the <link
569            linkend="internals.configuration-files.macports-conf">macports.conf</link>
570            file variable <varname>binpath</varname>. But changing this
571            variable is for advanced users only, and is not generally needed
572            or recomended.</para>
573          </note>
574        </listitem>
575
576        <listitem>
577          <para>Optional: <varname>MANPATH</varname> variable</para>
578
579          <para>Condition: If prior to MacPorts installation a
580          <varname>MANPATH</varname> variable exists in a current
581          <filename>.profile</filename> that contains neither the value
582          <filename>${prefix}/share/man,</filename> nor any empty values, the
583          postflight script sets the <varname>MANPATH</varname> variable as
584          shown below. Otherwise, the <varname>MANPATH</varname> variable is
585          omitted.</para>
586
587          <programlisting>export MANPATH=/opt/local/share/man:$MANPATH</programlisting>
588
589          <para>Here are some examples of paths that contain empty
590          values:</para>
591
592          <simplelist>
593            <member>/usr/share/man:</member>
594
595            <member>:/usr/share/man</member>
596
597            <member>/usr/share/man::/usr/X11R6/man</member>
598          </simplelist>
599        </listitem>
600
601        <listitem>
602          <para>Optional: <varname>DISPLAY</varname> variable</para>
603
604          <para>Condition: If installing on a Mac OS X version earlier than
605          10.5 (Leopard), and if a shell configuration file exists
606          at time of MacPorts installation without a
607          <varname>DISPLAY</varname> variable, the postflight script sets a
608          <varname>DISPLAY</varname> variable as shown below. The
609          <varname>DISPLAY</varname> variable is always omitted on Mac OS X
610          10.5 or higher.</para>
611
612          <programlisting>export DISPLAY=:0.0</programlisting>
613        </listitem>
614      </itemizedlist>
615    </section>
616
617    <section id="installing.shell.verifyprofile">
618      <title>Verify the configuration file</title>
619
620      <para>To verify that the file containing the
621      MacPorts variables is in effect, type <command>env</command> in the
622      terminal to verify the current environment settings after the
623      file has been created. Example output for the
624      <command>env</command> command is shown below.</para>
625
626      <note>
627        <para>Changes to shell configuration files do not take effect
628        until a new terminal session is opened.</para>
629      </note>
630
631      <screen>MANPATH=
632TERM_PROGRAM=Apple_Terminal
633TERM=xterm-color
634SHELL=/bin/bash
635TERM_PROGRAM_VERSION=237
636USER=joebob
637__CF_USER_TEXT_ENCODING=0x1FC:0:0
638PATH=/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
639PWD=/Users/joebob
640EDITOR=/usr/bin/pico
641SHLVL=1
642HOME=/Users/joebob
643LOGNAME=joebob
644DISPLAY=:0.0
645SECURITYSESSIONID=b0cea0
646_=/usr/bin/env</screen>
647    </section>
648
649    <section id="installing.shell.editorvar">
650      <title>Optional Editor Variables</title>
651
652      <para>You can set an environment variable in order to use your favorite
653      text editor with edit option of port command.</para>
654      <para>MacPorts will check <varname>MP_EDITOR</varname>,
655      <varname>VISUAL</varname> and <varname>EDITOR</varname> in this order,
656      allowing you to either use a default editor shared with other programs
657      (<varname>VISUAL</varname> and <varname>EDITOR</varname>) or a Macports'
658      specific one (<varname>MP_EDITOR</varname>).</para>
659
660      <para>For example, to use the nano editor, add this line to your
661      bash config:</para>
662
663      <programlisting>export EDITOR=/usr/bin/nano</programlisting>
664
665      <para>To use the user-friendly GUI editor <ulink
666      url="http://www.barebones.com/products/textwrangler/">TextWrangler</ulink>
667      (installation required), add this line:</para>
668
669      <programlisting>export EDITOR=/usr/bin/edit</programlisting>
670     
671      <para>To keep a command-line text editor as default while using a graphic editor with
672      portfiles, add this: </para>
673
674      <programlisting>
675      export EDITOR=/usr/bin/vi
676      export MP_EDITOR=/usr/bin/edit</programlisting>
677    </section>
678  </section>
679</chapter>
Note: See TracBrowser for help on using the repository browser.