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

Last change on this file since 4478 was 4478, checked in by fkr, 17 years ago

Bug:
Submitted by:
Reviewed by:
Approved by:
Obtained from:

big guide-update from wbb@. Thanks Will!

  • Property svn:eol-style set to native
File size: 22.0 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                        <!--
238
239                        <para>Using DarwinPorts is very straightforward, most of the time
240                        all you need to do is execute a single command to install a port.
241                        For example, if you want to install the text editor vile, you'd
242                        simply execute the command <userinput>sudo port install vile
243                        </userinput>. That will fetch, build and install vim and anything
244                        else vim needs to work. All of the examples below use the vile
245                        port as an example, you should use whatever port you actually
246                        want to install.</para>
247                       
248                        <para>If you aren't sure of the exact name of your port you can
249                        use the search feature. For example, if you wanted to find out
250                        if there was anything called vile in the ports you could do:
251                        <userinput>port search 'vile'</userinput>. The search facility
252                        uses standard regular expression syntax, so you can list all
253                        the ports by doing: <userinput>port search '.+'</userinput>.</para>
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                        <para>You may break up the installation of a port into a number of
262                        steps, fetch, checksum, configure, build, and finally install. Each
263                        of these steps performs a part of the process to install a port,
264                        using the steps individually is however not normally needed unless
265                        you are developing a new port or are trying to diagnose a
266                        problem. </para>
267
268                        <para>Once the port has been installed, you may want to delete
269                        all the intermediate files that DarwinPorts has created while
270                        building the port, to do this you should enter:
271                        <userinput>port clean vile</userinput>.</para>
272                        -->
273
274                        <para>Using the DarwinPorts <userinput>port</userinput> command is
275                        very straight-forward.  Most of the time all you need to do is
276                        execute a single command to install a port.  For example, if you
277                        want to install the text editor vile, you would simply
278                        type:</para>
279
280                        <para><userinput>sudo port install vile</userinput></para>
281
282                        <para>That will fetch, build and install vile and anything else it
283                        needs to work.  All of the examples below use the vile for as an
284                        example.  You should use whatever port you actually want
285                        to install.</para>
286
287                        <para>The <userinput>port</userinput> command provides several
288                        other 'actions' that can be performed:</para>
289
290                        <variablelist>
291                                <varlistentry>
292                                        <term>Searching</term>
293                                       
294                                        <listitem>
295                                                <para>If you aren't sure the exact name of the port you
296                                                want, you can use the <userinput>search</userinput> option.
297                                                For example, if you wanted to find out if there was anything
298                                                called vile in in the ports, you could do:</para>
299
300                                                <para><userinput>port search 'vile'</userinput></para>
301
302                                                <para>The search facility uses standard regular expression
303                                                syntax, so you can also do much more complex
304                                                searches.</para>
305                                        </listitem>
306                                </varlistentry>
307
308                                <varlistentry>
309                                        <term>Additional Steps: fetch, configure, build, destroot,
310                                        install</term>
311                                               
312                                        <listitem>
313                                                <para>You may want to break up the installation of a port
314                                                into a number of steps.  <userinput>fetch</userinput>,
315                                                <userinput>configure</userinput>,
316                                                <userinput>build</userinput>,
317                                                <userinput>destroot</userinput> and finally
318                                                <userinput>install</userinput> are all available and perform
319                                                part of the build or install process.  Using the steps
320                                                individually is not normally needeed unless you are
321                                                developing a new port or trying to diagnose a
322                                                problem.</para>
323                                        </listitem>
324                                </varlistentry>
325
326                                <varlistentry>
327                                        <term>Cleaning a Port</term>
328
329                                        <listitem>
330                                                <para>Once the port has been installed, you may want to
331                                                delete all the intermediate files that DarwinPorts has
332                                                created while building the port.  To do this, simply use the
333                                                <userinput>clean</userinput> option:</para>
334
335                                                <para><userinput>port clean vile</userinput></para>
336                                        </listitem>
337                                </varlistentry>
338
339                                <varlistentry>
340                                        <term>Listing Ports</term>
341
342                                        <listitem>
343                                                <para>You may want a list of all the ports that are
344                                                available.  You can do this two ways, first by using the
345                                                <userinput>search</userinput> option:</para>
346
347                                                <para><userinput>port search '.+'</userinput></para>
348
349                                                <para>Or, by using the <userinput>list</userinput>
350                                                option:</para>
351
352                                                <para><userinput>port list</userinput></para>
353                                        </listitem>
354                                </varlistentry>
355
356                                <varlistentry>
357                                        <term>Contents of a Port</term>
358
359                                        <listitem>
360                                                <para>Once the port has been installed, you might want to
361                                                check what files are associated with that port.  The
362                                                <userinput>contents</userinput> option will list all of the
363                                                files that were installed by the port:</para>
364
365                                                <para><userinput>port contents vile</userinput></para>
366                                        </listitem>
367                                </varlistentry>
368
369                                <varlistentry>
370                                        <term>Variants and Dependencies</term>
371
372                                        <listitem>
373                                                <para>Before you install a port, you may want to check what
374                                                variations of that port are available to use.  Variants
375                                                provide additional configuration options for a port.  To see
376                                                what variations a port has, use the
377                                                <userinput>variants</userinput> option:</para>
378
379                                                <para><userinput>port variants vile</userinput></para>
380
381                                                <para>You also may want to see what dependencies a port has.
382                                                You can use the <userinput>deps</userinput> option to
383                                                check:</para>
384
385                                                <para><userinput>port deps vile</userinput></para>
386                                        </listitem>
387                                </varlistentry>
388                        </variablelist>
389
390                        <para>For more information you should look at the port manpage
391                        by entering: <userinput>man port</userinput>.</para>
392
393                </sect2>
394               
395                <sect2 id='portindex'>
396                        <title>The portindex command</title>
397                       
398                        <para>Most of the time you won't need to use this command as
399                        it is used to build the index of all the available ports, but
400                        sometimes the index you have is out of date or innacurate for
401                        some reason. When this occurs you will get an error message
402                        like 'port search failed: expected integer but got "PortIndex"'.
403                        You can fix problem by moving to the dports directory
404                        (/Users/mike/darwinports/dports in our examples) and
405                        executing: <userinput>portindex</userinput>. This will go
406                        through all the available ports in the dport directory and
407                        build an index file called PortIndex.</para>
408
409                       
410                </sect2>
411               
412                <sect2  id='updating_dports'>
413                        <title>Updating DarwinPorts</title>
414                       
415                        <para>New ports are always being added to the DarwinPorts dports
416                        tree, you should regularly update your tree to get access to new
417                        ports, and (hopefully) improved versions of current ports. Currently
418                        the simplest way you can update the dports tree is to use cvs. You
419                        should change directory to the dports directory and then execute:
420                        <userinput>cvs -z3 update -dP</userinput>. You should see a set of
421                        lines printed out in the terminal as the update progresses. You
422                        may need to update your PortIndex as mentioned previously:
423                        <userinput>portindex</userinput>. </para>
424
425                       
426                        <para>You can also use cvs to fetch an new version of the
427                        DarwinPorts infrastructure (eg the port command and associated
428                        libraries). To do this you should change directories to the
429                        darwinports/base directory and execute the following commands:
430                        <programlisting><![CDATA[
431 
432% cvs -z3 update -dP
433% ./configure
434% make clean && make
435% sudo make install
436]]>
437                                </programlisting>This will build and install the new version
438                                of DarwinPorts. You don't need to do this very often, although
439                                DarwinPorts is a young project and continually improving so we
440                                encourage you to keep up to date. </para>
441
442                       
443                </sect2>
444               
445                <sect2 id='uninstall_dports'>
446                        <title>Removing ports</title>
447                       
448                        <para>Ports are removed using the port command described above,
449                        simply execute the command:
450                        <userinput>sudo port uninstall vile</userinput></para>
451
452                </sect2>
453               
454                <sect2 id='upgrade_dports'>
455                        <title>Upgrading ports</title>
456                       
457                        <para>At the moment there is not a 'port upgrade' command so
458                        to upgrade a port you must uninstall and then install it again.
459                        <programlisting><![CDATA[
460 
461% sudo port uninstall vile
462% sudo port install vile
463]]>
464                                </programlisting></para>
465
466                       
467                </sect2>
468        </sect1>
469       
470       
471        <sect1 id='troubleshooting_use'>
472                <title>Troubleshooting</title>
473               
474                <para>There are a number of common problems so before you report a
475                problem (details on how to <link linkend='user_bugs'>report problems</link>
476                 follow) check that the problem is described here, or in the
477                 <ulink url='http://www.opendarwin.org/projects/darwinports/en/faq.php'>
478                 FAQ</ulink> first.</para>
479
480                <sect2>
481                        <title>Common errors and problems</title>
482                                       
483                        <sect3 id='E_port_search'>
484                                <title>port search failed: expected integer but got
485                                "PortIndex"</title>
486       
487                                <para>This means your PortIndex file is incorrect or
488                                potentially corrupted, run the <link linkend='portindex'>
489                                portindex</link> command</para>
490
491                               
492                        </sect3>
493                </sect2>
494               
495                <sect2 id='user_bugs'>
496                        <title>Bug reports</title>
497                        <para>If the you have updated your ports tree, searched the
498                        darwinports@opendarwin.org mailling list archives and read the
499                        common problems and the FAQ and you still can't find the answer
500                        to the problem, you should submit a bug report via bugzilla.</para>
501
502
503                        <para>The following section describes in some more detail how
504                        to use Bugzilla to submit your port.</para>
505
506                        <sect3>
507                                <title>Submission parameters</title>
508                               
509                                <variablelist>
510                                        <varlistentry id='Project'>
511                                                <term>
512                                                        Project:
513                                                </term>
514                                                <listitem>
515                                                        <para>Make sure you select the DarwinPorts
516                                                        project.</para>
517
518                                                </listitem>
519                                        </varlistentry>
520
521                                        <varlistentry id='Component'>
522                                                <term>
523                                                        Component:
524                                                </term>
525                                                <listitem>
526                                                        <para>Select "dports" as the component. </para>
527
528                                                </listitem>
529                                        </varlistentry>
530                                        <varlistentry id='Assigned_to'>
531                                                <term>
532                                                        Assigned to:
533                                                </term>
534                                                <listitem>
535                                                        <para>Please assign updates, bug reports and
536                                                        comments on existing ports to the maintainer.
537                                                        Otherwise, if this is a new port or an RFC,
538                                                        please leave blank</para>
539
540                                                </listitem>
541                                        </varlistentry>
542
543                                        <varlistentry id='URL'>
544                                                <term>
545                                                        URL:
546                                                </term>
547                                                <listitem>
548                                                        <para>You may use this field to point to the
549                                                        port output if it is available online.</para>
550
551                                                </listitem>
552                                        </varlistentry>
553
554                                        <varlistentry id='Summary'>
555                                                <term>
556                                                        Summary:
557                                                </term>
558                                                <listitem>
559                                                <para>Please use this format
560                                                <userinput>BUG: portname-1.2.3</userinput> for
561                                                the submission of port installation failures. </para>
562
563                                                </listitem>     
564                                        </varlistentry>
565
566                                        <varlistentry id='Description'>
567                                                <term>
568                                                        Description:
569                                                </term>
570                                                <listitem>
571                                                        <para>The description field should contain the
572                                                        following information as per the example given
573                                                        here here. </para>
574
575                                                                <programlisting>
576<![CDATA[
577Portname-1.2.3
578
579the error log can be found here: URL or ATTACHED or INLINE
580
581Description: What the problem was in a nutshell,
582
583Comments: Any comments you have about the port, bug diagnosis steps,
584concerns, lookouts, dependencies that you may want to mention.
585
586================INLINE CONTENT================
587--
588your sig if you'd like
589]]> 
590                                                </programlisting>
591                                                               
592                                                </listitem>
593                                        </varlistentry>
594                                </variablelist>
595                        </sect3>
596                </sect2>
597        </sect1>
598       
599       
600        <sect1 id='portsmanager'>
601                <title>Ports Manager.app</title>
602               
603                <para>Ports Manager.app is a Cocoa GUI for the DarwinPorts project,
604                it allows users to browse through available ports and their
605                descriptions and to download, install and uninstall the software.
606                Ports Manager.app is currently under development and is less
607                reliable in use than the command line tools. There is a Port for
608                the application so you can actually use DarwinPorts to install
609                it for you! <userinput>sudo port install 'PortsManager'</userinput>.
610                Ports Manager.app will be installed in your /Applications/Utilities
611                folder. You must have the DarwinPorts Tcl libraries installed to
612                use the Ports Manager.app. A
613                <ulink url='http://www.opendarwin.org/~fkr/portsmanager.png'>
614                screen shot is available</ulink> of Ports Manager.app in
615                action. </para>
616
617               
618                <para>We will also be providing a binary installer (a '.pkg') file in
619                 the near future for Ports Manager.app.</para>
620
621               
622        </sect1>
623</chapter>
Note: See TracBrowser for help on using the repository browser.