Commit graph

32 commits

Author SHA1 Message Date
jmmv
f1446ddf2b Drop trailing whitespace. Ok'ed by wiz. 2003-05-06 17:40:18 +00:00
jmmv
62f4d1bb45 Implement a simple framework to handle font databases. It regenerates the
fonts.dir, fonts.scale and Fontmap files (depending on the font type) in
the right directories at (de)install time.  Support included for TrueType,
Type1 and standard X11 fonts.

Reviewed by jlam.
2003-02-16 12:14:31 +00:00
jlam
9aaa6ee3c1 Create directories at pre-install time instead of post-install so that
we can more accurately determine if we "own" a directory.  Ownership is
determined by seeing if the directory doesn't exist before the package is
installed.
2003-01-29 19:47:29 +00:00
jlam
e44ac5236f Don't blindly assume that directores listed in OWN_DIRS* and MAKE_DIRS*
that are outside of ${LOCALBASE} belong to the package that lists them.
If the directory already exists before the package is installed, then
we don't presume ownership of the directory.

This addresses pkg/18383 by Grant Beattie.
2002-11-21 10:11:57 +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
heinz
834e71adf4 Only delete scripts in RCD_SCRIPTS_DIR if PKG_RCD_SCRIPTS is YES
(approved by jlam).
2002-10-17 16:15:14 +00:00
jlam
6502fab273 Recognize ${FIND} and ${XARGS}. 2002-10-08 11:32:34 +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
d940548856 Instead of the incredibly dense _print_* stuff, use a (hopefully) more
readable way of print messages.
2002-10-04 23:35:51 +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
b119dbc8ef Merge pkgsrc/mk from the buildlink2 branch back into the main trunk. 2002-08-22 08:21:26 +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
8aca95c13e Don't bother the admin to create a directory from MAKE_DIRS if it already
exists on the system.  We still make noise about directories in
MAKE_DIRS_PERMS because those directories must have special permissions
that the admin should check, even if they do exist.
2002-06-27 20:46:31 +00:00
jlam
6697300211 Don't bother the admin about the ${PKG_SYSCONFBASE} and ${RCD_SCRIPTS_DIR}
directories if they still exist after we try to remove them.
2002-06-27 20:43:44 +00:00
jlam
ce7c65ef99 Put PKG_SYSCONFBASE and PKG_SYSCONFDIR in the header so that they may be
used in the scripts.
2002-06-27 20:42:15 +00:00
lukem
1217f73ea4 let mk.conf's PKG_CREATE_USERGROUP and PKG_CONFIG take advantage of
the same case insensitive multiple choice that the equivalents from
the environment support
2002-06-24 13:14:41 +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
31fdf27c0c Be more pervasive with previous change. 2002-01-23 15:02:27 +00:00
jlam
1269c18041 When copying config files, if the destination file already exists, then
tell user where the example file is located.  Patch provided by Stoned
Elipot <seb@netbsd.org> in private e-mail.
2002-01-23 15:01:08 +00:00
jlam
5519a9b4a6 bsd.pkg.install.mk lists many things in FILES_SUBST, and we should have
something to replace for each of those things in the header.
2002-01-10 12:05:26 +00:00
seb
1339fe73d0 Fix of commands invoking {USER,GROUP}ADD so that '-{u,g}' and '{user,group}id'
are two distinct shell words.
Reviewed by Johnny C. Lam.
2001-12-04 21:05:06 +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
ad7cbda464 In fit of paranoia after reading about the iTunes installer and given we
now work on Darwin, and then the discussion about allowing spaces in
user/group names, make these scripts work even if the inputs contain
spaces.  Yes, this is overkill, but after doing all of the work, I didn't
want to waste it.
2001-11-26 14:48:53 +00:00
jlam
04f059f6c0 Fix pasto: PKG_GROUP -> PKG_USERID. 2001-11-25 21:16:30 +00:00
jlam
cfd5b704a7 Allow ALL_{DIRS,FILES,MAKE_DIRS} to be appended to by the extra templates
so that the general INSTALL/DEINSTALL scripts can manage these extra files
and directories.
2001-11-25 18:54:57 +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
9875ea4f1d Forgot an EOF in the last commit. 2001-11-21 05:38:03 +00:00
jlam
b74b76b756 Remind the user that some rc.conf settings may need to be removed after
the package has been deleted.
2001-11-20 19:31:58 +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