summaryrefslogtreecommitdiff
path: root/mk/install
AgeCommit message (Collapse)AuthorFilesLines
2006-06-08If the install cookie file exists, then we don't need to do anything.jlam1-8/+23
Also, move the interactive check into a separate target as a prelude to removing the recursive make for invoking "real-install".
2006-06-071.) Remove all instances of '@${WARNING_MSG} "Warning: ...' which resultedtron1-6/+6
in error message like 'WARNING: Warning: ...'. 2.) Replace "WARN_MSG" with "WARNING_MSG" which makes the "make package" target work again for restricted packages like "acroread7".
2006-06-06Move some variable definitions out of bsd.prefs.mk and back intojlam1-4/+4
bsd.pkg.mk. They didn't actually need to be defined in bsd.prefs.mk, just somewhere before the "main" bsd.<phase>.mk files were included. This moves some conditional (?=) definitions back into bsd.pkg.mk so they won't conflict with any conditional definitions in package Makefiles. This should fix the "checksum" problems in lang/php-gd as noted here: http://mail-index.netbsd.org/pkgsrc-users/2006/06/05/0012.html where EXTRACT_SUFX had the wrong value due to the order in while *.mk files were included.
2006-06-06Remove trailing blank line.jlam1-2/+1
2006-06-05Use PHASE_MSG, STEP_MSG, WARNING_MSG, and ERROR_MSG in place of ECHO_MSGjlam3-18/+18
in various places.
2006-06-05Allow overrides of the public targets, e.g. "install", "package", etc.jlam4-4/+16
if PKG_SKIP_REASON or PKG_FAIL_REASON is defined. This commit adds !target(...) guards around those target definitions to avoid "duplicate target definition" warnings.
2006-06-05Move definitions for UPDATE_TARGET and DEPENDS_TARGET closer to wherejlam1-3/+3
they are used. Also, move UPDATE_RUNNING into the install module where it is used, and make it "private" by prepending with an underscore.
2006-06-03First pass at implementing support for package system flavors otherjlam5-0/+510
than pkgsrc's current one. This is an important lead-up to any project that redesigns the pkg_* tools in that it doesn't tie us to past design (mis)choices. This commit mostly deals with rearranging code, although there was a considerable amount of rewriting done in cases where I thought the code was somewhat messy and was difficult to understand. The design I chose for supporting multiple package system flavors is that the various depends, install, package, etc. modules would define default targets and variables that may be overridden in files from pkgsrc/mk/flavor/${PKG_FLAVOR}. The default targets would do the sensible thing of doing nothing, and pkgsrc infrastructure would rely on the appropriate things to be defined in pkgsrc/mk/flavor to do the real work. The pkgsrc/mk/flavor directory contains subdirectories corresponding to each package system flavor that we support. Currently, I only have "pkg" which represents the current pkgsrc-native package flavor. I've separated out most of the code where we make assumptions about the package system flavor, mostly either because we directly use the pkg_* tools, or we make assumptions about the package meta-data directory, or we directly manipulate the package meta-data files, and placed it into pkgsrc/mk/flavor/pkg. There are several new modules that have been refactored out of bsd.pkg.mk as part of these changes: check, depends, install, package, and update. Each of these modules has been slimmed down by rewriting them to avoid some recursive make calls. I've also religiously documented which targets are "public" and which are "private" so that users won't rely on reaching into pkgsrc innards to call a private target. The "depends" module is a complete overhaul of the way that we handle dependencies. There is now a separate "depends" phase that occurs before the "extract" phase where dependencies are installed. This differs from the old way where dependencies were installed just before extraction occurred. The reduce-depends.mk file is now replaced by a script that is invoked only once during the depends phase and is used to generate a cookie file that holds the full set of reduced dependencies. It is now possible to type "make depends" in a package directory and all missing dependencies will be installed. Future work on this project include: * Resolve the workflow design in anticipation of future work on staged installations where "package" conceptually happens before "install". * Rewrite the buildlink3 framework to not assume the use of the pkgsrc pkg_* tools. * Rewrite the pkginstall framework to provide a standard pkg_* tool to perform the actions, and allowing a purely declarative file per package to describe what actions need to be taken at install or deinstall time. * Implement support for the SVR4 package flavor. This will be proof that the appropriate abstractions are in place to allow using a completely different set of package management tools.
2006-05-21Move mk/install to mk/pkginstall to better reflect the contents (thejlam18-3646/+0
pkginstall framework).
2006-05-21Avoid a difference in shell implementation between IRIX 5.3 and newerjlam1-2/+2
UNIX systems which caused recursive script invocations to not work. Patch from Georg Schwarz in private email.
2006-05-10Fix missing quotes that were causing the group and user existence checksjlam1-3/+3
to break.
2006-05-01Use the meta-data directory as the location for all temporary filesjlam6-90/+111
used by the various scriptlets. Also, consistently use the idiom of creating a temporary directory with mode 700 and creating temporary files underneath that directory to avoid race conditions.
2006-04-29Ensure that @VAR@ placeholders in usergroupfuncs are properly substitutedjlam1-3/+3
for by running it through a separate FILES_SUBST_SED filter. This fixes the case where the user wasn't being created if USERGROUP_PHASE was defined.
2006-04-29Always remove the intermediate files, even if the +USERGROUP scriptjlam1-6/+10
determines the users and/or groups don't exist. This makes "make clean" work properly for non-root users.
2006-04-29Remove the test file in all exit conditions.jlam3-9/+9
2006-04-29Allow for just-in-time su when creating users and groups ifjlam1-5/+13
USERGROUP_PHASE is defined.
2006-04-27Use a better default user comment if none is specified -- if the usernamejlam3-6/+18
matches ${PKGBASE}, then use "${PKGBASE} user", otherwise we use "${PKGBASE} $user user".
2006-04-26Allow a package to specify the ownership and permission onjlam1-3/+15
${PKG_SYSCONFDIR} if PKG_SYSCONFSUBDIR is defined and non-empty. A package may now set PKG_SYSCONFDIR_PERMS to an "owner group mode" triplet, which defaults to "${ROOT_USER} ${ROOT_GROUP} 755".
2006-04-25Rename the test directory to a more suggestive name.jlam2-4/+4
2006-04-25Modify the DIRS line format to match the FILES one, where the modejlam2-29/+42
precedes the user and group.
2006-04-25Use colons as separators instead of slashes on the off-chance that "/"jlam2-27/+27
is used in either the user or group name due to some bizarro set of circumstances.
2006-04-25First try at fixing a deficiency in the package +INSTALL scripts,jlam5-24/+263
where they don't verify that any pre-existing config files and directories have the correct permissions. For example, if you are upgrading a package to a newer version and the config files and directories used by the package need to have different permissions than in previous versions of the package, then the new package may fail to work because it can't access pre-existing files and directories. This commit improves on this by doing the following: (1) Teach the +FILES and +DIRS scriptlets two new actions "PERMS" and "CHECK-PERMS". "PERMS" fixes permissions on existing files and directories. "CHECK-PERMS" will verify those same bits and warn the user when they are wrong. The "CHECK-PERMS" actions for the two scriptlets are run immediately after the "ADD" actions. (2) Add a new variable PKG_CONFIG_PERMS that controls whether the "PERMS" action will automatically fix permissions. PKG_CONFIG_PERMS is only consulted if PKG_CONFIG is "yes". PKG_CONFIG_PERMS can be set in the shell environment when running pkg_add, e.g.: export PKG_CONFIG=yes export PKG_CONFIG_PERMS=yes pkg_add /path/to/binary/package.tgz The default value of PKG_CONFIG_PERMS embedded into the +INSTALL script may also be set in /etc/mk.conf. This value defaults to "no", so that by default, the +INSTALL script will not modify or destroy any existing configuration files or directories. The +INSTALL script will now always warn you if there are files or directories whose permissions differ from what the package is expecting to use, and if PKG_CONFIG_PERMS is set to "yes", then it will go ahead and fix those permissions for you automatically.
2006-04-24Fix typos in comments, noted by Yoshito Komatsu in private email.jlam3-6/+6
2006-04-24Fix {group,user}_exists functions when the numeric ID is not set. Fixjlam3-9/+27
provided in PR pkg/33346 by Yoshito Komatsu.
2006-04-23Add two new capabilities to the pkginstall framework:jlam6-70/+470
(1) Allow specifying the numeric UID and GID for users and groups in /etc/mk.conf by setting PKG_UID.<user> and PKG_GID.<group> to those values. If these values are specified, then the +USERGROUP script will verify that existing users and groups match the requested UIDs and GIDs for the package, and otherwise create them with these UIDs and GIDs. For example: PKG_UID.courier= 10001 PKG_GID.mail= 6 In this example, the courier-authlib binary package will be created to use uid 10001 for the "courier" user and gid 6 for the "mail" group. (2) Allow a package to request that users and groups be created prior to configuring or building a package by setting USERGROUP_PHASE to "configure" or "build". Because the reason for this is typically to hardcode the UIDs and GIDs of requested users and groups directly into the package's executables, these hardcoded values will be automatically determined and put into the +USERGROUP script. For example: USERGROUP_PHASE= configure PKG_GROUPS= qmail nofiles PKG_USERS+= qmaill:nofiles PKG_USERS+= qmailq:qmail In this example, the users and groups are created before the configure phase when building qmail, and the qmail binary package's +INSTALL script will try to create (or verify) users and groups with the same UIDs and GIDs that were used during the build. As part of these changes, the format for PKG_USERS and PKG_GROUPS has changed -- the optional parts of the corresponding entries are no longer used and cannot be specified. Instead, the following variables should be set: PKG_GID.<group> is the group's numeric GID. PKG_UID.<user> is the user's numeric UID. PKG_GECOS.<user> is the user's description. PKG_HOME.<user> is the user's home directory. PKG_SHELL.<user> is the user's login shell. A separate commit will follow which will fix all packages that set PKG_USERS and PKG_GROUPS to use the new syntax and variables.
2006-04-16Now that all info file entries have been pushed from INFO_FILES intojlam1-12/+3
the PLISTs, drop support for listing info files in INFO_FILES. The INFO_FILES variable is now strictly defined/undefined.
2006-04-12Better error-checking in the +INFO_FILES scriptlet:jlam1-34/+46
(1) Don't claim to be adding and removing the info file if it does exist at all. (2) Always try to create and remove the directory containing the "dir" index file to avoid failures.
2006-04-06Resurrect INFO_DIR for another purpose -- if defined, it sets thejlam2-13/+26
directory containing the "dir" file that is updated. This allows packages to install info files in one place but update the dir file in a separate location.
2006-03-20* Creates a new variable PKGINFODIR (named similarly to PKGMANDIR)jlam1-10/+23
that is a purely user-settable variable to represent the relative path under ${PREFIX} where info files are stored and "dir" files are managed. PKGINFODIR defaults to "info". INFO_DIR still works, but will be obsoleted after the 2006Q1 branch. * Modify GNU_CONFIGURE_INFODIR to only honor ${PKGINFODIR} if the package installs directly into ${PREFIX} and not some subdirectory under ${PREFIX}. This fixes packages that don't really honor $(infodir) all that well, and also avoids PLIST problems relating to directory removal for those packages. * Since the majority of Emacs Lisp packages use GNU_CONFIGURE, just set GNU_CONFIGURE_INFODIR directly to ${EMACS_INFOPREFIX}, which is the Emacs-distro-specific location for info files. Also pass EMACS_INFOPREFIX through PLIST_SUBST for PLIST substitution. * INFO_FILES should be defined if the package installs info files. If the info files are not listed in the PLIST, then INFO_FILES must list the filenames for the info files installed by the package, which are assumed to be located in ${PREFIX}/${PKGINFODIR}. * The plist module can now better detect info files listed in PLISTs and exports a command to the pkginstall module to append info file names to the +INFO_FILES scriptlet at install-time. * The print-PLIST target is updated to properly list info files in the auto-generated PLIST. * The check-files code is updated to skip all "dir" Info database files.
2006-03-19Modify the INSTALL script to allow for selective unpacking of a scriptlet.jlam9-26/+31
2006-03-17Ensure that we invoke a brand new make when creating the INSTALL/DEINSTALLjlam1-5/+6
and rc.d scripts so that we source the latest makevars.mk file and get the latest set of cached variables. This fixes problems where BUILDLINK_PREFIX.* wasn't being expanded correctly when substituting into an INSTALL script.
2006-03-15Always run the pkginstall framework targets to generate thejlam1-3/+25
INSTALL/DEINSTALL and rc.d scripts, regardless of whether NO_BUILD is defined or not. We do this by renaming the main "build" target to "_build", and creating a new "build" target that has "_build" and "pkginstall" as dependencies. This allows the "build" and "install" targets to be consecutive, so no changes in behavior are visible to the user. Because the pkginstall targets are no longer run within the protection of the locks during the build phase, we need to manage locking within a new "pkginstall" target.
2006-03-15Rototill of how the various template parts of the INSTALL and DEINSTALLjlam14-261/+283
scripts are generated. The various scriptlets in pkgsrc/mk/install are now full templates that can be combined to form the INSTALL and DEINSTALL scripts. All of the templates have either leading or trailing blank lines so that when they are concatentated, the full INSTALL and DEINSTALL scripts will still be easy to read. All of the generated template sources for the INSTALL and DEINSTALL scripts are now stored in ${WRKDIR}/.pkginstall for local consistency and have been renamed so that they are not dot-files. The "data" for the +* scriptlets are now generated in a separate step and instead of being appended to the unpacked scriptlet are now appended to the INSTALL script itself. When the scriptlets are unpacked, the corresponding data lines for each scriptlet are pulled out of the INSTALL script and put into the unpacked scriptlets. This makes it easy to append more data lines during the install phase without needing to regenerate the INSTALL script.
2006-03-14Sync variable names in comments with recent changes to install framework.tron2-4/+4
2006-03-14Modify the pkginstall framework so that it manages all aspects ofjlam1-103/+113
INSTALL/DEINSTALL script creation within pkgsrc. If an INSTALL or DEINSTALL script is found in the package directory, it is automatically used as a template for the pkginstall-generated scripts. If instead, they should be used simply as the full scripts, then the package Makefile should set INSTALL_SRC or DEINSTALL_SRC explicitly, e.g.: INSTALL_SRC= ${PKGDIR}/INSTALL DEINSTALL_SRC= # emtpy As part of the restructuring of the pkginstall framework internals, we now *always* generate temporary INSTALL or DEINSTALL scripts. By comparing these temporary scripts with minimal INSTALL/DEINSTALL scripts formed from only the base templates, we determine whether or not the INSTALL/DEINSTALL scripts are actually needed by the package (see the generate-install-scripts target in bsd.pkginstall.mk). In addition, more variables in the framework have been made private. The *_EXTRA_TMPL variables have been renamed to *_TEMPLATE, which are more sensible names given the very few exported variables in this framework. The only public variables relating to the templates are: INSTALL_SRC INSTALL_TEMPLATE DEINSTALL_SRC DEINSTALL_TEMPLATE HEADER_TEMPLATE The packages in pkgsrc have been modified to reflect the changes in the pkginstall framework.
2006-03-10Cosmetic change: reorder some lines locally to make it easier for mejlam1-13/+13
to understand.
2006-03-10Expose fewer knobs for a user to tweak by making more variables private.jlam1-57/+53
2006-03-10Don't define DEINSTALL_FILE or INSTALL_FILE if the corresponding *_SRCjlam1-1/+5
variables are empty.
2006-03-09Make it safe to include bsd.pkginstall.mk directly in bsd.pkg.mk, andjlam2-108/+101
drop pkginstall.mk, which did the same thing. Also, rework some of the targets so that we avoid needing to inspect *_MEMBERS variables within make -- we defer the check to the shell code invoked by the targets. All changes are internal and don't affect existing packages in a visible way.
2006-03-09Reimplement the info-file handling so that we use an +INFO_FILESjlam6-41/+172
scriptlet to manage the info-file registration. The new scriptlet's template is install/info-files. Remove obsolete texinfo.mk and install/install-info. No changes to package Makefiles are necessary -- the re-implementation is internal to pkgsrc infrastructure.
2006-03-07For the user or group removal message, don't set they can be removedreed1-3/+3
if no other packages are using them, but if no other "software" is using them. Just in case, they are using a user and/or group without a package using it.
2006-02-17Remove type1inst log file; improve empty dir detection;wiz1-4/+4
needed by fonts/intlfonts, ok@ jlam.
2006-01-11Add back USE_PKGINSTALL as a knob to force the pkginstall frameworkjlam1-5/+15
to be used so that +INSTALL and +DEINSTALL scripts are generated. This can be used in cases where it's not possible or not desirable to use the auto-detection mechanism to decide whether the pkginstall framework is needed.
2006-01-01Remove stuff that was marked for removal after 2005Q4.wiz1-6/+1
2005-12-29Allow avoiding the automatic update of the fonts databases by settingjlam2-2/+20
PKG_UPDATE_FONTS_DB=no in the environment or /etc/mk.conf. This can be beneficial when installing large numbers of fonts packages into the same directories as it avoids destroying and recreating the same database files over and over again. This might make it possible someday to run fc-cache, which is sometimes very time-consuming, from the +FONTS script automatically.
2005-12-29Test that a variable is defined before checking its value. Fix fromjlam1-2/+2
Thomas Klausner.
2005-12-29Teach the pkgsrc infrastructure to Just Know when the pkginstalljlam2-5/+52
framework should be used. This is implemented by creating a small file mk/install/pkginstall.mk that guards the implementation makefile mk/install/bsd.pkginstall.mk. This guard file just checks whether one of the pkginstall-related variables is non-empty, and if so, then the implementation file is automatically included. This completely deprecates USE_PKGINSTALL, which no longer has any affect in pkgsrc.
2005-12-29Re-implement the pkgsrc fonts-handling by integrating it into thejlam4-43/+164
pkginstall framework: * Rewrite the mk/install/fonts script fragment as a scriptlet that's generated by the +INSTALL script during package installation. * Rename the FONTS_<TYPE>_DIRS variables to FONTS_DIRS.<type> to be more consistent with how "families" of variables are currently named in pkgsrc. * Rewrite mk/fonts.mk so that it's implemented in terms of the new functionality in the pkginstall framework. This file will be obsoleted in the near future after packages have been transitioned to use the new functionality in the pkginstall framework. Currently, packages will continue to work with no changes. Integrating the fonts-handling into the pkginstall framework has the benefit of generating a +FONTS scriptlet that may be run independently of the +INSTALL scripts to (idempotently) update the fonts databases and fix package installation errors.
2005-12-05Applied all quoting fixes found by "pkglint --autofix".rillig1-19/+19
2005-11-06Bless FreeBSD with the usergroup functions used by DragonFly.joerg1-0/+58