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

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

doc-new: add install message about 10.9

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