Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
like pkg_add(1) does in pkg_install-20050204.
|
|
sub-scripts.
|
|
+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.
|
|
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.
|
|
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).
|
|
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.
|
|
script.
|
|
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".
|
|
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).
|
|
|
|
shell script fragments that unpack sub-scripts before the any of the
other PRE-INSTALL stages are run.
|
|
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.
|
|
- 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! ;-)
|
|
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.
|
|
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).
|
|
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.
|
|
${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.
|
|
used it but it was not defined. Other MESSAGE files use it too.
|
|
(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.
|
|
for this Makefile fragment to get included.
XXX: This should be documented in Packages.txt, not here.
|
|
|
|
|
|
|
|
BROKEN message telling the user that they must be different.
|
|
|
|
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.
|
|
inclusion of this file.
Suggested bu cjep.
|
|
|
|
* 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.
|
|
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.
|
|
PKG_SYSCONFBASE points outside of ${PREFIX}.
|
|
RCD_SCRIPTS_DIR is user-settable in /etc/mk.conf.
|
|
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.
|
|
|
|
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.
|
|
cd pkgsrc/mk
cvs update -Pd -A
cvs update -Pd -j pkgviews-mk-base -j pkgviews-mk
|
|
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.
|
|
|
|
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).
|
|
for the HEADER_EXTRA_TMPL variable.
|
|
INSTALL/DEINSTALL scripts via HEADER_EXTRA_TMPL, that is meant to contain
variable definitions to be used by the various actions.
|
|
Again, anybody's feedback (success or failure) will be appreciated.
|
|
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.
|
|
${RCD_SCRIPTS_DIR} as it's not used at all.
|
|
the package Makefile.
|
|
meant to be setuid-root, and should be used as follows:
SPECIAL_PERMS+= /path/to/suidroot ${SETUID_ROOT_PERMS}
|
|
make dependencies to ensure that the actual scripts are up-to-date if the
sources are changed.
|
|
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).
|
|
|