Annotation of pkgsrc/doc/guide/files/binary.xml, revision 1.9

1.9     ! wiz         1: <!-- $NetBSD: binary.xml,v 1.8 2005/01/24 14:44:39 jschauma Exp $ -->
1.1       grant       2: 
                      3: <chapter id="binary">
                      4:   <title>Creating binary packages</title>
                      5: 
                      6:   <sect1>
                      7:     <title>Building a single binary package</title>
                      8: 
1.6       hubertf     9:     <para>
                     10:       Once you have built and installed a package, you can create a
                     11:       <emphasis>binary package</emphasis> which can be installed on
                     12:       another system with &man.pkg.add.1; This saves having to build
                     13:       the same package on a group of hosts and wasting CPU time. It
                     14:       also provides a simple means for others to install your package,
                     15:       should you distribute it.
                     16:     </para>
                     17: 
                     18:     <para>
                     19:       To create a binary package, change into the appropriate
                     20:       directory in pkgsrc, and run <command>make
                     21:       package</command>:
                     22:     </para>
1.1       grant      23: 
                     24:     <screen>&rprompt; <userinput>cd misc/figlet</userinput>
                     25: &rprompt; <userinput>make package</userinput></screen>
                     26: 
1.6       hubertf    27:     <para>
                     28:       This will build and install your package (if not already done),
                     29:       and then build a binary package from what was installed. You can
                     30:       then use the <command>pkg_*</command> tools to manipulate
                     31:       it. Binary packages are created by default in
                     32:       <filename>/usr/pkgsrc/packages</filename>, in the form of a
                     33:       gzipped tar file. See <xref linkend="logs.package"/> for a
                     34:       continuation of the above <pkg>misc/figlet</pkg> example.</para>
                     35: 
                     36:     <para>
                     37:       See <xref linkend="submit"/> for information on how to submit
                     38:       such a binary package.</para>
1.1       grant      39:   </sect1>
                     40: 
                     41:   <sect1>
                     42:     <title>Settings for creation of binary packages</title>
                     43: 
                     44:     <para>See <xref linkend="build.helpful-targets"/>.</para>
                     45:   </sect1>
                     46: 
                     47:   <sect1 id="bulkbuild">
                     48:     <title>Doing a bulk build of all packages</title>
                     49: 
1.9     ! wiz        50:     <para>If you want to get a full set of precompiled binary
        !            51:       packages, this section describes how to get them. Beware that
        !            52:       the bulk build will remove all currently installed packages from
        !            53:       your system! Having an FTP server configured either on the
        !            54:       machine doing the bulk builds or on a nearby NFS server can help
        !            55:       to make the packages available to everyone. See &man.ftpd.8; for
        !            56:       more information. If you use a remote NFS server's storage, be
        !            57:       sure to not actually compile on NFS storage, as this slows
        !            58:       things down a lot.</para>
1.1       grant      59: 
                     60:     <sect2 id="binary.configuration">
                     61:       <title>Configuration</title>
                     62: 
                     63:       <sect3 id="binary.mk.conf">
                     64:        <title>/etc/mk.conf</title>
                     65: 
1.9     ! wiz        66:        <para>You may want to set variables in
        !            67:          <filename>/etc/mk.conf</filename>.
1.2       ben        68:          Look at <filename>pkgsrc/mk/defaults/mk.conf</filename> for
1.1       grant      69:          details of the default settings. You will want to ensure that
                     70:          <varname>ACCEPTABLE_LICENSES</varname> meet your local policy.
                     71:          As used in this example, <varname>_ACCEPTABLE=yes</varname>
                     72:          accepts <emphasis>all</emphasis> licenses.</para>
                     73: 
                     74:        <programlisting>PACKAGES?=      ${_PKGSRCDIR}/packages/${MACHINE_ARCH}
                     75: WRKOBJDIR?=     /usr/tmp/pkgsrc   # build here instead of in pkgsrc
                     76: BSDSRCDIR=      /usr/src
                     77: BSDXSRCDIR=     /usr/xsrc         # for x11/xservers
                     78: OBJHOSTNAME?=   yes               # use work.`hostname`
                     79: FAILOVER_FETCH= yes               # insist on the correct checksum
                     80: PKG_DEVELOPER?= yes
                     81: _ACCEPTABLE=    yes</programlisting>
                     82:       </sect3>
                     83: 
                     84:       <sect3>
                     85:        <title><filename>build.conf</filename></title>
                     86: 
                     87:        <para>In <filename>pkgsrc/mk/bulk</filename>, copy
                     88:          <filename>build.conf-example</filename> to
                     89:          <filename>build.conf</filename> and
                     90:          edit it, following the comments in that file. This is the config
                     91:          file that determines where log files are generated after the build,
1.9     ! wiz        92:          where to mail the build report to, where your pkgsrc tree is
        !            93:          located and the user to which user to &man.su.8; to do a
        !            94:          <command>cvs update</command>.</para>
1.1       grant      95:       </sect3>
                     96: 
                     97:       <sect3>
                     98:        <title><filename>pre-build.local</filename></title>
                     99: 
1.9     ! wiz       100:        <para>It is possible to configure the bulk build to perform
        !           101:          certain site specific tasks at the end of the pre-build
        !           102:          stage.  If the file 
1.1       grant     103:          <filename>pre-build.local</filename> exists in
1.9     ! wiz       104:          <filename>/usr/pkgsrc/mk/bulk</filename>, it will be executed
        !           105:          (as a &man.sh.1; script) at the end of the usual pre-build
        !           106:          stage.  An example use of
        !           107:          <filename>pre-build.local</filename> is to have the line:</para>
1.1       grant     108: 
                    109:        <screen>&rprompt; <userinput>echo "I do not have enough disk space to build this pig." \
1.9     ! wiz       110:     &gt; pkgsrc/misc/openoffice/$BROKENF</userinput></screen>
1.1       grant     111: 
                    112:        <para>to prevent the system from trying to build a particular package
                    113:          which requires nearly 3 GB of disk space.</para>
                    114:       </sect3>
                    115:     </sect2>
                    116: 
                    117:     <sect2>
                    118:       <title>Other environmental considerations</title>
                    119: 
1.6       hubertf   120:       <para>As <filename>/usr/pkg</filename> will be completely
                    121:        deleted at the start of bulk builds, make sure your login
                    122:        shell is placed somewhere else. Either drop it into
                    123:        <filename>/usr/local/bin</filename> (and adjust your login
                    124:        shell in the passwd file), or (re-)install it via
                    125:        &man.pkg.add.1; from <filename>/etc/rc.local</filename>, so
                    126:        you can login after a reboot (remember that your current
                    127:        process won't die if the package is removed, you just can't
                    128:        start any new instances of the shell any more).  Also, if you
                    129:        use &os; earlier than 1.5, or you still want to use the pkgsrc
                    130:        version of ssh for some reason, be sure to install ssh before
1.1       grant     131:        starting it from <filename>rc.local</filename>:</para>
                    132: 
                    133:       <programlisting>( cd /usr/pkgsrc/security/ssh ; make bulk-install )
                    134: if [ -f        /usr/pkg/etc/rc.d/sshd ]; then
                    135:     /usr/pkg/etc/rc.d/sshd
                    136: fi</programlisting>
                    137: 
1.6       hubertf   138:       <para>Not doing so will result in you being not able to log in
                    139:        via ssh after the bulk build is finished or if the machine
                    140:        gets rebooted or crashes. You have been warned! :)</para>
1.1       grant     141:     </sect2>
                    142: 
                    143:     <sect2>
                    144:       <title>Operation</title>
                    145: 
1.6       hubertf   146:       <para>Make sure you don't need any of the packages still
                    147:        installed.
                    148:       </para> 
1.1       grant     149: 
                    150:       <warning>
1.6       hubertf   151:        <para>During the bulk build, <emphasis>all packages will be 
1.1       grant     152:            removed!</emphasis></para>
                    153:       </warning>
                    154: 
                    155:       <para>Be sure to remove all other things that might
                    156:        interfere with builds, like some libs installed in
                    157:        <filename>/usr/local</filename>, etc. then become root and type:</para>
                    158: 
                    159:       <screen>&rprompt; <userinput>cd /usr/pkgsrc</userinput>
                    160: &rprompt; <userinput>sh mk/bulk/build</userinput></screen>
                    161: 
1.6       hubertf   162:       <para>If for some reason your last build didn't complete (power
                    163:        failure, system panic, ...), you can continue it by
                    164:        running:</para> 
1.1       grant     165: 
                    166:       <screen>&rprompt; <userinput>sh mk/bulk/build restart</userinput></screen>
                    167: 
1.6       hubertf   168:       <para>
                    169:         At the end of the bulk build, you will get a summary via mail,
                    170:        and find build logs in the directory specified by
                    171:        <varname>FTP</varname> in the <filename>build.conf</filename>
                    172:        file.
                    173:       </para> 
1.1       grant     174:     </sect2>
                    175: 
                    176:     <sect2>
                    177:       <title>What it does</title>
                    178: 
                    179:       <para>The bulk builds consist of three steps:</para>
                    180: 
                    181:       <variablelist>
                    182:        <varlistentry>
                    183:          <term>1. pre-build</term>
                    184: 
                    185:          <listitem>
1.6       hubertf   186:            <para>
                    187:              The script updates your pkgsrc tree via (anon)cvs, then
                    188:              cleans out any broken distfiles, and removes all
                    189:              packages installed.</para>
1.1       grant     190:          </listitem>
                    191:        </varlistentry>
                    192: 
                    193:        <varlistentry>
                    194:          <term>2. the bulk build</term>
                    195: 
                    196:          <listitem>
1.6       hubertf   197:            <para>
                    198:              This is basically <quote>make bulk-package</quote> with
                    199:              an optimised order in which packages will be
                    200:              built. Packages that don't require other packages will
                    201:              be built first, and packages with many dependencies will
                    202:              be built later.
                    203:            </para>
1.1       grant     204:          </listitem>
                    205:        </varlistentry>
                    206: 
                    207:        <varlistentry>
                    208:          <term>3. post-build</term>
                    209: 
                    210:          <listitem>
1.6       hubertf   211:            <para>
                    212:              Generates a report that's placed in the directory
                    213:              specified in the <filename>build.conf</filename> file
                    214:              named <filename>broken.html</filename>, a short version
                    215:              of that report will also be mailed to the build's
                    216:              admin.</para>
1.1       grant     217:          </listitem>
                    218:        </varlistentry>
                    219:       </variablelist>
                    220: 
1.6       hubertf   221:       <para>
                    222:         During the build, a list of broken packages will be compiled
                    223:         in <filename>/usr/pkgsrc/.broken</filename> (or
                    224:         <filename>.../.broken.${MACHINE}</filename> if
                    225:         <varname>OBJMACHINE</varname> is set), individual build logs
                    226:         of broken builds can be found in the package's
                    227:         directory. These files are used by the bulk-targets to mark
                    228:         broken builds  to not waste time trying to rebuild them, and
                    229:         they can be used to debug      these broken package builds
                    230:         later.
                    231:       </para> 
1.1       grant     232:     </sect2>
                    233: 
                    234:     <sect2>
                    235:       <title>Disk space requirements</title>
                    236: 
                    237:       <para>Currently, roughly the following requirements are valid for
                    238:        NetBSD 2.0/i386:</para>
                    239: 
                    240:       <itemizedlist>
                    241:        <listitem>
1.6       hubertf   242:          <para>
                    243:            10 GB - distfiles (NFS ok)
                    244:          </para>
1.1       grant     245:        </listitem>
                    246: 
                    247:        <listitem>
1.6       hubertf   248:          <para>
                    249:            8 GB - full set of all binaries (NFS ok)
                    250:          </para>
1.1       grant     251:        </listitem>
                    252: 
                    253:        <listitem>
1.6       hubertf   254:          <para>
                    255:            5 GB - temp space for compiling (local disk recommended)
                    256:          </para>
1.1       grant     257:        </listitem>
                    258:       </itemizedlist>
                    259: 
1.6       hubertf   260:       <para>
                    261:         Note that all pkgs will be de-installed as soon as they are
                    262:         turned into a  binary package, and that sources are removed,
                    263:         so there is no excessively huge        demand to disk
                    264:         space. Afterwards, if the package is needed again, it will
                    265:         be installed via &man.pkg.add.1; instead of building again, so
                    266:         there are no cycles wasted by recompiling.
                    267:       </para> 
1.1       grant     268:     </sect2>
                    269: 
                    270:     <sect2>
                    271:       <title>Setting up a sandbox for chroot'ed builds</title>
                    272: 
1.6       hubertf   273:       <para>
                    274:         If you don't want all the packages nuked from a machine
                    275:         (rendering it useless for anything but pkg compiling), there
1.9     ! wiz       276:         is the possibility of doing the package bulk build inside a
1.6       hubertf   277:         chroot environment.
                    278:       </para>
                    279:        
                    280:       <para>
                    281:         The first step is to set up a chroot sandbox,
                    282:        e.g. <filename>/usr/sandbox</filename>.  This can be done by
                    283:        using null mounts, or manually.
                    284:       </para>
                    285: 
                    286:       <para>
                    287:         There is a shell script called
                    288:         <filename>pkgsrc/mk/bulk/mksandbox</filename> which will set
                    289:         up the sandbox environment using null mounts. It will also
                    290:         create a script called <filename>sandbox</filename> in the
                    291:         root of the sandbox environment, which will allow the null
                    292:         mounts to be activated using the <command>sandbox
                    293:         mount</command> command and deactivated using the
                    294:         <command>sandbox umount</command> command.
                    295:       </para> 
                    296: 
                    297:       <para>
                    298:         To set up a sandbox environment by hand, after extracting all
                    299:         the sets from a &os; installation or doing a <command>make
                    300:         distribution DESTDIR=/usr/sandbox</command> in
                    301:         <filename>/usr/src/etc</filename>, be sure the following items
                    302:         are present and properly configured:
                    303:       </para>
1.1       grant     304: 
                    305:       <procedure>
                    306:        <step>
                    307:          <para>Kernel</para>
                    308: 
                    309:          <screen>&rprompt; <userinput>cp /netbsd /usr/sandbox</userinput></screen>
                    310:        </step>
                    311: 
                    312:        <step>
                    313:          <para><filename>/dev/*</filename></para>
                    314: 
                    315:          <screen>&rprompt; <userinput>cd /usr/sandbox/dev ; sh MAKEDEV all</userinput></screen>
                    316:        </step>
                    317: 
                    318:        <step>
                    319:          <para><filename>/etc/resolv.conf</filename> (for <pkg>security/smtpd</pkg> and mail):</para>
                    320: 
                    321:          <screen>&rprompt; <userinput>cp /etc/resolv.conf /usr/sandbox/etc</userinput></screen>
                    322:        </step>
                    323: 
                    324:        <step>
                    325:          <para>Working(!) mail config (hostname, sendmail.cf):</para>
                    326: 
                    327:          <screen>&rprompt; <userinput>cp /etc/mail/sendmail.cf /usr/sandbox/etc/mail</userinput></screen>
                    328:        </step>
                    329: 
                    330:        <step>
                    331:          <para><filename>/etc/localtime</filename> (for <pkg>security/smtpd</pkg>):</para>
                    332: 
                    333:          <screen>&rprompt; <userinput>ln -sf /usr/share/zoneinfo/UTC /usr/sandbox/etc/localtime</userinput></screen>
                    334:        </step>
                    335: 
                    336:        <step>
                    337:          <para><filename>/usr/src</filename> (system sources, for <pkg>sysutils/aperture</pkg>,
                    338:            <pkg>net/ppp-mppe</pkg>):</para>
                    339: 
                    340:          <screen>&rprompt; <userinput>ln -s ../disk1/cvs .</userinput>
1.9     ! wiz       341: &rprompt; <userinput>ln -s cvs/src-2.0 src</userinput></screen>
1.1       grant     342:        </step>
                    343: 
                    344:        <step>
                    345:          <para>Create <filename>/var/db/pkg</filename> (not part of default install):</para>
                    346: 
                    347:          <screen>&rprompt; <userinput>mkdir /usr/sandbox/var/db/pkg</userinput></screen>
                    348:        </step>
                    349: 
                    350:        <step>
                    351:          <para>Create <filename>/usr/pkg</filename> (not part of default install):</para>
                    352: 
                    353:          <screen>&rprompt; <userinput>mkdir /usr/sandbox/usr/pkg</userinput></screen>
                    354:        </step>
                    355: 
                    356:        <step>
                    357:          <para>Checkout pkgsrc via cvs into
                    358:            <filename>/usr/sandbox/usr/pkgsrc</filename>:</para>
                    359: 
                    360:          <screen>&rprompt; <userinput>cd /usr/sandbox/usr</userinput>
                    361: &rprompt; <userinput>cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -d -P pkgsrc</userinput></screen>
                    362: 
                    363:           <para>Do not mount/link this to the copy of your pkgsrc tree
                    364:            you do development in, as this will likely cause problems!
                    365:            </para> 
                    366:        </step>
                    367: 
                    368:        <step>
                    369:          <para>Make
                    370:            <filename>/usr/sandbox/usr/pkgsrc/packages</filename> and
                    371:            <filename>.../distfiles</filename> point somewhere
                    372:            appropriate. NFS- and/or nullfs-mounts may come in handy!
                    373:            </para>
                    374:        </step>
                    375: 
                    376:        <step>
                    377:          <para>Edit <filename>/etc/mk.conf</filename>, see <xref linkend="binary.mk.conf"/>.</para>
                    378:        </step>
                    379: 
                    380:        <step>
                    381:          <para>Adjust <filename>mk/bulk/build.conf</filename> to suit your needs.</para>
                    382:        </step>
                    383: 
                    384:        <step>
                    385:          <para>If you have set <varname>CVS_USER</varname> in
                    386:            <filename>build.conf</filename>, make sure that 
                    387:            account exists and can do a <command>cvs ${CVS_FLAGS}
                    388:            update</command> properly!</para> 
                    389:        </step>
                    390:       </procedure>
                    391: 
                    392:       <para>When the chroot sandbox is setup, you can start
                    393:        the build with the following steps:</para>
                    394: 
                    395:       <screen>&rprompt; <userinput>cd /usr/sandbox/usr/pkgsrc</userinput>
                    396: &rprompt; <userinput>sh mk/bulk/do-sandbox-build</userinput></screen>
                    397: 
1.6       hubertf   398:       <para>
                    399:         This will just jump inside the sandbox and start building.  At
                    400:         the end of the build, mail will be sent with the results of
                    401:         the build. Created binary pkgs will be in
                    402:         <filename>/usr/sandbox/usr/pkgsrc/packages</filename>
                    403:         (wherever that points/mounts to/from).</para>
1.1       grant     404:     </sect2>
                    405: 
                    406:     <sect2>
                    407:       <title>Building a partial set of packages</title>
                    408: 
                    409:       <para> In addition to building a complete set of all packages in
                    410:         pkgsrc, the <filename>pkgsrc/mk/bulk/build</filename> script
                    411:         may be used to build a subset of the packages contained in
                    412:         pkgsrc.  By setting defining <varname>SPECIFIC_PKGS</varname>
                    413:         in <filename>/etc/mk.conf</filename>, the variables</para>
                    414: 
                    415:       <itemizedlist>
                    416:        <listitem><para>SITE_SPECIFIC_PKGS</para></listitem>
                    417:        <listitem><para>HOST_SPECIFIC_PKGS</para></listitem>
                    418:        <listitem><para>GROUP_SPECIFIC_PKGS</para></listitem>
                    419:        <listitem><para>USER_SPECIFIC_PKGS</para></listitem>
                    420:       </itemizedlist>
                    421: 
                    422:       <para> will define the set of packages which should be built.
                    423:         The bulk build code will also include any packages which are
                    424:         needed as dependencies for the explicitly listed packages.
                    425:        </para>
                    426: 
                    427:       <para> One use of this is to do a bulk build with
                    428:         <varname>SPECIFIC_PKGS</varname> in a chroot sandbox
                    429:         periodically to have a complete set of the binary packages
                    430:         needed for your site available without the overhead of
                    431:         building extra packages that are not needed.  </para>
                    432: 
                    433:     </sect2>
1.6       hubertf   434: 
                    435:     <sect2 id="bulk-upload">
                    436:       <title>Uploading results of a bulk build</title>
                    437: 
                    438:       <para>
                    439:         This section describes how pkgsrc developers can upload binary
                    440:         pkgs built by bulk builds to ftp.NetBSD.org.
                    441:       </para>
                    442: 
                    443:       <para>
1.8       jschauma  444:        If you would like to automatically create checksum files for the
                    445:        binary packages you intend to upload, remember to set
                    446:        <varname>MKSUMS=yes</varname> in your
                    447:        <filename>mk/bulk/build.conf</filename>.
                    448:       </para>
                    449: 
                    450:       <para>
                    451:        If you would like to PGP sign the checksum files (highly
                    452:        recommended!), remember to set
                    453:        <varname>SIGN_AS=username@NetBSD.org</varname> in your
                    454:        <filename>mk/bulk/build.conf</filename>.  This will prompt you for
1.9     ! wiz       455:        your GPG password to sign the files before uploading everything.
1.8       jschauma  456:       </para>
                    457: 
                    458:       <para>
                    459:         Then, make sure that you have <varname>RSYNC_DST</varname>
1.6       hubertf   460:         set properly in your <filename>mk/bulk/build.conf</filename>
                    461:         file, i.e. adjust it to something like one of the following:
                    462:       </para>
                    463: 
                    464:       <screen>RSYNC_DST=$CVS_USER@ftp.NetBSD.org:/pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b.c/arch/upload </screen>
                    465: 
                    466:       <para>
1.9     ! wiz       467:         Please use appropviate values for "pkgsrc-200xQy",
1.6       hubertf   468:         "NetBSD-a.b.c" and "arch" here. If your login on
                    469:         ftp.NetBSD.org is different from <varname>CVS_USER</varname>,
                    470:         write your login directly into the variable, e.g. my local
                    471:         account is "feyrer", but for my login "hubertf", I use:
                    472:       </para>
                    473: 
                    474:       <screen>RSYNC_DST=hubertf@ftp.NetBSD.org:/pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b.c/arch/upload </screen>
                    475: 
                    476:       <para>
                    477:         A separate <filename>upload</filename> directory is used
                    478:         here to allow "closing" the directory during upload. To do
                    479:         so, run the following command on ftp.NetBSD.org next:
                    480:       </para>
                    481: 
                    482:       <screen>nbftp% <userinput>mkdir -p -m 750 /pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b.c/arch/upload</userinput></screen>
                    483: 
                    484:       <para>
                    485:         Please note that <filename>/pub/NetBSD/packages</filename> is
                    486:         only appropriate for packages for the NetBSD operating
                    487:         system. Binary packages for other operating systems should go
                    488:         into <filename>/pub/pkgsrc</filename>.
                    489:       </para>
                    490: 
                    491:       <para>
                    492:         Before uploading the binary pkgs, ssh authentication needs to
1.9     ! wiz       493:         be set up. This example shows how to setup temporary keys
1.6       hubertf   494:         for the root account <emphasis>inside the sandbox</emphasis>
                    495:         (assuming that no keys should be present there usually):
                    496:       </para>
                    497: 
                    498:       <screen>&rprompt; <userinput>chroot /usr/sandbox</userinput>        
                    499: chroot-&rprompt; <userinput>rm $HOME/.ssh/id-dsa*</userinput>        
                    500: chroot-&rprompt; <userinput>ssh-keygen -t dsa</userinput>        
                    501: chroot-&rprompt; <userinput>cat $HOME/.ssh/id-dsa.pub</userinput> </screen>
                    502: 
                    503:       <para>
                    504:         Now take the output of <filename>id-dsa.pub</filename> and
                    505:         append it to your <filename>~/.ssh/authorized_keys</filename>
1.7       heinz     506:         file on ftp.NetBSD.org. You can remove the key after the
1.6       hubertf   507:         upload is done!
                    508:       </para>
                    509: 
                    510:       <para>
                    511:         Next, test if your ssh connection really works:
                    512:       </para>
                    513: 
                    514:       <screen>chroot-&rprompt; <userinput>ssh ftp.NetBSD.org date</userinput> </screen>
                    515: 
                    516:       <para>
                    517:         Use "-l yourNetBSDlogin" here as appropriate!
                    518:       </para>
                    519: 
                    520:       <para>
                    521:         Now after all this works, you can exit the sandbox and start
                    522:         the upload:
                    523:       </para>
                    524: 
                    525:       <screen>chroot-&rprompt; <userinput>exit</userinput>        
                    526: &rprompt; <userinput>cd /usr/sandbox/usr/pkgsrc</userinput>        
                    527: &rprompt; <userinput>sh mk/bulk/do-sandbox-upload</userinput> </screen>
                    528: 
                    529:       <para>
                    530:         The upload process may take quite some time. Use "ls" or "du"
                    531:         on the FTP server to monitor progress of the upload.
                    532:       </para>
                    533: 
                    534:       <para>
                    535:         After the upload has ended, first thing is to revoke ssh access:
                    536:       </para>
                    537: 
                    538:       <screen>nbftp% <userinput>vi ~/.ssh/authorized_keys</userinput>
                    539: Gdd:x! </screen>
                    540: 
                    541:       <para>
                    542:         Use whatever is needed to remove the key you've entered
                    543:         before! Last, move the uploaded packages out of the
                    544:         <filename>upload</filename> directory to have them accessible
                    545:         to everyone: 
                    546:       </para>
                    547: 
                    548:       <screen>nbftp% <userinput>cd /pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b.c/arch</userinput>
                    549: nbftp% <userinput>mv upload/* .</userinput>
                    550: nbftp% <userinput>rmdir upload</userinput>
                    551: nbftp% <userinput>chmod 755 .</userinput> </screen>
                    552:     </sect2>
1.1       grant     553:   </sect1>
                    554: 
                    555:   <sect1>
                    556:     <title>Creating a multiple CD-ROM packages collection</title>
                    557: 
1.6       hubertf   558:     <para>
                    559:       After your pkgsrc bulk-build has completed, you may wish to
                    560:       create a CD-ROM set of the resulting binary packages to assist
                    561:       in installing packages on other machines.  The
                    562:       <pkg>pkgtools/cdpack</pkg> package provides a simple tool for
                    563:       creating the ISO 9660 images. <command>cdpack</command> arranges
                    564:       the packages on the CD-ROMs in a way that keeps all the
                    565:       dependencies for given package on the same CD as that
                    566:       package.
                    567:     </para>
1.1       grant     568: 
                    569:     <sect2>
                    570:       <title>Example of cdpack</title>
                    571: 
1.6       hubertf   572:       <para>
                    573:         Complete documentation for cdpack is found in the cdpack(1)
                    574:         manpage. The following short example assumes that the binary
                    575:         packages are left in
                    576:         <filename>/usr/pkgsrc/packages/All</filename> and that
                    577:         sufficient disk space exists in <filename>/u2</filename> to
                    578:         hold the ISO 9660 images.</para>
1.1       grant     579: 
                    580:       <screen>&rprompt; <userinput>mkdir /u2/images</userinput>
                    581: &rprompt; <userinput>pkg_add /usr/pkgsrc/packages/All/cdpack</userinput>
                    582: &rprompt; <userinput>cdpack /usr/pkgsrc/packages/All /u2/images</userinput></screen>
                    583: 
1.6       hubertf   584:       <para>
                    585:         If you wish to include a common set of files
                    586:        (<filename>COPYRIGHT</filename>, <filename>README</filename>,
                    587:        etc.) on each CD in the collection, then you need to create a
                    588:        directory which contains these files. e.g.
                    589:       </para>
1.1       grant     590: 
                    591:       <screen>&rprompt; <userinput>mkdir /tmp/common</userinput>
                    592: &rprompt; <userinput>echo "This is a README" &gt; /tmp/common/README</userinput>
                    593: &rprompt; <userinput>echo "Another file" &gt; /tmp/common/COPYING</userinput>
                    594: &rprompt; <userinput>mkdir /tmp/common/bin</userinput>
                    595: &rprompt; <userinput>echo "#!/bin/sh" &gt; /tmp/common/bin/myscript</userinput>
                    596: &rprompt; <userinput>echo "echo Hello world" &gt;&gt; /tmp/common/bin/myscript</userinput>
                    597: &rprompt; <userinput>chmod 755 /tmp/common/bin/myscript</userinput></screen>
                    598: 
                    599:       <para>Now create the images:</para>
                    600: 
                    601:       <screen>&rprompt; <userinput>cdpack -x /tmp/common /usr/pkgsrc/packages/All /u2/images</userinput></screen>
                    602: 
                    603:       <para>Each image will contain <filename>README</filename>,
                    604:        <filename>COPYING</filename>, and <filename>bin/myscript</filename>
                    605:        in their root directories.</para>
                    606:     </sect2>
                    607:   </sect1>
                    608: </chapter>

CVSweb <webmaster@jp.NetBSD.org>