Commit graph

27 commits

Author SHA1 Message Date
jlam
a1660a8258 Allow platform-specific overrides for creating new users and groups.
There is a default implementation of the shell functions adduser()
and addgroup() used by the +USERGROUP script that uses NetBSD/Solaris-style
useradd(8) and groupadd(8) commands.  A platform may override those
functions by creating pkgsrc/mk/install/usergroupfuncs.${OPSYS}.  This
fixes PR pkg/23061.
2005-09-26 22:12:35 +00:00
rillig
1e0da006f3 Removed trailing white-space. 2005-08-24 22:43:02 +00:00
rillig
c6db2435e8 Fixed a typo and added a comment about when to remove the deprecation
error message about the double-backslash quoting in PKG_USERS.
2005-08-24 12:34:42 +00:00
rillig
6c7647173b This file must not be included by anything other than bsd.pkg.mk.
Enforce this by not writing it in a comment but checking it in the code.
2005-08-23 12:01:52 +00:00
rillig
7a95adad42 The real user name in PKG_USERS does not need to be escaped with double
backslashes anymore. A single backslash is enough. Changed the
definition in all affected packages. For those that are not caught, an
additional check is placed into bsd.pkginstall.mk.
2005-08-23 11:48:47 +00:00
rillig
50dc3acc56 Made the code for the shell file work on Solaris. 2005-08-23 10:00:50 +00:00
rillig
e3b7f76c55 Made the code to create the dirs file work on Solaris. 2005-08-23 09:51:35 +00:00
rillig
abb46cd4fa Made the code for the permissions file work on Solaris. 2005-08-23 09:29:06 +00:00
rillig
5be6707677 Shortened the code for the usergroup file and made it work even on Solaris. 2005-08-23 09:19:06 +00:00
rillig
06363de332 Cleaned up the code that parses the CONF_FILES etc. Now it is possible
again to have users and groups called "__dummy".
2005-08-23 08:58:20 +00:00
rillig
77246172ce Cleaned up the code for creating .install_files. Now only shell
constructs are used that are understood by the Solaris /bin/sh, too.
2005-08-23 08:54:29 +00:00
rillig
6158929acb I forgot to add the trailing slash when stripping ${PREFIX} from pathnames. 2005-08-22 08:07:38 +00:00
rillig
bce7c2b832 ... and corrected a bug I had overseen. I had only tested that the function
works, not that it works in its environment.
2005-08-21 22:29:45 +00:00
rillig
e55825d282 Simplified the strip_prefix function. Tested with /usr/bin/awk on Solaris,
nawk and gawk.
2005-08-21 22:27:09 +00:00
jlam
8463361cf4 Add a guideline for what should be listed in REQD_* variables -- they
should be files or directories under ${PREFIX}.
2005-08-20 02:22:02 +00:00
jlam
66030afca0 Define new variables for package Makefile use:
REQD_FILES, REQD_FILES_PERMS, REQD_FILES_MODE
	REQD_DIRS, REQD_DIRS_PERMS

These are the same as the CONF_* variables, except the files and
directories listed in REQD_* are always copied over, created or removed
(taking into account if there are user modifications from the originals,
etc.) regardless of the value of PKG_CONFIG.

The implementation involved pushing the knowledge of PKG_CONFIG,
PKG_RCD_SCRIPTS, PKG_CREATE_USERGROUP, and PKG_REGISTER_SHELLS into
the individual helper scripts.  The helper scripts are now always
invoked by the +INSTALL and +DEINSTALL scripts.  The +DIRS and +FILES
script have been enhanced to understand a new "f" flag that means
"force" to ignore the value of PKG_CONFIG and PKG_RCD_SCRIPTS.

Lastly, the +FILES script has been taught a new "r" flag just for rc.d
scripts and the +RCD_SCRIPTS script is now unnecessary.
2005-08-19 22:24:09 +00:00
jlam
bd2788d930 Merge CONF_FILES/SUPPORT_FILES and CONF_FILES_PERMS/SUPPORT_FILES_PERMS
as the INSTALL and DEINSTALL scripts no longer distinguish between
the two types of files.  Drop SUPPORT_FILES{,_PERMS} and modify the
packages in pkgsrc accordingly.
2005-08-19 18:12:36 +00:00
jlam
9fd655b06c Rewrite sub-script targets so be less susceptible to "make variable
overflow" by splitting up the huge "one-liner" scriptlets into smaller,
individually executable bits.
2005-08-19 17:20:33 +00:00
rillig
f3eae6da8c Fixed evaluation of the PKG_USERS and PKG_GROUPS variables. Noted by
martii on tech-pkg.
2005-08-05 07:06:47 +00:00
rillig
0c26db2d94 Bugfix for shells that don't allow "for i in ;", that is: an empty list. 2005-08-04 21:37:33 +00:00
rillig
408cdaea69 Some fixes for the Solaris shell. After set -- foo bar; set --; echo $#
outputs 2, but 0 would be expected. That means that the arguments to set
-- must never be empty. I added the necessary checks. I also used
for...done loops instead of set, as they are simpler and don't use
global variables.
2005-08-04 16:54:53 +00:00
rillig
17988cfcbd Replaced the shell substitution ${egfile#${PREFIX}/} with a shell
function that does the same. The Solaris /bin/sh does not know this type
of substitution. Now we could only have problems with /bin/sh which do
not know functions, but as we are using shell functions in many other
places, this should be fine.
2005-08-04 15:03:39 +00:00
jlam
fcf2722f04 When using pkginstall to create INSTALL/DEINSTALL scripts to handle
config files, directories, rc.d scripts, etc., use relative paths as
much as possible to avoid hard-coding the ${PREFIX}-location in which
the files should be installed.  Where full paths are specified, if
the path is within ${PREFIX}, then automatically strip off the ${PREFIX}
part when creating the entries for the helper scripts.  Also, modify
the helper scripts to understand that relative paths should be considered
to be relative to ${PKG_PREFIX}.
2005-07-29 21:41:04 +00:00
jlam
9813468816 * Separate out the shell registration into a separately unpacked script
+SHELL.

* Turn PKG_REGISTER_SHELLS into a variable that can be set in the shell
  environment so that admins can make a choice when installing from
  binary packages.

* PKG_SHELL is now a list of paths, and if the path is relative, then it
  is taken to be relative to ${PREFIX}.  Convert packages that set
  PKG_SHELL to take advantage of this new feature by changing the full
  paths to the shells into relative paths.
2005-07-29 18:32:17 +00:00
jlam
5c44ecc864 Avoid creating unnecessary +* scripts, e.g. if no PKG_USERS or PKG_GROUPS
are specified, then don't create +USERGROUP, etc.
2005-07-27 04:55:43 +00:00
schmonz
d6a2862923 Remove the stanza to create ${RCD_SCRIPTS_EXAMPLEDIR} from the
install-rcd-${_script_} target; it gets created by mtree now.
2005-07-20 02:51:59 +00:00
jlam
962622ba7d Rename mk/bsd.pkg.install.mk to mk/install/bsd.pkginstall.mk to
consolidate the files for that framework in one directory.
2005-05-11 02:07:37 +00:00
Renamed from mk/bsd.pkg.install.mk (Browse further)