Annotation of htdocs/docs/pkgsrc/getting.html, revision 1.1
1.1 ! dsieger 1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
! 2: <html>
! 3: <head>
! 4: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
! 5: <title>Chapter 2. Where to get pkgsrc and how to keep it up-to-date</title>
! 6: <link rel="stylesheet" href="/NetBSD.css" type="text/css">
! 7: <meta name="generator" content="DocBook XSL Stylesheets VX.X.X">
! 8: <link rel="start" href="index.html" title="The pkgsrc guide">
! 9: <link rel="up" href="users-guide.html" title="Part I. The pkgsrc user's guide">
! 10: <link rel="prev" href="users-guide.html" title="Part I. The pkgsrc user's guide">
! 11: <link rel="next" href="platforms.html" title="Chapter 3. Using pkgsrc on systems other than NetBSD">
! 12: </head>
! 13: <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
! 14: <div class="navheader">
! 15: <table width="100%" summary="Navigation header">
! 16: <tr><th colspan="3" align="center">Chapter 2. Where to get pkgsrc and how to keep it up-to-date</th></tr>
! 17: <tr>
! 18: <td width="20%" align="left">
! 19: <a accesskey="p" href="users-guide.html">Prev</a> </td>
! 20: <th width="60%" align="center">Part I. The pkgsrc user's guide</th>
! 21: <td width="20%" align="right"> <a accesskey="n" href="platforms.html">Next</a>
! 22: </td>
! 23: </tr>
! 24: </table>
! 25: <hr>
! 26: </div>
! 27: <div class="chapter" lang="en">
! 28: <div class="titlepage"><div><div><h2 class="title">
! 29: <a name="getting"></a>Chapter 2. Where to get pkgsrc and how to keep it up-to-date</h2></div></div></div>
! 30: <div class="toc">
! 31: <p><b>Table of Contents</b></p>
! 32: <dl>
! 33: <dt><span class="sect1"><a href="getting.html#getting-first">2.1. Getting pkgsrc for the first time</a></span></dt>
! 34: <dd><dl>
! 35: <dt><span class="sect2"><a href="getting.html#getting-via-tar">2.1.1. As tar file</a></span></dt>
! 36: <dt><span class="sect2"><a href="getting.html#getting-via-sup">2.1.2. Via SUP</a></span></dt>
! 37: <dt><span class="sect2"><a href="getting.html#getting-via-cvs">2.1.3. Via anonymous CVS</a></span></dt>
! 38: </dl></dd>
! 39: <dt><span class="sect1"><a href="getting.html#uptodate">2.2. Keeping pkgsrc up-to-date</a></span></dt>
! 40: <dd><dl>
! 41: <dt><span class="sect2"><a href="getting.html#uptodate-tar">2.2.1. Via tar files</a></span></dt>
! 42: <dt><span class="sect2"><a href="getting.html#uptodate-cvs">2.2.2. Via CVS</a></span></dt>
! 43: </dl></dd>
! 44: </dl>
! 45: </div>
! 46: <p>Before you download and extract the files, you need to decide
! 47: where you want to extract them. When using pkgsrc as root user, pkgsrc
! 48: is usually installed in <code class="filename">/usr/pkgsrc</code>. You are though
! 49: free to install the sources and binary packages wherever you want in
! 50: your filesystem, provided that the pathname does not contain white-space
! 51: or other characters that are interpreted specially by the shell and some
! 52: other programs. A safe bet is to use only letters, digits, underscores
! 53: and dashes.</p>
! 54: <div class="sect1" lang="en">
! 55: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
! 56: <a name="getting-first"></a>2.1. Getting pkgsrc for the first time</h2></div></div></div>
! 57: <p>Before you download any pkgsrc files, you should decide
! 58: whether you want the <span class="emphasis"><em>current</em></span> branch or the
! 59: <span class="emphasis"><em>stable</em></span> branch. The latter is forked on a
! 60: quarterly basis from the current branch and only gets modified
! 61: for security updates. The names of the stable branches are built
! 62: from the year and the quarter, for example
! 63: <code class="literal">2007Q1</code>.</p>
! 64: <p>The second step is to decide <span class="emphasis"><em>how</em></span> you
! 65: want to download pkgsrc. You can get it as a tar file, via SUP,
! 66: or via CVS. All three ways are described here.</p>
! 67: <div class="sect2" lang="en">
! 68: <div class="titlepage"><div><div><h3 class="title">
! 69: <a name="getting-via-tar"></a>2.1.1. As tar file</h3></div></div></div>
! 70: <p>The primary download location for all pkgsrc files is
! 71: <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/" target="_top">ftp://ftp.NetBSD.org/pub/pkgsrc/</a>. There are a
! 72: number of subdirectories for different purposes, which are
! 73: described in detail in <a href="ftp-layout.html" title="Appendix C. Directory layout of the pkgsrc FTP server">Appendix C, <i>Directory layout of the pkgsrc FTP server</i></a>.</p>
! 74: <p>The tar file for the current branch is in the directory
! 75: <code class="filename">current</code> and is called <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz" target="_top"><code class="filename">pkgsrc.tar.gz</code></a>.
! 76: It is autogenerated daily.</p>
! 77: <p>The tar file for the stable branch 2007Q1 is in the
! 78: directory <code class="filename">pkgsrc-2007Q1</code> and is also called <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/pkgsrc-2007Q1/pkgsrc-2007Q1.tar.gz" target="_top"><code class="filename">pkgsrc-2007Q1.tar.gz</code></a>.</p>
! 79: <p>After downloading the tar file, change to the directory
! 80: where you want to have pkgsrc. This is usually
! 81: <code class="filename">/usr</code>. Then, run <span><strong class="command">gzcat
! 82: pkgsrc.tar.gz | tar xf -</strong></span> to extract the files.</p>
! 83: </div>
! 84: <div class="sect2" lang="en">
! 85: <div class="titlepage"><div><div><h3 class="title">
! 86: <a name="getting-via-sup"></a>2.1.2. Via SUP</h3></div></div></div>
! 87: <p>As an alternative to the tar file, you can get pkgsrc via
! 88: the Software Update Protocol, SUP. To do so, make sure your
! 89: supfile has a line
! 90:
! 91: </p>
! 92: <pre class="programlisting">
! 93: release=pkgsrc
! 94: </pre>
! 95: <p>
! 96:
! 97: in it, see the examples in
! 98: <code class="filename">/usr/share/examples/supfiles</code>, and that the
! 99: <code class="filename">/usr/pkgsrc</code> directory exists. Then, simply
! 100: run <span><strong class="command">sup -v
! 101: <em class="replaceable"><code>/path/to/your/supfile</code></em></strong></span>.</p>
! 102: </div>
! 103: <div class="sect2" lang="en">
! 104: <div class="titlepage"><div><div><h3 class="title">
! 105: <a name="getting-via-cvs"></a>2.1.3. Via anonymous CVS</h3></div></div></div>
! 106: <p>To get pkgsrc via CVS, make sure you have <a href="http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-current"><span class="citerefentry"><span class="refentrytitle">cvs</span>(1)</span></a>
! 107: installed. To do an initial (full) checkout of pkgsrc, you first
! 108: have to set some environment variables. For the C-Shell,
! 109: type:</p>
! 110: <pre class="screen">
! 111: <code class="prompt">%</code> <strong class="userinput"><code>setenv CVSROOT anoncvs@anoncvs.NetBSD.org:/cvsroot</code></strong>
! 112: <code class="prompt">%</code> <strong class="userinput"><code>setenv CVS_RSH ssh</code></strong>
! 113: </pre>
! 114: <p>Or, the same for the bourne shell:</p>
! 115: <pre class="screen">
! 116: <code class="prompt">$</code> <strong class="userinput"><code>CVSROOT="anoncvs@anoncvs.NetBSD.org:/cvsroot"</code></strong>
! 117: <code class="prompt">$</code> <strong class="userinput"><code>CVS_RSH="ssh"</code></strong>
! 118: <code class="prompt">$</code> <strong class="userinput"><code>export CVSROOT CVS_RSH</code></strong>
! 119: </pre>
! 120: <p>Then, you change to the directory where you want to have
! 121: your copy of pkgsrc. In most cases this is
! 122: <code class="filename">/usr</code>. In that directory you run the
! 123: checkout command, which is <span><strong class="command">cvs -q checkout -P
! 124: pkgsrc</strong></span> for the current branch and <span><strong class="command">cvs -q
! 125: checkout -rpkgsrc-2007Q1 -P pkgsrc</strong></span> for the stable
! 126: branch. This command will create a directory called
! 127: <code class="filename">pkgsrc</code> with all the pkgsrc files in
! 128: it.</p>
! 129: </div>
! 130: </div>
! 131: <div class="sect1" lang="en">
! 132: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
! 133: <a name="uptodate"></a>2.2. Keeping pkgsrc up-to-date</h2></div></div></div>
! 134: <p>The preferred way to keep pkgsrc up-to-date is via CVS
! 135: (which also works if you have first installed it via a tar
! 136: file). It saves bandwidth and hard disk activity, compared to
! 137: downloading the tar file again.</p>
! 138: <div class="sect2" lang="en">
! 139: <div class="titlepage"><div><div><h3 class="title">
! 140: <a name="uptodate-tar"></a>2.2.1. Via tar files</h3></div></div></div>
! 141: <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
! 142: <h3 class="title">Warning</h3>
! 143: <p>When updating from a tar file, you first need to
! 144: completely remove the old pkgsrc directory. Otherwise those
! 145: files that have been removed from pkgsrc in the mean time will
! 146: not be removed on your local disk, resulting in inconsistencies.
! 147: When removing the old files, any changes that you have done to
! 148: the pkgsrc files will be lost after updating. Therefore updating
! 149: via CVS is strongly recommended.</p>
! 150: </div>
! 151: <p>Note that by default the distfiles and the binary packages
! 152: are saved in the pkgsrc tree, so don't forget to rescue them
! 153: before updating. You can also configure pkgsrc to use other than
! 154: the default directories by setting the
! 155: <code class="varname">DISTDIR</code> and <code class="varname">PACKAGES</code>
! 156: variables. See <a href="configuring.html" title="Chapter 5. Configuring pkgsrc">Chapter 5, <i>Configuring pkgsrc</i></a> for the details.</p>
! 157: <p>To update pkgsrc from a tar file, download the tar file as
! 158: explained above. Then, make sure that you have not made any
! 159: changes to the files in the pkgsrc directory. Remove the pkgsrc
! 160: directory and extract the new tar file. Done.</p>
! 161: </div>
! 162: <div class="sect2" lang="en">
! 163: <div class="titlepage"><div><div><h3 class="title">
! 164: <a name="uptodate-cvs"></a>2.2.2. Via CVS</h3></div></div></div>
! 165: <p>To update pkgsrc via CVS, make sure the environment
! 166: variable <code class="varname">CVS_RSH</code> is set as above. Then,
! 167: change to the pkgsrc directory and run <span><strong class="command">cvs -q update
! 168: -dP</strong></span>.</p>
! 169: <div class="sect3" lang="en">
! 170: <div class="titlepage"><div><div><h4 class="title">
! 171: <a name="uptodate-cvs-switch"></a>2.2.2.1. Switching between different pkgsrc branches</h4></div></div></div>
! 172: <p>When updating pkgsrc, the CVS program keeps track of the
! 173: branch you selected. But if you, for whatever reason, want to
! 174: switch from the stable branch to the current one, you can do it
! 175: by adding the option “<span class="quote">-A</span>” after the
! 176: “<span class="quote">update</span>” keyword. To switch from the current branch
! 177: back to the stable branch, add the
! 178: “<span class="quote">-rpkgsrc-2007Q1</span>” option.</p>
! 179: </div>
! 180: <div class="sect3" lang="en">
! 181: <div class="titlepage"><div><div><h4 class="title">
! 182: <a name="uptodate-cvs-changes"></a>2.2.2.2. What happens to my changes when updating?</h4></div></div></div>
! 183: <p>When you update pkgsrc, the CVS program will only touch
! 184: those files that are registered in the CVS repository. That
! 185: means that any packages that you created on your own will stay
! 186: unmodified. If you change files that are managed by CVS, later
! 187: updates will try to merge your changes with those that have been
! 188: done by others. See the CVS manual, chapter
! 189: “<span class="quote">update</span>” for details.</p>
! 190: </div>
! 191: </div>
! 192: </div>
! 193: </div>
! 194: <div class="navfooter">
! 195: <hr>
! 196: <table width="100%" summary="Navigation footer">
! 197: <tr>
! 198: <td width="40%" align="left">
! 199: <a accesskey="p" href="users-guide.html">Prev</a> </td>
! 200: <td width="20%" align="center"><a accesskey="u" href="users-guide.html">Up</a></td>
! 201: <td width="40%" align="right"> <a accesskey="n" href="platforms.html">Next</a>
! 202: </td>
! 203: </tr>
! 204: <tr>
! 205: <td width="40%" align="left" valign="top">Part I. The pkgsrc user's guide </td>
! 206: <td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
! 207: <td width="40%" align="right" valign="top"> Chapter 3. Using pkgsrc on systems other than NetBSD</td>
! 208: </tr>
! 209: </table>
! 210: </div>
! 211: </body>
! 212: </html>
CVSweb <webmaster@jp.NetBSD.org>