Commit graph

51 commits

Author SHA1 Message Date
obache
a73dc64b7e Honor PKGLOCALEDIR for AUTO_MKDIRS. 2008-06-11 07:30:33 +00:00
rillig
4290fb40eb Added compatibility code for INSTALLATION_DIRS_FROM_PLIST. I had
intended that all the time, but didn't test enough. :(

Thanks to wiz for catching this one.
2007-12-10 22:49:19 +00:00
rillig
a2f9aae352 Added AUTO_MKDIRS as an alias for INSTALLATION_DIRS_FROM_PLIST. The
variable is much more comfortable than specifying all the directories in
INSTALLATION_DIRS that using such a long name for it feels like a
punishment. It also doesn't look nice in the package Makefiles, for
example:

old:
INSTALLATION_DIRS=	bin ${PKGMANDIR}/man1 ${PKGMANDIR}/man8

new:
AUTO_MKDIRS=		yes

The variable INSTALLATION_DIRS_FROM_PLIST will be deprecated slowly.
2007-12-07 05:25:25 +00:00
rillig
9fab8079e7 Removed _INTERACTIVE_COOKIE, after asking on tech-pkg if anyone needs
it. It had only been used to change the "nerrors" variable in bulk
builds, but this variable is not used further anyway.
2007-12-01 11:11:53 +00:00
rillig
c7873e00e2 It has always annoyed be that package authors had to write ${PKGMANDIR}/
in the definition of INSTALLATION_DIRS, where a short man/ would be much
shorter. Since we already have that man-transforming magic in some other
places of pkgsrc, it's also here.

While here, documented INSTALLATION_DIRS and
INSTALLATION_DIRS_FROM_PLIST so they are found by "bmake help".
2007-09-13 09:44:58 +00:00
joerg
4a33463b76 Remove bootstrap-register, bootstrap was changed a while ago to use
normal building and installation.
2007-08-14 23:59:25 +00:00
joerg
8eae292c51 Fix a number of bugs in the DESTDIR support:
- check-perms.mk was not DESTDIR aware, prefix files before passing it
  to the directory extraction
- PKG_FILELIST_CMD was calling pkg_info, which is fine for normal
  installation, but fails of course for DESTDIR. Just drop the @ lines
  from ${_DEPENDS_PLIST} and use that.
- To make he former work, ensure that _flavor-generate-metadata is part
  of _INSTALL_ALL_TARGETS. It was normally a dependency of
  _flavor-register, but that is skipped for DESTDIR.
- Remove ${_DEPENDS_PLIST} when running install-clean.
2007-08-14 23:58:24 +00:00
jlam
6ea0c2868e Remove ${WRKDIR}/.pkgdb during "install-clean" as that directory
contains files that are generated during the "install" phase.  This
should fix the problem where PLIST modifications were ignored if the
PLIST was modified between a "make deinstall" and a "make reinstall".
2007-08-10 04:00:43 +00:00
joerg
409b183fc0 Remove USE_MTREE support. Keep one copy (the NetBSD version) for
the purpose of print-PLIST in plist/common-dirs.mtree.

Discussed with wiz@, no objections on tech-pkg@.
2007-07-02 14:54:09 +00:00
xtraeme
74128fcaf3 Check if INSTALLATION_DIRS_FROM_PLIST is defined before using .if
!empty...

Reported by Mihai Chelaru.
2007-04-19 18:16:36 +00:00
joerg
5ca4038017 Drop NO_MTREE by making it the default. Introduce USE_MTREE to get the
old behaviour back. Discussed on tech-pkg@.
2007-04-19 16:52:03 +00:00
rillig
c66cd8fa30 Fixed pkglint warnings. 2007-03-09 03:28:58 +00:00
rillig
feeac72e9a Replaced the remaining PKG_SILENT/PKG_DEBUG pairs with RUN. 2007-03-09 03:05:38 +00:00
rillig
3b97228894 Fixed the quoting in INSTALLATION_DIRS and install-dirs-from-PLIST.
In install-dirs-from-PLIST, all directories that don't contain an '@' or
'$' character are automatically installed.
2007-03-09 02:51:45 +00:00
rillig
836ffbe9b9 Added MAKEFLAGS to the RECURSIVE_MAKE call. Almost all other calls
already have it.
2007-03-09 00:45:54 +00:00
rillig
8dd9cf3d41 Renamed some more flavor-specific targets to have the form _flavor-*.
Split check-vulnerable into a general an a flavor-specific part, for
consistence with all the other targets.
2007-03-09 00:39:54 +00:00
wiz
5dce6c7d9d Make MTREE_FILE and MTREE_ARGS internal by prefixing them with '_'.
They are not supposed to be set by the user.
2007-03-02 09:08:33 +00:00
wiz
1520ab35d5 Desupport unused FORCE_PKG_REGISTER. 2007-03-02 08:49:40 +00:00
wiz
fc3f7b9811 Remove support for obsolete and unused NO_PKG_REGISTER. 2007-03-02 05:54:18 +00:00
rillig
06e2f03ee1 Moved the code that installs check-files on the hook from install.mk to
check-files.mk, for two reasons:

1. It belongs there.
2. Now check-files is run before check-perms and check-interpreter.
2007-01-06 20:15:26 +00:00
rillig
0ba86a9a56 Removed the tests for CHECK_INTERPRETER and CHECK_PERMS. They are now in
../checks/*.mk.
2006-11-12 00:51:00 +00:00
rillig
5644aacf25 Moved the check for whether check-wrkref should be run from
install/install.mk to check/check-wrkref.mk.

Renamed the check-wrkref target to _check-wrkref.
2006-11-12 00:13:26 +00:00
rillig
8f9b2f0817 Added some documentation.
Since hooks should not be overwritten, removed the !target() check. That
way, one gets a warning when attempting to add some code to the hook.
2006-11-11 23:51:30 +00:00
rillig
06e3596610 Moved the check whether check-shlibs should be run from
install/install.mk to check/check-shlibs.mk.

Renamed check-shlibs to _check-shlibs. Since it had been declared as
"private" before, this will not break anything.
2006-11-11 23:31:38 +00:00
joerg
6500d1b655 Just make the PREFIX with INSTALL_DATA_DIR. Drop the conditional and
don't use mkdir, as the latter uses the group permissions of the
parent directory under BSDs, resulting in group leaks for
USE_DESTDIR=yes. Discussed with agc@.
2006-11-07 18:16:19 +00:00
rillig
9dfb6ae2ac When a package sets INSTALLATION_DIRS_FROM_PLIST to "yes", it does not
need to specify INSTALLATION_DIRS itself. Instead, the list is generated
from the static PLIST files. Like for INSTALLATION_DIRS, mtree is
disabled when this variable is set.
2006-11-04 07:42:51 +00:00
joerg
dcda4fd1f6 Fix thinko: INSTALLATION_DIRS entries don't have ${DESTDIR} as prefix,
just ${PREFIX}.
2006-11-03 15:48:48 +00:00
rillig
43f0fe2662 Change INSTALL_MAKE_FLAGS to be _appended_ to MAKE_FLAGS when running
"make install". That way, packages don't have to say:

    INSTALL_MAKE_FLAGS+=    ${MAKE_FLAGS} foo=bar,

instead it suffices to say

    INSTALL_MAKE_FLAGS+=    foo=bar,

which is also more appropriate since multiple files (Makefile,
Makefile.common, options.mk, *.mk) don't need to care about whether
INSTALL_MAKE_FLAGS already includes MAKE_FLAGS or not.

Note: It is no longer possible to override MAKE_FLAGS completely. But
except for some exotic platforms, the default value is empty anyway.
2006-10-26 20:05:03 +00:00
rillig
20d92f3be1 Added a new post-installation check to see whether the files have their
permissions properly set. See mk/check/check-perms.mk and
sysutils/checkperms for details.
2006-10-13 06:32:15 +00:00
joerg
5b374e445d Main infrastructure for DESTDIR support.
Packages may set PKG_DESTDIR_SUPPORT to either "destdir" or
"user-destdir" to flag support for this, following the same
rules as PKG_INSTALLATION_TYPES (e.g. define before first include
of bsd.prefs.mk).

The user activates it via USE_DESTDIR. When set to "yes",
packages with "user-destdir" are handled as "destdir".
The installation of the package will not go to ${LOCALBASE},
but a subdirectory of ${WRKDIR} instead. pre/post install scripts are
not run and the package is not registered either. A binary package
can be created instead to be installed normally with pkg_add.

For "user-destdir" packages, everything is run as normal user and
ownership is supposed to be correctled by pkg_create later. Since
the current pkg_install code uses pax and it doesn't allow overwriting
owners, this does not work yet.

For "destdir" packages, installation, packaging and cleaning is run as
root.

This commit does not change the handling of DEPENDS_TARGET or
bin-install to allow recursive usage.
2006-10-09 12:25:44 +00:00
joerg
a8e7008902 Add variable to control whether the install target is run as root. 2006-10-09 11:59:08 +00:00
rillig
343b18a86f Added more error checking: If a directory is specified in
INSTALLATION_DIRS but a regular file of the same name already exists,
the BSD install(1) program doesn't care but exits successfully.

To avoid much more confusing error messages, this is checked here, and a
_good_ error message is printed.
2006-10-06 20:13:10 +00:00
rillig
9af6cadbee Both, the pkgsrc user and the package maintainer must agree that this
package should run the CHECK_FILES test. Otherwise we cannot prevent the
broken shells/standalone-tcsh from scanning the whole filesystem. (hi
agc!)
2006-10-05 01:10:59 +00:00
obache
33d4b2b7d2 Rename variable MAKEFILE to MAKE_FILE, as suggested in PR 28392. 2006-09-09 02:35:13 +00:00
jlam
39b54abe7c Only acquire the localbase lock after acquiring root privileges. This
fixes "make install" using just-in-time su-to-root.
2006-08-09 15:25:49 +00:00
rillig
a5c5777ae5 Fixed the locking, as suggested by Johnny on the tech-pkg mailing list.
Added two targets acquire-localbase-lock and release-localbase-lock,
which mark the complete LOCALBASE directory as locked, so that multiple
packages cannot run the install, deinstall or bin-install targets at the
same time.

The install target aquires locks in both WRKSRC and LOCALBASE, the other
two targets only need the LOCALBASE lock, since they may be run without
WRKSRC being present on the system.

locking.mk must be included before tools.mk and the PKG_FAIL_REASON
check.
2006-08-04 20:52:27 +00:00
jlam
c489860d62 Whenever we invoke a recursive make, we need to ensure that the proper
environment ${PKGSRC_MAKE_ENV} is also passed along.  Create a
convenience variable RECURSIVE_MAKE that does exactly this and that
can be used in place of MAKE when invoking make recursively.

Use RECURSIVE_MAKE everywhere in pkgsrc/mk that we invoke make
recursively.
2006-07-27 21:46:45 +00:00
jlam
77b719dae8 Modify the barrier so that we always invoke the recursive make process
when passing through the barrier.  This ensures the PATH (passed via
PKGSRC_MAKE_ENV) is correctly set for all phases after the barrier.

This fixes a bug in "interactive" pkgsrc use, where if you have no
work directory and type "make build && make install", then the "install"
step does not have a PATH set to include all the wrapper and tools
directories.
2006-07-22 16:31:35 +00:00
jlam
33879949fb The package directory path is "PKGPATH", not "PKG_PATH", which is used
by pkg_add(1).
2006-07-20 14:17:48 +00:00
jlam
01df22aa06 Add a "bootstrap-register" target used specially by the bootstrap script
to register packages that were installed by the bootstrap script.
2006-07-14 17:37:03 +00:00
jlam
356f5e8af5 Rename <phase>_COOKIE variables to _COOKIE.<phase>. These are private
variables so there are no user-visible changes.  This change just makes
it a little easier to write for loops.
2006-07-07 21:24:27 +00:00
jlam
b8d23232b8 Flatten out recursive makes into a single re-invocation of make by
introducing the concept of a "barrier".  We separate the user-invokable
targets into ones that must happen before the barrier, and ones that
must happen after the barrier.  The ones that happen after the barrier
are run in a sub-make process.  In this case, the targets that must
be run after the barrier are from the "wrapper" step and beyond.  We
rewrite the various "flow" targets, e.g. wrapper, configure, build,
etc., so that they of the right form to use the barrier target.

This now completely removes the concept of PKG_PHASE from pkgsrc.  It
is replaced with the concept of "before" and "after" the barrier, and
this state can be checked by testing for the existence of the barrier
cookie file.  Because we've removed most of the recursive makes, there
is now nowhere to hook the PKG_ERROR_HANDLER.* commands, so remove
them for now.

As part of this commit, put back the logic that conditionalized the
sources for the various cookie files.  Because the sources are all
"phony" targets, they were always run, regardless of whether or not
the cookie file already existed.  Now, if a cookie file exists, then
that entire phase associated with that cookie file is skipped.

Lastly, fix a thinko in configure/bsd.configure.mk where setting
NO_CONFIGURE in a package Makefile would manage to skip the "wrapper"
step altogether.  Fix this by correctly noting "wrapper" and not
"patch" as the preceding step to "configure".
2006-07-05 22:21:02 +00:00
jlam
990d0b5377 Make the check-vulnerable target more self-sufficient, by moving some
of the logic from fetch/fetch.mk into flavor/pkg/check.mk, so that
check-vulnerable can be used as a source target.

Make check-vulnerable a source target for every phase of the build
workflow, which ensures that it is always run if the user starts a
new phase from the command line.

Fix the cookie-generation targets so that they don't append, only
overwrite to the cookie file.  This works around potential problems
due to recursive makes.

Move the cookie checks so that they surround the corresponding phase
target.  The presence of the cookie should now inform the make process
to avoid doing any processing of phases that occur before the phase
corresponding to the cookie.
2006-07-05 09:08:35 +00:00
jlam
773389471a Insert cookie checks into the "real-install" and "real-package" targets,
which are invoked in recursive make calls for the "install" and
"package" targets respectvely.  These recursive make calls prevent
the top-level make from seeing all of the targets and computing a full
dependency graph, so it becomes possible for some targets to be invoked
more than once.  This change passes enough information along to the
recursive make calls and ensures that the source targets for the real-*
targets are only invoked once.
2006-06-14 07:51:47 +00:00
jlam
85c5451053 Restore missing ${SETENV} ${BUILD_ENV} that was dropped during the initial
package system flavors commit.
2006-06-10 03:23:46 +00:00
jlam
8c10d39139 Introduce the capability to gather all the warnings and errors that
are generated for a target and output them all at once at the conclusion
of the target's invocation.  The implementation is in bsd.pkg.error.mk,
which defines a macro target "error-check" that will print out any
non-empty warning and error files in ${WARNING_DIR} and ${ERROR_DIR}
and exit appropriately if there were errors.

Convert some targets that were just long sequences of ${ERROR_MSG} or
${WARNING_MSG} within a single shell statement to use the new delayed
error output via error-check.

Modify the compiler "fail" wrappers for C++ and Fortran to be less
verbose during invocation.  Instead collect the warnings and only
print them at the end of the completed phase, e.g. after "configure"
and/or "build" completes.
2006-06-09 13:59:06 +00:00
jlam
e95152039c If the install cookie file exists, then we don't need to do anything.
Also, move the interactive check into a separate target as a prelude
to removing the recursive make for invoking "real-install".
2006-06-08 15:47:10 +00:00
tron
6e1ed39e5d 1.) Remove all instances of '@${WARNING_MSG} "Warning: ...' which resulted
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-07 10:04:03 +00:00
jlam
3fbe129b69 Use PHASE_MSG, STEP_MSG, WARNING_MSG, and ERROR_MSG in place of ECHO_MSG
in various places.
2006-06-05 22:49:44 +00:00
jlam
e3f0f1869f Allow overrides of the public targets, e.g. "install", "package", etc.
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-05 17:41:11 +00:00