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

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

installing.xml: note that the Lion section is actually for Lion or later (#35798); remove obsolete reference to Xcode being distributed on a disk image

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