Subject: bsd.pkg.mk proposal 2: file control
To: None <tech-pkg@netbsd.org>
From: Todd Vierling <tv@pobox.com>
List: tech-pkg
Date: 05/20/1999 17:45:52
Comments, please.

=====

$Revision: 1.1 $

The package system offers many variables which may be set in packages'
Makefiles to restrict the variousparts of bsd.pkg.mk from working in some
situations.  These are:

    IGNORE
    IS_INTERACTIVE
    MIRROR_DISTFILE
    NO_CDROM
    ONLY_FOR_ARCHS
    NOT_FOR_ARCHS
    ONLY_FOR_OPSYS
    NOT_FOR_OPSYS
    RESTRICTED
    BROKEN
    LICENSE

These variables are used inconsistently throughout pkgsrc.  A new structure
is needed which more specifically spells out the ways in which a package may
be restricted for fetch, use, or redistribution.

I propose the following new layout which completely replaces the variables
above (though some have retained their names).  Listed with each is a list
of package phases which this variable affects.

- [fetch, build, install, package]
  USE_LICENSE: Defines licenses restricting use of the software.  ALL
  keywords in this variable (word per word basis) must be in
  PKG_USE_LICENSES in order for the software to be fetched, compiled,
  installed, or made into a package tarball.

  Exception: When using "make mirror-distfiles", the fetch step will not
  be skipped unless another option from below restricts the fetch.

  This may contain values from the following list:

    no-commercial-use
    personal-use-only

- [package]
  DIST_LICENSE:  Defines licenses restricting distribution of binaries of
  the software.  ALL keywords in this variable (word per word basis) must be
  in PKG_DIST_LICENSES in order for the software to be made into a package
  tarball.

  This may contain values from the following list:

    intl-crypto
    usa-crypto
    non-usa-crypto
    source-dist-required    [i.e. GPL]
    no-cdrom-binaries
    no-public-binaries

- [fetch]
  NO_MIRROR:  When set, contains a list of distfiles that may not be
  mirrored.  If an attempt is made to fetch any of these distfiles when
  executing "make mirror-distfiles", it will be skipped.

  During a normal build, files listed in NO_MIRROR will be deleted from
  the distfiles directory upon "make clean" unless PKG_KEEP_DISTFILES is
  set in either /etc/mk.conf or the environment.  A warning will be issued
  to that effect after fetching if that variable is not set.

- [build, install, package]
  IS_INTERACTIVE:  Defines a text string to be displayed for the following
  conditions:  For extract and later stages, given package will be skipped
  when PKG_BATCH is set in mk.conf or the environment.  If not specified,
  given package will be skipped when PKG_INTERACTIVE is set in the
  environment.

- [build, install, package]
  ONLY_FOR_PLATFORM:  A set of csh style glob strings, in the format
  ${LOWER_OPSYS}-${OPSYS_VER}-${MACHINE_ARCH} (example: "netbsd-1.4*-*").
  When set, the operating system must match one of these patterns in order
  to build the package.

- [build, install, package]
  NOT_FOR_PLATFORM:  Converse of ONLY_FOR_PLATFORM.  Patterns in this
  variable must NOT match the operating system.

-----

- [package]
  IGNORE_PACKAGE:  Defines a text string which prevents binary packaging
  of the package, used when no other category above satisfies the
  requirements.  (May be used to implement the above.)

- [build, install, package]
  IGNORE_BUILD:  Defines a text string which prevents all non-fetch
  operations on the package, used when no other category above satisfies
  the requirements.  (May be used to implement the above.)

- [fetch, build, install, package]
  IGNORE:  Defines a text string which prevents all operations on the
  package, used when no other category above satisfies the requirements.
  (May be used to implement the above.)

=====

-- 
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)