To use this document

This document assumes that you want to install the master source tools ksb provides to manage complex configurations.

If you'll do not have superuser access to the target machine, then you'll need the mortal boot document which is a link off the msrcmux page. Read that document to find out how to build an unpacked copy of the master source from the source packages. Then follow the links to the instructions for mortals (which is in that document). There you'll learn host to setup a master source cache in your home directory, build mmsrc, msrcmux, muxcat and the shim tool listenr. With those you can return here to build as a mortal via the pull build for relocating the tools. (You are done here, because the rest of this document needs powers you don't have.) If you want the rpm build you'll need to study the RPM boot document.

Otherwise you are going to run some commands as the superuser, but less critical ones as yourself (as I would). The common hash (#) prompt is the superuser, the dollar ($) prompt is a mortal login.

Download the 2 base packages everyone needs

To build anything else you need msrc_base and install_base. If you read about building a local unpacked copy of the master source you may have downloaded all the source packages to a local directory, if so you can use that copy, otherwise mirror the latest source packages for the npcguild.org or databits.net websites. I put then in the directory dl (this is the same session given in the mortal install page).

Here is an example session where I build a copy under $HOME/msrc, since I know you can write in your own home directory, assuming you have the space. You'll also need GNU tar, which we call gtar in the steps below (skip the HTTP_PROXY command if you don't need it):

sulaco 8  mkdir msrc msrc/dl
sulaco 9  cd msrc
sulaco msrc 10  export  HTTP_PROXY=http://you might need a proxy
sulaco msrc 11  fetch -m http://carrera.databits.net/~ksb/dl/2013
sulaco msrc 12  mv 2013 index.html
sulaco msrc 13  sed -ne 's@.*href="\([^"]*[.]t[bg]z\)".*@\1@p' <index.html |
> while read pkg ; do
>	fetch -m http://carrera.databits.net/~ksb/dl/2013/$pkg
> done
Tee-2.16.1.tgz                                100% of   10 kB  155 kBps
curly-3.7.1.tgz                               100% of   12 kB  172 kBps
...

Now that we have the packages cached locally we can build some missing directories then unpack msrc_base and install_base:

sulaco msrc 20  mkdir -p Pkgs local/bin local/sbin local/lib local/libexec
sulaco msrc 21  gzip -dc dl/msrc_base-2.*.tgz  | (cd Pkgs && tar xvf - )
....
msrc_base-2.40/Pkgs/msrc_base/level2s.cf.host
msrc_base-2.40/LICENSE
sulaco msrc 22  mv Pkgs/msrc_base-2.* Pkgs/msrc_base
sulaco msrc 23  gzip -dc dl/install_base-8.*.tgz | (cd Pkgs && tar xvf - )
...
install_base-8.38/lib/install.cf/install.cf
install_base-8.38/lib/install.cf/install.cf.man
sulaco msrc 24  mv Pkgs/install_base-8.* Pkgs/install_base

There are 4 parameters required for the boot-strap build: HOSTTYPE HOSTOS INTO TOP

Now we need to build the locally with the package build recipe. We may set TOP here to relocate the tools out from under /usr/local. And, because it is poor form, we shan't write write on /usr/src/Pkgs to make this happen. We'll put the local shadow copy in /tmp/_src:

sulaco msrc 30  mkdir /tmp/slash /tmp/_src
sulaco msrc 30  cd Pkgs/msrc_base
sulaco msrc 31  su
Password:
# make HOSTTYPE=NETBSD HOSTOS=60100 INTO=/tmp/_src DESTDIR= TOP=/usr/local boot
lots of configure and make output about 
...
install -cs msrc /usr/local/sbin/msrc
rm -f Makefile.bak msrc msrc.c mkdtemp.c setenv.c
# cd ../install_base
# make HOSTTYPE=NETBSD HOSTOS=60100 INTO=/tmp/_src DESTDIR= TOP=/usr/local install
lots of install and compile output
install -c -o root -m 0400 /dev/null /usr/local/lib/op/access.cf
install -cs -m 4711 -o root op /usr/local/bin/op
# exit
sulaco msrc 32  msrc -V
msrc: $Id: msrc.m,v....
...
msrc: default $MSRC_LIB: /usr/local/lib/msrc:/usr/local/lib/hxmd
msrc: temporary directory template: mtfcXXXXXX
sulaco msrc 33  op -S
op: PAM policy: stat: /etc/pam.d/op: No such file or directory
op: no rules configured, are you sure?

ZZZ

At the end of the world

There will still be m4 running someplace, processing files for sendmail and msrc. We might not be there to witness it, but things that work seldom die completely.

$Id: build.html,v 1.6 2013/08/20 20:44:41 ksb Exp $ by  aka KS Braunsdorf, Jan 2013