Initial work in merging bits of the pkgviews branch into modern pkgsrc.
Currently, the pkgviews/buildlink2 integration is incomplete.  People who
work on this branch should also check out src/usr.sbin/pkg_install from
the pkgviews branch.
Shell registration should really be per-view, not per-package, because
a package can be installed but not in any view, and in that case, we don't
want it to be used as a login shell.
Sync with HEAD.
Restore pkgviews-mk branch modifications to pkgsrc/mk after botched sync to
HEAD (time to script the command sequence...).
Generate the PLIST after {pre,do,post}-install targets but before the
post-install-script target.  This allows us to avoid adding the real config
files and rc.d scripts to the dynamically generated PLIST, and has no
effect for non-depoted packages.
VIEW-{INSTALL,DEINSTALL} is handled by pkg_delete(1)/pkg_view(1), so remove
that section from the problems commentary.  Also add a new section
detailing proposed plan to deal with config files.
Teach the bsd.pkg.install.mk framework about the VIEW-INSTALL and
VIEW-DEINSTALL actions.  Info file handling and shell registration now
occur at VIEW-{INSTALL,DEINSTALL} time.  Config file handling continues to
be done at POST-INSTALL and at DEINSTALL time.

For non-depoted packages (packages that have PKG_INSTALLATION_TYPE set to
"overwrite"), the DEINSTALL action is automatically preceded by the
VIEW-DEINSTALL action, and the POST-INSTALL action is automatically
succeeded by the VIEW-INSTALL action.  This allows the new scripts to work
with "overwrite" packages.
Always create an empty +VIEWS file for depoted packages.  Require version
20030725 of the pkg_install tools since we need a pkg_create(1) that
understands "-E".
Factor out the code that adds the package into the null view into a
separate "su" target "build-views".  This allows doing "make build-views"
instead of the more complicated pkg_view(1) invocation to add a package
into the null view.
Skip adding scratch files to the dynamic PLIST.
Call fake-pkg target with correct PKG_DBDIR settings in the "overwrite"
case so that "make install" in a "overwrite" package will still write the
metadata into the correct dbdir.
Add "*,v" (RCS revision files) to the list of scratch files to skip;
suggested by Alistair Crooks.
In the pkgviews world, all directories under ${PKG_PREFIX} belong to the
package, so we don't need to do the reference-counting for empty
directories used by a package.
Require at least 20030728 for pkg_create(1) fixes.
Config file handling in the pkgviews world is that each package
installed on the system has a unique config file directory by default,
and that the config files are symlinked into view-friendly places
during the VIEW-INSTALL step.  There are three cases:

(1) If PKG_SYSCONFBASE points to somewhere under PREFIX, then we don't
    have to do anything, as everything (except for scratch files:
    *[~#], *.OLD, *.orig, *,v) in PREFIX is symlinked into the view
    automatically when the package is added to the view using
    pkg_view(1).

(2) If PKG_SYSCONFBASE points outside of PREFIX, then we construct a
    PKG_SYSCONFDIR as:

	${PKG_SYSCONFBASE}/${DEPOT_SUBDIR}/${PKGNAME}

    This mirrors the directory layout in ${LOCALBASE}/${X11BASE} for
    depoted packages.  Then during VIEW-INSTALL time, we "add" a view
    to the package config files by using linkfarm(1) to symlink
    everything (again, except for scratch files) from PKG_SYSCONFDIR
    into PKG_SYSCONFBASE.

(3) If PKG_SYSCONFDIR.${PKG_SYSCONFVAR} is set, then we don't do any
    view-friendly symlinking.

Case (1) is the default.  Case (2) handles the NFS-shared /usr/pkg
case where config files really shouldn't be shared, and the usual
setting of PKG_SYSCONFBASE=/etc in /etc/mk.conf should do the right
thing.  Case (3) tries to avoid being overly smart and possibly
messing up when the package builder does something special for the
package.
The config file handling for multiple versions of packages is mostly done.
Just step (4), modifying pkg_delete(1) to not just "rm -rf ...", to go.
Correctly handle the removal of config file symlinks from the view when a
package is removed from the view in the default (PKG_SYSCONFDIR in PREFIX)
case.

Also, fix the PKG_SYSCONFDIR setting for packages that aren't converted to
use pkgviews so that if the user sets PKG_SYSCONFBASE, then the existing
behaviour for these "overwrite" packages is preserved.
Do the info/dir file manipulation in the depot directory too.  This makes
the depoted package a bit more standalone.
Done with INSTALL/DEINSTALL mods to handle adding and removing packages
from views, and with pkg_delete(1) mods to correctly remove depoted
packages with modified config files.
Add quick note to self about issues with pkgviews and buildlink2.