source: trunk/doc/guide/xml/user.xml @ 2742

Last change on this file since 2742 was 2742, checked in by michaelm, 17 years ago

Merged quickstart and howto
improved compliance with style guide

  • Property svn:eol-style set to native
File size: 18.2 KB
Line 
1<?xml version="1.0" encoding="UTF-8" ?>
2<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3                "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4<chapter id="user_info">
5        <chapterinfo>
6                <keywordset>
7                        <keyword>
8                                usage
9                        </keyword>
10                        <keyword>
11                                introduction
12                        </keyword>
13                        <keyword>
14                                user
15                        </keyword>
16                        <keyword>
17                                manual
18                        </keyword>
19                </keywordset>
20        </chapterinfo>
21        <title>Using DarwinPorts</title> 
22       
23       
24        <sect1>
25                <title>About this chapter</title>
26                 
27                <para>This document provides a short guide to the basics of the
28                DarwinPorts system. The first section provides a short description
29                of the goals of the project and a brief comparison with other systems.
30                Subsequent sections describe how to get, install, and use DarwinPorts
31                on your own machines. </para>
32
33               
34        </sect1>
35       
36       
37        <sect1 id='about_dports'>
38                <title>About DarwinPorts</title> 
39               
40                <para>The aim of the DarwinPorts project is to develop a second-
41                generation system for the building, installation and management of
42                third party software. DarwinPorts is mainly developed on Mac OS X,
43                however by design it is quite portable and is intended to work on
44                other UNIX-like systems, especially *BSD and hopefully Linux-based
45                systems.  </para>
46
47               
48                <para>DarwinPorts is probably best described by comparison:  It's sort
49                of like the <ulink url='http://www.freebsd.org/ports'>FreeBSD ports
50                collection</ulink> or <ulink url='http://fink.sf.org/'>Fink</ulink> 
51                in that it automates the process of building third party software for
52                Mac OS X and other operating systems.  DarwinPorts also tracks all
53                dependency information for a given piece of software. In other words,
54                it knows what it needs to build and install and in what order for the
55                piece of software you want to work properly. DarwinPorts knows how to
56                make, build and install the software to a specific location, meaning
57                that software installed via DarwinPorts doesn't simply scatter itself
58                all over the system or require user knowledge of dependencies in what
59                order. </para>
60
61               
62                <para>The FreeBSD Ports Collection is a large set of software packages
63                ported to FreeBSD. The ports collection is also used on the other "free"
64                BSDs. The FreeBSD Ports Collection is based on a large tree of ports
65                where each software has a directory within a category (like mail or
66                graphics). That directory contains the information needed to build the
67                piece of software. DarwinPorts also uses a directory structure like this,
68                although unlike FreeBSD ports the intention is to avoid requiring a
69                complete copy of the 'Ports Tree' on every user's machine.  The FreeBSD
70                Ports Collection is essentially implemented as some very impressive but
71                hairy BSD make(1)'s macros and can be  opaque and non-extensible from
72                the perspective of someone looking to extend or refactor parts of the
73                system.  Given that makefiles aren't the easiest thing to parse or for
74                non-developers to understand, it is also harder to "mine" the FreeBSD
75                ports collection for data to use for other purposes such as
76                generating documentation indexes or arbitrary front-ends for
77                creating or managing ports. </para>
78
79
80                <para>A ports collection can be considered an 'expert system' that
81                knows the sources, dependencies, and other information necessary to
82                *build* a given Open Source project.  A package management system relies
83                on similar dependency information, but is focused on safely installing
84                (and de-installing) software.   Before DarwinPorts, most systems did
85                both at once; DarwinPorts, however, is explicitly designed as a pure
86                ports collection which can use various package management systems.
87                </para>
88
89               
90                <para>Even discounting some of the limitations of The FreeBSD Ports
91                Collection described above, creating automated build systems is rather
92                more complex than it looks at first glance and there's always room for
93                fresh approaches to the problem.  Which is what we have set out to do
94                with DarwinPorts. There are certainly other systems, some of which have
95                already been mentioned, which have made their own attempts at solving
96                this problem. There will likely be many more such systems in the future
97                since trying to find a single solution which pleases everyone is rather
98                like trying to find a single programming language which pleases everyone
99                - it's more or less impossible. </para>
100
101               
102                <para>DarwinPorts is mostly written in Tcl, with some components written
103                in C. Tcl was chosen to allow DarwinPorts to be readily embedded in other
104                applications (e.g. a Cocoa GUI) and to allow flexible, but easy to read
105                Portfiles. </para>
106
107               
108                <para>Even though DarwinPorts is written in Tcl, users do not need to know
109                Tcl in order to use the system or even to add new ports.  Port description
110                files, though they are actually full Tcl programs in their own right, are
111                designed to look like a simple list of key/value pairs. </para>
112
113        </sect1>
114       
115       
116        <sect1 id='setup'>
117                <title>Installing DarwinPorts</title>
118               
119                <sect2 id='prerequisites'>
120                        <title>What you need</title>
121                       
122                        <para>Currently DarwinPorts is only supported on Mac OS X 10.2 or later
123                        (i.e., Darwin 6.0 or later).   However, these instructions should also
124                        enable it to  work on FreeBSD and NetBSD, at least most of the time;
125                        not every build of DarwinPorts is tested on those platforms, so some
126                        minor breakage may creep in from time to time.</para>
127
128
129                        <para>To install and use DarwinPorts you must install the Developer
130                        tools (gcc, autoconf etc on other platforms). All the other
131                        prerequisites are pre-installed on Mac OS X 10.2 and later. On other
132                        platforms you will need to ensure you have installed Tcl (8.3 or
133                        later). </para>
134
135                       
136                </sect2>
137               
138                <sect2 id='getting_dports'>
139                        <title>Obtaining DarwinPorts</title>   
140                       
141                        <para>Currently the main way to get DarwinPorts is by using the Concurrent
142                        Versioning System (cvs). CVS is installed with the Developers Tools on Mac
143                        OS X. To download DarwinPorts using cvs you should use the following
144                        Terminal commands. At this time you must keep the darwinports directoy
145                        that is downloaded on your machine, even after installation as it also
146                        contains all the port description files (Portfiles). In the future these
147                        will be automatically downloaded as they are needed so you won't need to
148                        keep the directory. Choose a location for DarwinPorts where you won't
149                        want/need to move it. For the rest of the document I will assume the user
150                        name is 'mike' and the DarwinPorts infrastructure is going to be
151                        downloaded to a directory (folder) called darwinports in your home
152                        directory (i.e. /Users/mike/darwinports/) you should replace the username
153                        with your own username and edit the commands I give so they work
154                        correctly on your installation. <programlisting><![CDATA[
155 
156% cd ~/
157% cvs -d :pserver:anonymous@anoncvs.opendarwin.org:/Volumes/src/cvs/od login
158% cvs -d :pserver:anonymous@anoncvs.opendarwin.org:/Volumes/src/cvs/od co -P darwinports
159]]>
160                                </programlisting></para>
161       
162                       
163                        <para>These commands first ensure you are currently in your home
164                        directory, then log onto the opendarwin cvs server and finally
165                        'checkout' (download) DarwinPorts. </para>
166
167                        <para>There is also a <ulink 
168                        url='http://www.opendarwin.org/~fkr/snapshots/'> cvs snapshot</ulink> 
169                        available that is made from cvs every 6 hours. The tarball is made
170                        from a anonymous checkout of DarwinPorts so you can still use the
171                        commands below for <link linkend='updating_dports'>updating</link>.
172                        </para>
173       
174                        <para>In the near future we will provide a binary installer for
175                        DarwinPorts and the source files downloadable directly from the
176                        website rather than requiring users to use cvs. CVS is likely to
177                        remain important for users who want to closely track the latest
178                        ports as it can be used to update your port descriptions (and
179                        is currently the only way to do so). </para>
180
181                       
182                </sect2>
183               
184                <sect2 id='install_dports'>
185                        <title>Installing DarwinPorts</title>
186                       
187                        <para>To install DarwinPorts execute the following commands from the
188                        darwinports/base directory.<programlisting><![CDATA[
189
190% ./configure
191% make
192% sudo make install
193
194]]>
195                        </programlisting>
196                        This will compile and install all the necessary software. In order
197                        to install DarwinPorts on *BSD the default group-ownership must be
198                        passed to each make command: <userinput>make DSTGRP=wheel
199                        </userinput>.</para>
200
201                       
202                        <para>To configure DarwinPorts you should edit
203                        /etc/ports/sources.conf. The sources.conf lists the location of
204                        both local and remote port software hierarchies (Currently there is
205                        not a remote repository). Add an entry for your local ports tree:
206                        <userinput>file://Users/mike/darwinports/dports</userinput>. To
207                        edit the file you must use a command line text editor like pico
208                        or vi. </para>
209
210                       
211                        <para>You should add /opt/local/bin (or wherever you chose to
212                        install DarwinPorts) to your path. If you aren't sure how, add
213                        <userinput>set path=($path /opt/local/bin)</userinput> to your
214                        .cshrc file. You may need to create the file first if you
215                        haven't set one up before. Then close the Terminal window and
216                        open a new one so the new path setting takes effect.</para>
217
218                       
219                        <para>Once you have got this far, you should have a working
220                        installation of DarwinPorts, you have installed the 'port'
221                        command (by default this installed as /opt/local/bin/port)
222                        and the libraries it needs (in /opt/local/share/darwinports
223                        and /System/Library/Tcl/8.3/darwinports1.0 by default.
224                        </para>
225
226                       
227                </sect2>
228        </sect1>
229       
230       
231        <sect1>
232                <title>Using DarwinPorts</title>
233               
234                <sect2 id='port'>
235                        <title>The port command</title>
236                       
237                        <para>Using DarwinPorts is very straightforward, most of the time
238                        all you need to do is execute a single command to install a port.
239                        For example, if you want to install the text editor vile, you'd
240                        simply execute the command <userinput>sudo port install vile
241                        </userinput>. That will fetch, build and install vim and anything
242                        else vim needs to work. All of the examples below use the vile
243                        port as an example, you should use whatever port you actually
244                        want to install.</para>
245
246                       
247                        <para>If you aren't sure of the exact name of your port you can
248                        use the search feature. For example, if you wanted to find out
249                        if there was anything called vile in the ports you could do:
250                        <userinput>port search 'vile'</userinput>. The search facility
251                        uses standard regular expression syntax, so you can list all
252                        the ports by doing: <userinput>port search '.+'</userinput>.</para>
253
254                       
255                        <para>You can see more detail of what is happening when you
256                        install a port by using the verbose (-v), or debug (-d) flags
257                        when using the port install command, to see all the possible
258                        output use them both together: <userinput>port -v -d install
259                        vile</userinput>. </para>
260
261                       
262                        <para>You may break up the installation of a port into a number of
263                        steps, fetch, checksum, configure, build, and finally install. Each
264                        of these steps performs a part of the process to install a port,
265                        using the steps individually is however not normally needed unless
266                        you are developing a new port or are trying to diagnose a
267                        problem. </para>
268
269                       
270                        <para>Once the port has been installed, you may want to delete
271                        all the intermediate files that DarwinPorts has created while
272                        building the port, to do this you should enter:
273                        <userinput>port clean vile</userinput>.</para>
274
275                       
276                        <para>For more information you should look at the port manpage
277                        by entering: <userinput>man port</userinput>.</para>
278
279                       
280                </sect2>
281               
282                <sect2 id='portindex'>
283                        <title>The portindex command</title>
284                       
285                        <para>Most of the time you won't need to use this command as
286                        it is used to build the index of all the available ports, but
287                        sometimes the index you have is out of date or innacurate for
288                        some reason. When this occurs you will get an error message
289                        like 'port search failed: expected integer but got "PortIndex"'.
290                        You can fix problem by moving to the dports directory
291                        (/Users/mike/darwinports/dports in our examples) and
292                        executing: <userinput>portindex</userinput>. This will go
293                        through all the available ports in the dport directory and
294                        build an index file called PortIndex.</para>
295
296                       
297                </sect2>
298               
299                <sect2  id='updating_dports'>
300                        <title>Updating DarwinPorts</title>
301                       
302                        <para>New ports are always being added to the DarwinPorts dports
303                        tree, you should regularly update your tree to get access to new
304                        ports, and (hopefully) improved versions of current ports. Currently
305                        the simplest way you can update the dports tree is to use cvs. You
306                        should change directory to the dports directory and then execute:
307                        <userinput>cvs -z3 update -dP</userinput>. You should see a set of
308                        lines printed out in the terminal as the update progresses. You
309                        may need to update your PortIndex as mentioned previously:
310                        <userinput>portindex</userinput>. </para>
311
312                       
313                        <para>You can also use cvs to fetch an new version of the
314                        DarwinPorts infrastructure (eg the port command and associated
315                        libraries). To do this you should change directories to the
316                        darwinports/base directory and execute the following commands:
317                        <programlisting><![CDATA[
318 
319% cvs -z3 update -dP
320% ./configure
321% make clean && make
322% sudo make install
323]]>
324                                </programlisting>This will build and install the new version
325                                of DarwinPorts. You don't need to do this very often, although
326                                DarwinPorts is a young project and continually improving so we
327                                encourage you to keep up to date. </para>
328
329                       
330                </sect2>
331               
332                <sect2 id='uninstall_dports'>
333                        <title>Removing ports</title>
334                       
335                        <para>Ports are removed using the port command described above,
336                        simply execute the command:
337                        <userinput>sudo port uninstall vile</userinput></para>
338
339                </sect2>
340               
341                <sect2 id='upgrade_dports'>
342                        <title>Upgrading ports</title>
343                       
344                        <para>At the moment there is not a 'port upgrade' command so
345                        to upgrade a port you must uninstall and then install it again.
346                        <programlisting><![CDATA[
347 
348% sudo port uninstall vile
349% sudo port install vile
350]]>
351                                </programlisting></para>
352
353                       
354                </sect2>
355        </sect1>
356       
357       
358        <sect1 id='troubleshooting_use'>
359                <title>Troubleshooting</title>
360               
361                <para>There are a number of common problems so before you report a
362                problem (details on how to <link linkend='user_bugs'>report problems</link>
363                 follow) check that the problem is described here, or in the
364                 <ulink url='http://www.opendarwin.org/projects/darwinports/en/faq.php'>
365                 FAQ</ulink> first.</para>
366
367                <sect2>
368                        <title>Common errors and problems</title>
369                                       
370                        <sect3 id='E_port_search'>
371                                <title>port search failed: expected integer but got
372                                "PortIndex"</title>
373       
374                                <para>This means your PortIndex file is incorrect or
375                                potentially corrupted, run the <link linkend='portindex'>
376                                portindex</link> command</para>
377
378                               
379                        </sect3>
380                </sect2>
381               
382                <sect2 id='user_bugs'>
383                        <title>Bug reports</title>
384                        <para>If the you have updated your ports tree, searched the
385                        darwinports@opendarwin.org mailling list archives and read the
386                        common problems and the FAQ and you still can't find the answer
387                        to the problem, you should submit a bug report via bugzilla.</para>
388
389
390                        <para>The following section describes in some more detail how
391                        to use Bugzilla to submit your port.</para>
392
393                        <sect3>
394                                <title>Submission parameters</title>
395                               
396                                <variablelist>
397                                        <varlistentry id='Project'>
398                                                <term>
399                                                        Project:
400                                                </term>
401                                                <listitem>
402                                                        <para>Make sure you select the DarwinPorts
403                                                        project.</para>
404
405                                                </listitem>
406                                        </varlistentry>
407
408                                        <varlistentry id='Component'>
409                                                <term>
410                                                        Component:
411                                                </term>
412                                                <listitem>
413                                                        <para>Select "dports" as the component. </para>
414
415                                                </listitem>
416                                        </varlistentry>
417                                        <varlistentry id='Assigned_to'>
418                                                <term>
419                                                        Assigned to:
420                                                </term>
421                                                <listitem>
422                                                        <para>Please assign updates, bug reports and
423                                                        comments on existing ports to the maintainer.
424                                                        Otherwise, if this is a new port or an RFC,
425                                                        please leave blank</para>
426
427                                                </listitem>
428                                        </varlistentry>
429
430                                        <varlistentry id='URL'>
431                                                <term>
432                                                        URL:
433                                                </term>
434                                                <listitem>
435                                                        <para>You may use this field to point to the
436                                                        port output if it is available online.</para>
437
438                                                </listitem>
439                                        </varlistentry>
440
441                                        <varlistentry id='Summary'>
442                                                <term>
443                                                        Summary:
444                                                </term>
445                                                <listitem>
446                                                <para>Please use this format
447                                                <userinput>BUG: portname-1.2.3</userinput> for
448                                                the submission of port installation failures. </para>
449
450                                                </listitem>     
451                                        </varlistentry>
452
453                                        <varlistentry id='Description'>
454                                                <term>
455                                                        Description:
456                                                </term>
457                                                <listitem>
458                                                        <para>The description field should contain the
459                                                        following information as per the example given
460                                                        here here. </para>
461
462                                                                <programlisting>
463<![CDATA[
464Portname-1.2.3
465
466the error log can be found here: URL or ATTACHED or INLINE
467
468Description: What the problem was in a nutshell,
469
470Comments: Any comments you have about the port, bug diagnosis steps,
471concerns, lookouts, dependencies that you may want to mention.
472
473================INLINE CONTENT================
474--
475your sig if you'd like
476]]> 
477                                                </programlisting>
478                                                               
479                                                </listitem>
480                                        </varlistentry>
481                                </variablelist>
482                        </sect3>
483                </sect2>
484        </sect1>
485       
486       
487        <sect1 id='portsmanager'>
488                <title>Ports Manager.app</title>
489               
490                <para>Ports Manager.app is a Cocoa GUI for the DarwinPorts project,
491                it allows users to browse through available ports and their
492                descriptions and to download, install and uninstall the software.
493                Ports Manager.app is currently under development and is less
494                reliable in use than the command line tools. There is a Port for
495                the application so you can actually use DarwinPorts to install
496                it for you! <userinput>sudo port install 'PortsManager'</userinput>.
497                Ports Manager.app will be installed in your /Applications/Utilities
498                folder. You must have the DarwinPorts Tcl libraries installed to
499                use the Ports Manager.app. A
500                <ulink url='http://www.opendarwin.org/~fkr/portsmanager.png'>
501                screen shot is available</ulink> of Ports Manager.app in
502                action. </para>
503
504               
505                <para>We will also be providing a binary installer (a '.pkg') file in
506                 the near future for Ports Manager.app.</para>
507
508               
509        </sect1>
510</chapter>
Note: See TracBrowser for help on using the repository browser.