Commit graph

3950 commits

Author SHA1 Message Date
jlam
1ec8131688 Set PKG_REFCOUNT_DBDIR in the environment for the +INSTALL script, just
like pkg_add(1) does in pkg_install-20050204.
2005-02-05 01:17:59 +00:00
jmmv
ee2419f704 Add tl locale, initially used by glib 2.6.2. 2005-02-04 11:20:39 +00:00
jlam
2ab02f1ddd Bump PKGTOOLS_REQD to 20050204. This version of pkg_install passes
the correct information to the +INSTALL and +DEINSTALL scripts to fix
problems with binary packages incorrectly locating the reference counts
database, e.g. /var/db.refcount.
2005-02-04 09:19:41 +00:00
jlam
9896c47ccf Create a new INSTALL script action "UNPACK" that unpacks all of the
sub-scripts.
2005-02-03 23:29:08 +00:00
jlam
a6f8c45bfc Next round of install script cleanup -- we now create +FILES,
+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-02-02 10:33:01 +00:00
abs
6a63f7037d allow postgresql80 (from wip), similar to java-vm.mk and jdk14 2005-02-01 11:07:31 +00:00
jlam
a767f84684 In the usage message, note that the CHECK-* actions can take an optional
metadatadir argument.
2005-01-31 21:41:06 +00:00
jlam
db02fdf8d8 Note in the usage that CHECK-* take an optional metadatadir argument. 2005-01-31 20:32:58 +00:00
jlam
7ebb4d0225 Add missing "fi". 2005-01-31 19:53:31 +00:00
jlam
d621d74579 Fix automatically adding users and groups after the {GROUP,USER}ADD
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-31 18:41:08 +00:00
jlam
7bb70d34b2 Add RCS Id. 2005-01-31 17:42:20 +00:00
jmmv
da5adc365e Convert the Java related packages to use the alternatives system. To do
this, we only need some simple logic in java-env.mk to automatically
generate an ALTERNATIVES file for us.

There are two exceptions, though: fastjar and jikes (pointed out by tv@),
which do not use this file; they have to be handled manually.

Bump PKGREVISION for all affected packages.

While doing this, remove the java-wrapper package, obsoleted by the new
functionality provided by pkg_alternatives.
2005-01-30 23:18:37 +00:00
jlam
642fa3e0e6 Don't make pkgsrc depend on dc(1) to be present in the system. Since
we already use awk so pervasively in pkgsrc, simply use awk in place
of dc for simple computations.
2005-01-28 21:05:59 +00:00
jlam
0a8bdc04af Avoid hardcoding the refcount database into the INSTALL scripts. We
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-28 19:06:07 +00:00
jlam
8f3180c914 Move the default directory for the reference counts database outside
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-28 18:32:40 +00:00
jlam
39695d15ef Remove entries for GROUPADD and USERADD from header since they're all
handled within the usergroup script.
2005-01-28 18:05:34 +00:00
jlam
fc16f1f48c Pretty-print the users and groups that may need to be removed during
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-28 18:00:28 +00:00
jlam
b474d00694 If PKG_SYSCONFSUBDIR is non-empty, then add ${PKG_SYSCONFDIR} to the
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-28 08:17:53 +00:00
jlam
0d547bd690 Note the end of the install-dirs unpack template within the INSTALL
script.
2005-01-28 07:39:13 +00:00
jlam
f9d620373a Continue with install script cleanup -- we now create a +USERGROUP
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-28 07:37:55 +00:00
jlam
5aa13ad4ee Use reference counts to properly account for the creation and removal
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-28 06:30:58 +00:00
jlam
ce33cd0c70 Move the creation of ${PKG_DB_TMPDIR} to when we create ${WRKDIR}.
This ensures that it's always created with the same user/group/mode
as ${WRKDIR}, so if a non-root user thinks he has permissions to remove
${WRKDIR}, then that expectation will remain true for ${PKG_DB_TMPDIR}.
2005-01-27 18:32:20 +00:00
sketch
b6aec517bc Pass the correct programs to the mkdatabase script. 2005-01-27 17:55:42 +00:00
tv
1d26911a04 Fix handling of PREPEND_PATH in dependency-recursed builds. 2005-01-27 11:21:46 +00:00
tv
974ce33409 Cleanup: wrapper-defs.mk is no longer optional; remove its conditional.
(...and if it were optional, it should have been an .sinclude anyway.)

Sanity: If mk/platform/${OPSYS}.mk is missing, don't assume NetBSD is it.
pkgsrc now depends on a valid platform file for an OS, so require it.
(Still includes NetBSD.mk, but sets PKG_FAIL_REASON.)
2005-01-27 04:16:47 +00:00
tv
bcce274c8b Move the PREPEND_PATH for LOCALBASE/bin (and optionally X11BASE/bin) to a
spot that will come before compiler.mk (in bsd.prefs.mk).  Previously,
LOCALBASE/bin was appearing earlier in the path than work/.<compiler>/bin,
which could cause the Wrong Thing to happen.
2005-01-27 04:05:08 +00:00
jlam
c858a36842 Also substitute for PWD_CMD so we can use it in the INSTALL scripts. 2005-01-26 23:15:03 +00:00
jlam
b09a6d5308 Create a new variable "INSTALL_UNPACK_TMPL" that points to a list of
shell script fragments that unpack sub-scripts before the any of the
other PRE-INSTALL stages are run.
2005-01-26 23:14:12 +00:00
jlam
a2a889c638 Fix so that we preserve /usr/lib/foo.so on the command line. 2005-01-26 05:03:11 +00:00
cube
07b9c2fded Set argmatch=yes when we transform /some/where/libfoo.so into
-L/some/where -lfoo so that the arguments we push on the stack are actually
used in logic.

Should solve the issue build bash with option 'static' enabled reported on
netbsd-users.

OK'd by jlam@.
2005-01-25 23:27:34 +00:00
tv
e2d4e995a8 Relax need to put GNU_CONFIGURE before inclusion of bsd.prefs.mk:
Convert _OPSYS_MAX_CMDLEN to a plain _OPSYS_MAX_CMDLEN_CMD variable, which
is not evaluated by a shell until CONFIGURE_ENV is expanded (and only then
if USE_LIBTOOL+GNU_CONFIGURE are both set).
2005-01-25 18:15:58 +00:00
jmmv
fb5121604f Explicitly use -g to avoid relying on default behavior. 2005-01-25 16:48:53 +00:00
jmmv
e1b9c0a3c2 Redo previous per suggestion from reed@. Do not process the alternatives
until the pkg_alternatives package has been manually installed.  This way
we drop the dependency on that package.
2005-01-25 16:29:16 +00:00
jmmv
b071961bea Make the usage of alternatives optional through the PKG_ALTERNATIVES variable,
which is similar to PKG_CONFIG.  This does not change how the binary packages
are built, only whether the pkg_alternatives command should be run at package
installation/deinstallation time or not.  The variable can take either YES or
NO as values and defaults to YES.
2005-01-25 15:37:25 +00:00
jmmv
f70b9a4716 Add alternatives.mk, a file used to manipulate the alternatives system.
A package can optionally provide an ALTERNATIVES file which contains pairs
of wrapper/alternative, one per line.  The file is then used by the install
and deinstall scripts to register the alternatives and to create the
appropriate wrappers.

Make bsd.pkg.mk include this new file.  This happens unconditionally to
keep all the alternatives logic in an independent file.  Otherwise, some
of the stuff could have to be moved to bsd.pkg.mk, breaking consistency.
2005-01-25 13:13:35 +00:00
grant
857b601b7b only try to run the build if "cd /usr/pkgsrc" is successful. 2005-01-25 08:47:55 +00:00
tv
48c1dc3c38 Add python22, python24 to base addresses list. 2005-01-24 21:47:00 +00:00
tv
443bb330bc Disallow -rdynamic (was being attempted by shells/scsh). 2005-01-24 21:21:45 +00:00
tv
e1c33bd2a4 Merge a little visual-only cleanup from the tv-derecurse branch:
Collect many modifiable hard-to-find variables scattered throughout
bsd.pkg.mk into a common section near the top of the file.  (Not necessarily
"complete", but helps to reduce HEAD-branch divergence.)
2005-01-24 19:57:42 +00:00
tv
3c440a0121 Merge down deferred PREPEND_PATH handling from the tv-derecurse branch.
Also merge in deferred CLASSPATH handling, which can now be moved back
to java-vm.mk for cleanliness.
2005-01-24 19:32:33 +00:00
tv
6a1da4db28 Make CHECK_FILES_SKIP_CMD into a single grep, using a ${var:@foo@bar@} loop. 2005-01-24 18:44:38 +00:00
tv
4284bdc494 Merge down deferred EVAL_PREFIX handling from tv-derecurse branch.
Also move its definition later in bsd.pkg.mk, so that it actually works
for compiler/*.mk (which is why those files originally had to provide
"defaults" for their variables -- they never did get evaluated).
2005-01-24 18:20:57 +00:00
tv
dace9b647e Merge down janitorial change from tv-derecurse branch:
Move definition of PKGSRC_COMPILER to defaults/mk.conf, to make it more
readily seen by the user.
2005-01-24 18:07:56 +00:00
tv
db5bb1ad1d Merge down janitorial change from tv-derecurse branch:
No need to do .som_done dance; just show the message as part of the
pre-extract phase.  If that means showing it more than once if the extract
is interrupted and restarted, no harm done.
2005-01-24 18:04:24 +00:00
jschauma
0c0134061b Per default, only create md5 and sha1 checksums.
(These are available on all platforms via digest(1).)
Set commands for other checksums on a per OPSYS basis.

Set MKSUSM=yes back as the default.
2005-01-24 15:00:48 +00:00
tv
51a7a67d08 Not all OS's have all the checksum tools available to make MKSUMS=yes work.
Default it to "no" instead.
2005-01-24 13:21:13 +00:00
jschauma
d004e03093 Add MKSUMS and SIGN_AS (the former defaulting to yes, the latter commented
out).
2005-01-24 13:08:19 +00:00
xtraeme
2494cf89ca Fix breakage in previous, installed pkg db files should be installed into
${PKG_DB_TMPDIR} not ${_PKG_DB_TMPDIR}, patch from Geoff Wing.
2005-01-24 09:31:06 +00:00
jschauma
bb18a86029 Add bits to allow bulk-builders to generate checksums for the binary
packages they upload (by setting the optional variable MKSUMS=yes) and,
also optionally, PGP signing them (by setting SIGN_AS=username@NetBSD.org,
for example).
2005-01-24 03:41:34 +00:00
jlam
1e0e784ec4 Move the creation of ${PKG_DB_TMPDIR} earlier so that it's created as
the build user instead of the root user.  This should allow "make
clean" as a non-root user to work again.
2005-01-23 22:23:40 +00:00