summaryrefslogtreecommitdiff
path: root/mk/install
AgeCommit message (Collapse)AuthorFilesLines
2005-07-29When using pkginstall to create INSTALL/DEINSTALL scripts to handlejlam4-27/+83
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* Separate out the shell registration into a separately unpacked scriptjlam5-30/+259
+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-27Rewrite scripts to be more resilient to shells that exit immediatelyjlam5-40/+40
if an untested command fails (see sh(1), "-e errexit"). Do this by changing lines that look like: test expression && command to test ! expression || command so that the statement list always returns 0. Also, back out revision 1.38 of pkgsrc/mk/install/install and modify the if-test to branch correctly if +USERGROUP doesn't exist.
2005-07-27Rewrite the code handling user and group creation so it will not fail iftron1-9/+9
no user or group needs to be created. This fixes PR pkg/30849 by myself.
2005-07-27Avoid creating unnecessary +* scripts, e.g. if no PKG_USERS or PKG_GROUPSjlam1-11/+21
are specified, then don't create +USERGROUP, etc.
2005-07-20Remove the stanza to create ${RCD_SCRIPTS_EXAMPLEDIR} from theschmonz1-6/+1
install-rcd-${_script_} target; it gets created by mtree now.
2005-05-11Rename mk/bsd.pkg.install.mk to mk/install/bsd.pkginstall.mk tojlam1-0/+567
consolidate the files for that framework in one directory.
2005-04-20Execute chmod(1) after chown(1)/chgrp(1) so NetBSD's chown(2) doesseb2-10/+10
not reset any set-user-id or set-group-id bits we may want to set. Approved by jlam@.
2005-04-10Fix typo.jmmv1-2/+2
2005-03-28Fix user_exists and group_exists to actually use their argumentsjlam1-18/+20
instead of using the values stored in global variables. Also, consistently prepend variables that should be local to functions with an underscore.
2005-03-21Add -*- sh -*- comment at top of file; from PR 22947.wiz2-2/+4
2005-02-14Fix typo in previous (should have ended the line with &&).tv1-2/+2
2005-02-14Remove "test ... -ef ...", which is unportable. Currently this is causingtv1-2/+1
syntax errors (and unchanged example files to be left behind) on Interix; it probably causes a problem on others. (This test appears to work around a case where two files were exactly the same by inode, and have the script *not* delete the file in that case. I'm not exactly sure why that is desirable at all.)
2005-02-02Next round of install script cleanup -- we now create +FILES,jlam5-337/+425
+RCD_SCRIPTS, and +PERMS subscripts to handle copying config files and rc.d scripts, and setting special permissions on files. The +FILES and +RCD_SCRIPTS are basically identical except for different embedded packets of data, and they feature reference-counting for the files in case multiple packages share the same config file. Garbage-collect unused functions and definitions in the install scripts now that the subscripts are self-contained.
2005-01-31In the usage message, note that the CHECK-* actions can take an optionaljlam2-4/+4
metadatadir argument.
2005-01-31Note in the usage that CHECK-* take an optional metadatadir argument.jlam1-2/+2
2005-01-31Add missing "fi".jlam1-1/+2
2005-01-31Fix automatically adding users and groups after the {GROUP,USER}ADDjlam2-11/+13
definitions were removed from mk/install/headers. The checks for whether {GROUP,USER}ADD are defined are now moved to the usergroup script.
2005-01-31Add RCS Id.jlam2-0/+4
2005-01-28Avoid hardcoding the refcount database into the INSTALL scripts. Wejlam2-4/+5
now simply make ${PKG_REFCOUNT_DBDIR} always be ${PKG_DBDIR}.refcount so that it always follows the location of ${PKG_DBDIR}. This preserves the ability for PKG_DBDIR (and PKG_REFCOUNT_DBDIR) to be different on different machines despite using the same binary packages.
2005-01-28Remove entries for GROUPADD and USERADD from header since they're alljlam1-3/+1
handled within the usergroup script.
2005-01-28Pretty-print the users and groups that may need to be removed duringjlam1-24/+41
CHECK-REMOVE. The users and groups are now printed on the same line with whitespace separating the entries (for easy copy-and-pasting info commands), and wrapping to successive lines if we overflow the length of the current line.
2005-01-28Continue with install script cleanup -- we now create a +USERGROUPjlam4-149/+382
script that is unpacked by the +INSTALL script at PRE-INSTALL time before any other actions take place, and invoke +USERGROUP to create any necessary users and groups. Remove the now-unused code for PKG_USERS and PKG_GROUPS from the install and deinstall templates. We also reference count the users and groups and store the reference counts in ${PKG_DBDIR}/.refcount/{users,groups}. This allows multiple packages to register that they use same users and groups, and allows +USERGROUP to be invoked at any time to repair an installed package. Also fix the install and deinstall templates to invoke the CHECK-* actions with ${PKG_METADATA_DIR} so that the correct PKGNAME can be derived. This fixes the weird messages asking the user to create directories for ".pkgdb" during a "make install".
2005-01-28Use reference counts to properly account for the creation and removaljlam4-192/+220
of directories needed for the proper functioning of each package. The +INSTALL script unpacks a +DIRS script that adds and removes directories. The +DIRS script entirely encapsulates the directory creation and removal, and completely replaces the code in the mk/install/install and mk/install/deinstall templates that handled {MAKE,OWN}_DIRS and {MAKE,OWN}_DIRS_PERMS. The +DIRS script is meant to be executed from within the package meta-data directory, e.g. /var/db/pkg/<pkgname>. It's usage is: ./+DIRS ADD|REMOVE|CHECK-ADD|CHECK-REMOVE The ADD and REMOVE actions cause the necessary directories to be added or removed from the system. The CHECK-ADD and CHECK-REMOVE actions print out informative messages prompting the user to either create or remove some necessary directories. The behaviour of "ADD" is such that if the directory already exists on the system and is not already ref-counted, then that directory is marked as "pre-existing". On "REMOVE", pre-existing directories are left untouched on the filesystem. At any time, the root user can sanity-check the directories needed by packages by invoking all of the +DIRS scripts with the "CHECK-ADD" action. If there are missing directories, then invoking all of the +DIRS scripts with the "ADD" action will ensure that any missing directories are created. The reference counts database is stored in ${PKG_DBDIR}/.refcount. The reference counts related to directories managed by the +DIRS script are stored in ${PKG_DBDIR}/.refcount/dirs. If the directory reference counts database is removed, then invoking all of the +DIRS scripts with the "ADD" action will reconstruct the database; however, directories may be marked as being pre-existing, so they won't be removed at package de-installation (although a message will be displayed informing the user that those directories can be removed).
2005-01-06If we fail the user/group existence test, then don't proceed to thejlam1-1/+10
directory creation, which often need to create directories owned by a particular user.
2004-12-28Fix ttf/type1 handling in fonts.mk:wiz1-3/+3
Previously, ttmkfdir's output was redirected to fonts.dir, while the correct behaviour is to let it create fonts.scale and then let mkfontdir merge fonts.scale into fonts.dir. type1 handling had a similar problem. Get the wanted behaviour by automatically appending the contents of FONTS_TTF_DIRS and FONTS_TYPE1_DIRS to FONTS_X11_DIRS. Also, save a subshell in install/fonts while there. Bump PKGREVISION for all affected packages. jmmv@ says ok.
2004-12-27Remove USERADD and GROUPADD definitions from OSes where the useraddjlam1-1/+4
and groupadd commands won't follow the calling conventions of the NetBSD useradd/groupadd. Modify the INSTALL scripts to *never* create users or groups if there is no available ${USERADD} or ${GROUPADD} command, but will warn the user of users and groups that need to be created before the package can be installed.
2004-10-11Make it so RCD_SCRIPTS_EXAMPLEDIR is a directory relative toreed2-4/+4
${PREFIX}. It is not an absolute path because with the automatic addition of the entry to the PLIST would be bogus if someone defined it to some RCD_SCRIPTS_EXAMPLEDIR outside of PREFIX. (This may cause multiple rc.d directories if there are multiple PREFIXes, but I think that is fine.) Note that at this time, this doesn't change the RCD_SCRIPTS_EXAMPLEDIR default directory. This will change soon. Most of this has been in use for over a year. Also some of this is from Greg Woods. Thank you Greg. I will next update a few other references to RCD_SCRIPTS_EXAMPLEDIR.
2004-07-10Replace test -e with -d and -f respectively.salo2-13/+13
Fixes part of PR pkg/26235 by Georg Schwarz.
2004-04-27Add ECHO_N to the list of substituted variables in [DE]INSTALL.tv1-1/+2
2004-04-12Fix typo in deinstall message (many->may)chris1-2/+2
2004-04-07Elide use of "echo -n" in a platform-independent manner.tv1-7/+7
2004-03-30Generate fonts.dir correctly with the ttmkfdir2.recht1-2/+2
From PR 24968 by Jukka Salmi.
2004-02-15Set CONF_FILES_MODE from @CONF_FILES_MODE@.lukem1-1/+2
2004-01-08fix minor formatting funny in lastgrant1-3/+2
2003-12-21tweak a message and some formatting.grant1-14/+16
2003-12-20Handle removal of fonts databases properly if the package is usingjmmv1-4/+4
{MAKE,OWN}_DIRS (i.e., the .pkgsrc file exists in them).
2003-12-20Define LS in install scripts (needed by install/fonts).jmmv1-1/+2
2003-12-19Handle font (de)installation before bsd.pkg.install.mk handles OWN_DIRS.jmmv1-4/+1
This way font directories are not automatically removed; the package must define OWN_DIRS if it wants them to be deleted during deinstallation. This is done to avoid removal of standard font directories (those that appear in *.dist files).
2003-12-19Use ${CD}, ${GREP}, ${RM} and ${RMDIR} instead of directly calling commands.jmmv1-10/+10
2003-11-23In the overwrite package case:jlam4-11/+38
* Ensure that VIEW-INSTALL is called after _all_ POST-INSTALL actions (including any in the INSTALL_EXTRA_TMPL file) by moving the call to a file that is included after all other INSTALL templates. * Ensure that VIEW-DEINSTALL is called before _all_ DEINSTALL actions (including any in the DEINSTALL_EXTRA_TMPL file) by moving the call to a file that is included before all other DEINSTALL templates.
2003-11-23Add some whitespace.jlam1-1/+2
2003-11-21Back out part of rev. 1.20: rc.d scripts aren't really view files.jlam1-2/+1
2003-11-21Back out part of rev. 1.24: we don't need to add config files to the viewjlam1-4/+6
if only rc.d scripts are present. rc.d scripts always live in ${PREFIX} regardless of the setting for ${PKG_SYSCONFBASE}.
2003-09-27Add CVS signature. Noted by reed@.seb1-1/+1
2003-09-18fix regex when updating /etc/shells so that eg. "/bin/tcsh" doesn'tgrant2-4/+4
mistakenly cause the removal of eg. "/usr/pkg/bin/tcsh". PKG_SHELL should be an absolute path, anyway.
2003-09-17Introduce a new variable "CONF_DEPENDS" for pkgviews: a package'sjlam3-12/+46
config directory matches the config directory for the dependency listed in CONF_DEPENDS. Use symlinks to physically point the package's config directory to the dependency's config directory, and handle all of this in the INSTALL/DEINSTALL scripts. Also make the INSTALL/DEINSTALL scripts a bit smarter about not copying files and not removing files if the source and destination file locations point to the same thing.
2003-09-13Add the config files to the view also when there are rc.d scripts present.jlam3-6/+13
Ignore any .pkgsrc files as those aren't meaningful for views.
2003-09-12Make adding config files to views other than the default view work ifjlam3-10/+20
PKG_SYSCONFBASE points outside of ${PREFIX}.
2003-09-05Package Makefiles should refer to PKG_SYSCONFBASEDIR instead ofjlam3-18/+22
PKG_SYSCONFBASE when they want PKG_SYSCONFDIR stripped of PKG_SYSCONFSUBDIR. This makes PKG_SYSCONFBASE=/etc work with pkgviews by installing all config files into /etc/packages/<pkg> instead of occasionally putting some directly into /etc. Also only create PKG_SYSCONFDIR if we're actually going to copy config files.