summaryrefslogtreecommitdiff
path: root/mk/bsd.pkg.install.mk
AgeCommit message (Collapse)AuthorFilesLines
2005-02-09Fix Interix user/group failsafe so that it works on PKG_USERS with \\ in them.tv1-4/+4
2005-02-05Set PKG_REFCOUNT_DBDIR in the environment for the +INSTALL script, justjlam1-1/+4
like pkg_add(1) does in pkg_install-20050204.
2005-02-03Create a new INSTALL script action "UNPACK" that unpacks all of thejlam1-6/+6
sub-scripts.
2005-02-02Next round of install script cleanup -- we now create +FILES,jlam1-12/+108
+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-28Avoid hardcoding the refcount database into the INSTALL scripts. Wejlam1-9/+1
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-28Move the default directory for the reference counts database outsidejlam1-4/+5
of ${PKG_DBDIR} to avoid problems with the package tools thinking that it is a bad package. The default directory is ${PKG_DBDIR} with ".refcount" appended to the name. This may be set explicitly through PKG_REFCOUNT_DBDIR in /etc/mk.conf (bootstrap users may want to do this, although the default value should do the right thing).
2005-01-28If PKG_SYSCONFSUBDIR is non-empty, then add ${PKG_SYSCONFDIR} to thejlam1-2/+2
list of +DIRS-maintained directories. This allows for a package to specify where its config files should go and creates the directory automatically, even if it doesn't have any example config files to put in place.
2005-01-28Note the end of the install-dirs unpack template within the INSTALLjlam1-1/+3
script.
2005-01-28Continue with install script cleanup -- we now create a +USERGROUPjlam1-4/+37
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 removaljlam1-5/+62
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-26Also substitute for PWD_CMD so we can use it in the INSTALL scripts.jlam1-1/+2
2005-01-26Create a new variable "INSTALL_UNPACK_TMPL" that points to a list ofjlam1-1/+3
shell script fragments that unpack sub-scripts before the any of the other PRE-INSTALL stages are run.
2005-01-23Rework the way that packages are registered during a "make install". Wejlam1-5/+9
split the fake-pkg target into three smaller pieces: pre-install-fake-pkg - Create files in ${WRKSRC}/.pkgdb meant to be installed into ${PKG_DBDIR}/${PKGNAME} that don't depend on the installed files. post-install-fake-pkg - Create files in ${WRKSRC}/.pkgdb meant to be installed into ${PKG_DBDIR}/${PKGNAME} that may depend on the installed files. register-pkg - Copy the files in ${WRKSRC}/.pkgdb and create a few additional meta-files in ${PKG_DBDIR}/${PKGNAME}. The idea is that ${WRKSRC}/.pkgdb contains as much of the state as possible that will be copied into ${PKG_DBDIR}/${PKGNAME}. The INSTALL and DEINSTALL scripts generated by bsd.pkg.install.mk are now invoked with ${WRKSRC}/.pkgdb as the working directory, so the scripts may use the working directory to store temporary files, regardless of whether they're invoked from bsd.pkg.mk or by pkg_add.
2005-01-15- Move all CHECK_FILES_SKIP definitions to a central place in bsd.pkg.mk.jmmv1-21/+1
- Move the previous block of code down in the file so that all used variables are defined (specially PKG_SYSCONFDIR). Fixes a problem noticed by kristerw@'s bulk build in comms/minicom. - Ignore diff's return code, which aborts make in NetBSD 1.6.2. Also noticed by kristerw@'s bulk build. - Use full paths to do the checks, instead of relative to ${PREFIX}. Less ambiguity. Matches should be turned into regular expressions that anchor to a whole line (tried that, but found some problems). - Turn CHECK_FILES to NO by default. As said in the previous point, there are still some problems that have to be fixed and minor improvements to be done. And I have no time to fix this ATM. Yes, this definitely needs more testing. I'm sorry for all the noise. (But hey! you should set and try this feature locally! ;-)
2005-01-14Automatically add any of the {CONF,SUPPORT}_FILES and {MAKE,OWN}_DIRS stuffjmmv1-1/+21
to CHECK_FILES_SKIP to avoid some false positives. These directories are created in the pre-install stage so are included in the generated file list. The files are also added to silence some problems that may arise during "make replace". Found by wiz@ in the gtk2 package.
2004-12-28The default location of the pkgsrc-installed rc.d scripts is nowreed1-2/+3
under share/examples/rc.d. The variable name already was named RCD_SCRIPTS_EXAMPLEDIR. This is from ideas from Greg Woods and others. Also bumped PKGREVISION for all packages using RCD_SCRIPTS mechanism (as requested by wiz).
2004-12-27Remove USERADD and GROUPADD definitions from OSes where the useraddjlam1-6/+3
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 toreed1-12/+18
${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-10-11Add RCD_SCRIPTS_EXAMPLEDIR to the MESSAGE_SUBST. www/tinyproxy's MESSAGEreed1-1/+2
used it but it was not defined. Other MESSAGE files use it too.
2004-10-06Reorganize some of the files under pkgsrc/mk:jlam1-2/+2
(1) defs.${OPSYS}.mk --> platform/${OPSYS}.mk. The "platform" subdirectory is where all of the ${OPSYS}-specific infrastructure logic should reside. (2) bsd.pkg.defaults.mk --> defaults/mk.conf bsd.pkg.obsolete.mk --> defaults/obsolete.mk Renaming bsd.pkg.defaults.mk to defaults/mk.conf is to mimic the way that NetBSD has /etc/rc.conf as well as /etc/defaults/rc.conf, where the latter is a full list of user-settable variables, and the two files share the same name to reinforce the fact /etc/defaults/rc.conf can be directly copied in place as /etc/rc.conf. This is the same relationship shared by defaults/mk.conf and /etc/mk.conf.
2004-07-10Be explicit about the fact that USE_PKGINSTALL has to be set to YESwiz1-2/+2
for this Makefile fragment to get included. XXX: This should be documented in Packages.txt, not here.
2004-07-08Replace VARBASE in INSTALL/DEINSTALL scripts and in rc.d scripts.reed1-1/+2
2004-04-27Add ECHO_N to the list of substituted variables in [DE]INSTALL.tv1-1/+2
2004-04-27Indent properly.agc1-5/+5
2004-04-27Add Interix hack: if user and group are the same name, trip up with atv1-1/+15
BROKEN message telling the user that they must be different.
2004-04-27It's USE_GROUPADD, not USE_USERGROUP.tv1-2/+2
2004-04-23mk/bsd.pkg.install.mk now automatically registersreed1-1/+3
the RCD_SCRIPTS rc.d script(s) to the PLIST. This GENERATE_PLIST idea is part of Greg A. Woods' PR #22954. This helps when the RC_SCRIPTS are installed to a different ${RCD_SCRIPTS_EXAMPLEDIR}. (Later, the default RCD_SCRIPTS_EXAMPLEDIR will be changed to be more clear that they are the examples.) These patches also remove the etc/rc.d/ scripts from PLISTs (of packages that use RCD_SCRIPTS). (This also removes now unused references from openssh* makefiles. Note that qmail package has not been changed yet.) I have been doing automatic PLIST registration for RC_SCRIPTS for over a year. Not all of these packages have been tested, but many have been tested and used. Somethings maybe to do: - a few packages still manually install the rc.d scripts to hard-coded etc/rc.d. These need to be fixed. - maybe remove from mk/${OPSYS}.pkg.dist mtree specifications too.
2004-01-12Sync comment with reality: tell about USE_PKGINSTALL and discourage directsalo1-4/+4
inclusion of this file. Suggested bu cjep.
2003-12-20Define LS in install scripts (needed by install/fonts).jmmv1-1/+2
2003-11-23In the overwrite package case:jlam1-1/+5
* 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-09-17Introduce a new variable "CONF_DEPENDS" for pkgviews: a package'sjlam1-1/+5
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-12Make adding config files to views other than the default view work ifjlam1-2/+2
PKG_SYSCONFBASE points outside of ${PREFIX}.
2003-09-06Move RCD_SCRIPTS_DIR definition to bsd.pkg.defaults.mk. This implies thatjlam1-2/+1
RCD_SCRIPTS_DIR is user-settable in /etc/mk.conf.
2003-09-06Install the rcd scripts at post-install time, not at post-install-scriptjlam1-2/+3
time. The rc.d script needs to be recorded in the PLIST, and post-install-script time is too late if we use dynamic PLISTs.
2003-09-06Add .PHONY targets for Makefile correctness.jlam1-1/+7
2003-09-05Package Makefiles should refer to PKG_SYSCONFBASEDIR instead ofjlam1-6/+4
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.
2003-09-02Merge pkgviews-mk branch into the HEAD by running:jlam1-2/+6
cd pkgsrc/mk cvs update -Pd -A cvs update -Pd -j pkgviews-mk-base -j pkgviews-mk
2003-08-30No longer assume that a DEINSTALL/INSTALL script in the package directoryjlam1-9/+1
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-30Add for use by the INSTALL/DEINSTALL scripts.jlam1-1/+2
2003-07-31Let a package override the name of the automatically generated rc.d scriptjmmv1-7/+8
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-30If a HEADER file exists in the package directory, then assume it's meantjlam1-1/+5
for the HEADER_EXTRA_TMPL variable.
2003-07-30Allow package Makefiles to insert a supplementary header to thejlam1-1/+4
INSTALL/DEINSTALL scripts via HEADER_EXTRA_TMPL, that is meant to contain variable definitions to be used by the various actions.
2002-12-02Add initial support for IRIX.jschauma1-3/+3
Again, anybody's feedback (success or failure) will be appreciated.
2002-11-17Introduce new framework which unifies registering packages providing loginsalo1-1/+12
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-10-23Unless PKG_RCD_SCRIPTS=YES and RCD_SCRIPTS is non-empty, don't createjlam1-6/+3
${RCD_SCRIPTS_DIR} as it's not used at all.
2002-10-23Only create RCD_SCRIPTS_DIR if RCD_SCRIPTS is defined and non-empty injlam1-1/+3
the package Makefile.
2002-10-20SETUID_ROOT_PERMS is a convenience definition to note an executable isjlam1-1/+7
meant to be setuid-root, and should be used as follows: SPECIAL_PERMS+= /path/to/suidroot ${SETUID_ROOT_PERMS}
2002-10-20Generate the INSTALL/DEINSTALL scripts at post-build time, and use properjlam1-8/+19
make dependencies to ensure that the actual scripts are up-to-date if the sources are changed.
2002-10-20Generate the rc.d scripts at post-build time and use proper makejlam1-12/+12
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-19Substitute for ${RCD_SCRIPTS_DIR} in MESSAGE files.jlam1-1/+2