Commit graph

46 commits

Author SHA1 Message Date
jlam
841b57441b Merge pkgviews-mk branch into the HEAD by running:
cd pkgsrc/mk
	cvs update -Pd -A
	cvs update -Pd -j pkgviews-mk-base -j pkgviews-mk
2003-09-02 06:59:37 +00:00
jlam
d505acc9c8 No longer assume that a DEINSTALL/INSTALL script in the package directory
is meant for {,DE}INSTALL_EXTRA_TMPL.  Package makefiles should explicitly
set those variables if they want to use them in conjunction with
USE_PKGINSTALL.
2003-08-30 22:53:39 +00:00
jlam
8eeebf165b Add for use by the INSTALL/DEINSTALL scripts. 2003-08-30 18:42:36 +00:00
jmmv
38dd4422e2 Let a package override the name of the automatically generated rc.d script
files inside the WRKDIR.  This is done by setting RCD_SCRIPT_WRK.<name> to
the requested filename, like:

	RCD_SCRIPT_WRK.foobar=	${WRKDIR}/foobar.sh

This fixes a problem (rc.d script not beeing generated) when there is a name
conflict in the WRKDIR (i.e., the file already exists or WRKSRC has the same
basename).
2003-07-31 10:36:03 +00:00
jlam
ca8050d834 If a HEADER file exists in the package directory, then assume it's meant
for the HEADER_EXTRA_TMPL variable.
2003-07-30 10:31:20 +00:00
jlam
6a9e4d3fe5 Allow package Makefiles to insert a supplementary header to the
INSTALL/DEINSTALL scripts via HEADER_EXTRA_TMPL, that is meant to contain
variable definitions to be used by the various actions.
2003-07-30 10:27:05 +00:00
jschauma
6695c7df6a Add initial support for IRIX.
Again, anybody's feedback (success or failure) will be appreciated.
2002-12-02 17:07:27 +00:00
salo
1fde293f32 Introduce new framework which unifies registering packages providing login
shells to /etc/shells.

This feature can be disabled by setting PKG_REGISTER_SHELLS to NO in
/etc/mk.conf.

An excerpt from Packages.txt, section 10.28:

 10.28 Packages providing login shells
 =====================================

If the purpose of the package is to provide a login shell, the variable
PKG_SHELL should contain the full pathname of the shell executable installed
by this package. The package Makefile also must include
"../../mk/bsd.pkg.install.mk" prior to the inclusion of bsd.pkg.mk to use the
automatically generated INSTALL/DEINSTALL scripts.

An example taken from shells/zsh:

        PKG_SHELL=      ${PREFIX}/bin/zsh
        .include "../../mk/bsd.pkg.install.mk"

The shell is registered into /etc/shells file automatically in the
post-install target by the INSTALL script generated by bsd.pkg.install.mk and
removed in the deinstall target by the DEINSTALL script.
2002-11-17 08:58:49 +00:00
jlam
416feb0be7 Unless PKG_RCD_SCRIPTS=YES and RCD_SCRIPTS is non-empty, don't create
${RCD_SCRIPTS_DIR} as it's not used at all.
2002-10-23 17:43:16 +00:00
jlam
eb37e4bb5f Only create RCD_SCRIPTS_DIR if RCD_SCRIPTS is defined and non-empty in
the package Makefile.
2002-10-23 01:16:41 +00:00
jlam
980f9a3271 SETUID_ROOT_PERMS is a convenience definition to note an executable is
meant to be setuid-root, and should be used as follows:

	SPECIAL_PERMS+= /path/to/suidroot ${SETUID_ROOT_PERMS}
2002-10-20 18:01:47 +00:00
jlam
8f33914f7c Generate the INSTALL/DEINSTALL scripts at post-build time, and use proper
make dependencies to ensure that the actual scripts are up-to-date if the
sources are changed.
2002-10-20 09:10:42 +00:00
jlam
9ee42664eb Generate the rc.d scripts at post-build time and use proper make
dependencies to deal with changes in the source rc.d script file (this is
possible now that some variables have moved to bsd.prefs.mk from
bsd.pkg.mk).
2002-10-20 04:11:39 +00:00
jlam
ad8e5c1fab Substitute for ${RCD_SCRIPTS_DIR} in MESSAGE files. 2002-10-19 01:33:51 +00:00
jlam
e098523a14 Substitute for ${FIND} and ${XARGS}. 2002-10-08 11:31:24 +00:00
jlam
561ca1b8b7 Add new bsd.pkg.install.mk tunable variable: SPECIAL_PERMS.
SPECIAL_PERMS are lists that look like:
		file user group mode
	At post-install time, file (it may be a directory) is changed to be
	owned by user:group with mode permissions.

SPECIAL_PERMS should be used primarily to change permissions of files or
directories listed in the PLIST.  This may be used to make certain files
set-uid or to change the ownership or a directory.

Packages that install setuid executables should list them in SPECIAL_PERMS
so that the correct user and group will be used for file ownership, even
if the uid/gid changes between the package creation and the package
installation.
2002-10-04 23:46:26 +00:00
jlam
55ef787302 When PKG_DEBUG_LEVEL=2, set_PKG_DEBUG_SCRIPT is set to "${SH} -x". Use
_PKG_DEBUG_SCRIPT when running the INSTALL/DEINSTALL scripts so that they
may be easier to debug.
2002-09-26 21:04:11 +00:00
jlam
3a00d7c948 Don't make ${RCD_SCRIPTS_EXAMPLEDIR} unless it doesn't exist, and if we
do make it, make it with the same permissions as outlined in the *.pkg.dist
files.
2002-09-26 09:59:09 +00:00
grant
3af39f4e3c Add RCD_SCRIPTS_SHELL to automatic rc.d script handling, defaulting to
${SH}. Enables rc.d script portability for non-NetBSD systems.

as discussed with jlam.
2002-09-20 00:45:00 +00:00
jlam
072abe06cf Restore the ability to not automatically install the rc.d script into
/etc/rc.d.  This is controlled by the new variable PKG_RCD_SCRIPTS which
may be set in /etc/mk.conf or in the shell environment in which the
INSTALL script is executed.  PKG_RCD_SCRIPTS only takes effect if
${PKG_CONFIG} == "YES" and defaults to NO.
2002-09-19 10:20:50 +00:00
jlam
26ffd9ecf0 Automatically generate and install the rc.d scripts if specified by
RCD_SCRIPTS.  From the comments in bsd.pkg.install.mk:

# rc.d scripts are automatically generated and installed into the rc.d
# scripts example directory at the post-install step.  The following
# variables are relevent to this process:
#
# RCD_SCRIPTS                   lists the basenames of the rc.d scripts
#
# RCD_SCRIPT_SRC.<script>       the source file for <script>; this will
#                               be run through FILES_SUBST to generate
#                               the rc.d script
#
# RCD_SCRIPTS_EXAMPLEDIR        the directory in which to install the
#                               example rc.d scripts
#
# If the source rc.d script is not present, then the automatic handling
# doesn't occur.
2002-09-19 09:02:40 +00:00
jlam
e507190d0d When using bsd.pkg.install.mk, if a DEINSTALL or INSTALL file already
exists, then use it as the default value of DEINSTALL_EXTRA_TMPL or
INSTALL_EXTRA_TMPL.
2002-09-18 21:15:07 +00:00
jlam
e38613966f Create a new variable "RCD_SCRIPTS_EXAMPLEDIR" that contains the location
of the example rc.d scripts for a package.  This defaults to
${PREFIX}/etc/rc.d, but may be reset for those odd packages, e.g. qmail,
that set LOCALBASE=/.
2002-07-24 20:30:06 +00:00
jlam
87ea621afe Back out revisions 1.21 and 1.22 and
(1) do the work of not being so noisy for /etc and /etc/rc.d in the
	scripts themselves, and

    (2) make PKG_SYSCONFBASE and PKG_SYSCONFDIR usable from within
	the INSTALL/DEINSTALL scripts by putting them in the header.

This preserves the ability for a single binary package to be used for both
PKG_CONFIG=yes or PKG_CONFIG=no.
2002-06-27 20:41:44 +00:00
grant
b3dbf2fad1 pass PKG_SYSCONFDIR when calling {PRE,POST}-INSTALL. 2002-06-27 01:55:21 +00:00
lukem
cd99e0fe84 Only add RCD_SCRIPTS_DIR to MAKE_DIRS if RCD_SCRIPTS isn't empty.
Prevents warning on deinstall "remove /etc/rc.d" if no rc.d scripts
are provided for the package and PKG_CONFIG=no.
2002-06-27 00:54:30 +00:00
jlam
063b3c32e8 Change PKG_CREATE_USERGROUP and PKG_CONFIG so that their values are merely
defaults for the INSTALL/DEINSTALL scripts.  The environment variables of
the same name take precedence during installation of a binary package.
2002-06-22 02:48:35 +00:00
jlam
f28a0a731b In order to solve the following problems:
(1) Admins want to create users/groups on their own (pkg/17183).
    (2) Admins don't want packages to setup an initial configuration.

The bsd.pkg.install.mk-generated INSTALL/DEINSTALL scripts have been
modified to check certain PKG_* environment variables to tune their
behaviour.  This works whether installing from "make install" or from a
binary package.

PKG_CREATE_USERGROUP indicates whether the INSTALL script should
	automatically add any needed users/groups to the system using
	useradd/groupadd.  It is either YES or NO, and defaults to YES.

PKG_CONFIG indicates whether the INSTALL/DEINSTALL scripts should do
	automatic config file and directory handling, or if it should
	merely inform the admin of the list of required files and
	directories needed to use the package.  It is either YES or NO,
	and defaults to YES.

The make(1) variable INSTALL_RCD_SCRIPTS is removed.  The package rc.d
script is now handled like other config files for the package, and is
copied into place if PKG_CONFIG=YES.

The default values above reflect the current behaviour.  Setting
PKG_CREATE_USERGROUP=NO solves problem (1), and setting PKG_CONFIG=NO
solves problem (2).

To simply matters for users installing directly from pkgsrc, these
variables may also be defined in /etc/mk.conf, but behaviour at deinstall
time may be surprising.  It is *HIGHLY* recommended that these values be
set in the shell environment instead.
2002-06-20 20:15:46 +00:00
jlam
387f4cee22 Back out some changes that I didn't intend to commit. 2002-03-18 15:17:55 +00:00
jlam
69df149ae5 Allow INSTALL/DEINSTALL scripts to use ${INSTALL_INFO}. 2002-03-15 20:08:17 +00:00
jlam
b1bdb91416 Also replace for @SETENV@ (/usr/bin/env). 2002-01-22 17:46:52 +00:00
jlam
c11241de17 Include bsd.prefs.mk so that INSTALL_RCD_SCRIPTS may be defined before the
relevant code in this file.
2001-12-26 15:40:32 +00:00
jlam
a1454d57c1 D'oh! I had the logic reversed for the INSTALL_RCD_SCRIPTS check. 2001-12-19 21:32:32 +00:00
jlam
49b5ebd66d Do previous without breaking package Makefiles that use RCD_SCRIPTS and
expect it to contain the list of example rc.d scripts.
2001-12-19 14:54:48 +00:00
jlam
c332d7343e By default, don't install the rc.d scripts into /etc/rc.d. Despite the
fact that they don't do anything unless the appropriate variables are set
in rc.conf, people really dislike the warning emitted at startup.  For
users that do want the pkg_* tools to handle automatically copying and
removing the rc.d scripts, the mk.conf variable to set is
INSTALL_RCD_SCRIPTS=YES.
2001-12-18 19:54:00 +00:00
jlam
78b49b9c42 Substitute for GREP as well. 2001-12-13 06:32:55 +00:00
jlam
6d527d5c53 Substitute for HEAD and GTAR. 2001-12-10 23:02:17 +00:00
jlam
03da0a53d5 Subst. for PERL5 in INSTALL files. 2001-12-09 09:22:29 +00:00
jlam
e1a97d1b32 Support automatically calling the INSTALL script during installation. This
currently only occurs for packages that use bsd.pkg.install.mk.

There are two new targets, pre-install-script and post-install-script, that
default to doing nothing.  The order of targets called for a "make install"
is:
	pre-install-script
	pre-install
	do-install
	post-install
	post-install-script

The new targets are defined in bsd.pkg.install.mk to call the INSTALL
script with the PRE-INSTALL and POST-INSTALL options.
2001-12-02 03:11:35 +00:00
jlam
22d02d6b3e Replace PKG_{USER,GROUP} with PKG_USERS and PKG_GROUPS:
PKG_USERS represents the users to create for the package.  It is a
	space-separated list of elements of the form

		user:group[:[userid][:[descr][:[home][:shell]]]]

	Only the user and group are required; everything else is optional,
	but the colons must be in the right places when specifying optional
	bits.  Note that if the description contains spaces, then spaces
	should be double backslash-escaped, e.g.

		foo:foogrp::The\\ Foomister

PKG_GROUPS represents the groups to create for the package.  It is a
	space-separated list of elements of the form

		group[:groupid]

	Only the group is required; the groupid is optional.

This solves the problem of what to do when there is more than one user or
group needed for a package, e.g. qmail.  Also add a bit more error-checking
to the INSTALL/DEINSTALL scripts.
2001-11-26 20:37:38 +00:00
jlam
ffceca11a9 PKG_SYSCONFDIR is where the configuration files for a package may be found.
This value may be customized in various ways:

PKG_SYSCONFBASE is the main config directory under which all package
	configuration files are to be found.

PKG_SYSCONFSUBDIR is the subdirectory of PKG_SYSCONFBASE under which the
	configuration files for a particular package may be found.

PKG_SYSCONFDIR.${PKGBASE} overrides the value of ${PKG_SYSCONFDIR} for a
	particular package.

Users will typically want to set PKG_SYSCONFBASE to /etc, or accept the
default location of ${PREFIX}/etc.

This obsoletes the use of CONFDIR, which was active for only 6 days, so no
need to have a workaround to still accept old CONFDIR settings.
2001-11-25 18:59:45 +00:00
abs
3bcafcfa14 Add SU to FILES_SUBST 2001-11-23 14:37:24 +00:00
jlam
1b41bcfdb0 Refer to /etc/rc.d as ${RCD_SCRIPTS_DIR} more thoroughly. 2001-11-21 16:10:03 +00:00
jlam
f1b957484f Change the way the RCD_SCRIPTS variable is used. It now just lists the
names of the scripts and is no longer a MLINKS-type variable.  The scripts
are copied into ${RCD_SCRIPTS_DIR} which defaults to /etc/rc.d for now.
It's unclear if Linux/Solaris would set RCD_SCRIPTS_DIR to something else.
2001-11-21 15:43:01 +00:00
jlam
b1d477e863 For completeness, add a SUPPORT_FILES_PERMS that acts like CONF_FILES_PERMS
but the user isn't prompted to customize the files at post-install time.
2001-11-19 23:33:52 +00:00
jlam
c850f81b61 Common INSTALL/DEINSTALL scripts and Makefile magic to automatically perform
many of the tasks that need to be done when package is installed or
deinstalled:

	* creating user/group for the package,

	* creating and removing directories with special permissions and
	  ownership,

	* copying config files to their final locations, and removing them
	  at deinstall time if they don't differ from the example ones,

	* reminding the package admin of files he may want to customize or
	  of files/directories he may want to remove.
2001-11-19 16:18:44 +00:00