move .MAIN all the way to the top of the file. bsd.pkg.barrier.mk
(currently) needs to be included before bsd.wrapper.mk since it defines
_BARRIER_COOKIE, which is expanded and used in place within bsd.wrapper.mk.
This makes the "wrapper" phase run again.
bsd.pkg.barrier.mk uses the "make()" test expression. Also, include
"all" as a post-barrier target since it is implicitly the ".MAIN" target
when a user just types "make" in a package directory.
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".
and into their own directories. Also do some cleanups with build/_build
and pkginstall -- we get rid of _build and simply run pkginstall as
part of the "build" target.
Introduce a new mechanism to handle varying directory depths under
${WRKSRC} in which we find files to override, e.g. configure, config.*,
libtool, etc. OVERRIDE_DIRDEPTH is a package-settable variable that
specifies how far under ${WRKSRC} the various targets should look,
and it defaults to "2". We preserve the
meaning of the various *_OVERRIDE variables, so if they are defined,
then their values supersede the OVERRIDE_DIRDEPTH mechanism.
devel/tla will need to specially set OVERRIDE_DIRDEPTH to 3 (see log
for revision 1.1857 for bsd.pkg.mk -- to be done in a separate commit.
standard output. These are error or warning messages, so they shouldn't
be "seen" by anything expecting the output of a "make" command to make
sense. This addresses PR pkg/32239 by following the suggestions by
Roland Illig.
if PKG_{FAIL,SKIP}_REASON is set. This fixes the behavior when one
invokes "make build" in a package that sets a fail or skip reason to
stop as soon as the reason is printed.
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.
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.
into a new file pkgsrc/mk/tools/create.mk. This leaves bsd.tools.mk
as a file that pulls in all of the other ones. Also move the
tools-related targets from bsd.pkg.mk into bsd.tools.mk.
The tools cookie file has been removed, as well as hooks for
{pre,do,post}-tools. Instead, there is now only a single public target
"tools" which may be invoked. Invoking "tools" will always cause all
of the tools in ${TOOLS_DIR} to be created.
The "tools" step has been moved and is now just after the "depends"
step and before sources are extracted. This is the earliest place
where the "tools" step can be taken, and it allows the created tools
to be used in all steps/phases after it, starting with "extract". As
a consequence, we should just invoke tools by their bare names in
targets, e.g. awk, sed, patch, etc., instead of with the ${VARIABLE}
names, e.g. ${AWK}, ${SED}, ${PATCH}, etc.
pkgsrc/mk. Also get rid of the recursive make for the "patch" target.
This basically merges the "patch" phase into the "tools" phase.
There should eventually be a standalone script that can be used to
verify checksums listed in distinfo that should be used instead of
the roll-your-own code in the do-pkgsrc-patch target.
subdirectories of pkgsrc/mk. Move the following files around for
locality:
pkgsrc/mk/scripts/extract -> pkgsrc/mk/extract/extract
pkgsrc/mk/bsd.sites.mk -> pkgsrc/mk/fetch/sites.mk
Also get rid of the recursive make for the "fetch" and "extract"
targets. This basically merges the "fetch" and "extract" phases into
the "patch" phase.
There is still much more work to do to simplify the fetch code, but
this is a good start.
so it would exit successfully even if the sub-make failed. This caused
rather interesting behavior with SU_CMD=sudo, and sudo timed out. Ensure
that the result code is preserved by using a && chain rather than ;.
acquire-lock and release-lock macro targets. Take advantage of using
a make target by breaking up the _ACQUIRE_LOCK script into smaller
pieces, and make better use of the *_MSG definitions for printing
messages within the acquire-lock and release-lock targets.
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.
printed when some distfile must be fetched manually. After printing
them, the build is aborted.
This deprecates the old _FETCH_MESSAGE, as packages should never need to
define variables with leading underscores.
it will live with other "check" targets run after package installation.
Get rid of SHLIB_HANDLING, whose meaning had mutated over the years
from one thing to another. Currently, it is used to basically note
whether the system's "ldd" command can be usefully run on the package's
binaries and libraries. Rename this variable to CHECK_SHLIBS_SUPPORTED
for more clarity.
CHECK_SHLIBS is now a variable set exclusively by the user in /etc/mk.conf
to note whether the check for missing run-time search paths is performed
after a package is installed. It defaults to "no" unless PKG_DEVELOPER
is set.
real-su-install target so that the {pre,do,post}-install target command
lists will see the correct, fully-expanded definitions of certain
phase-specific variables.
${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".
PKGTOOLS_VERSION (since that is what it is).
Also add to the +BUILD_INFO the:
HOMEPAGE (also is in DESC)
CATEGORIES
MAINTAINER
DATE (using "+%Y-%m-%d %H:%M:%S %z")
This information will be included in the upcoming
pkg_info -X "summary" output.
(In my own pkgsrc, I have been recording the date and maintainer
for over two years.)
RECOMMENDED is removed. It becomes ABI_DEPENDS.
BUILDLINK_RECOMMENDED.foo becomes BUILDLINK_ABI_DEPENDS.foo.
BUILDLINK_DEPENDS.foo becomes BUILDLINK_API_DEPENDS.foo.
BUILDLINK_DEPENDS does not change.
IGNORE_RECOMMENDED (which defaulted to "no") becomes USE_ABI_DEPENDS
which defaults to "yes".
Added to obsolete.mk checking for IGNORE_RECOMMENDED.
I did not manually go through and fix any aesthetic tab/spacing issues.
I have tested the above patch on DragonFly building and packaging
subversion and pkglint and their many dependencies.
I have also tested USE_ABI_DEPENDS=no on my NetBSD workstation (where I
have used IGNORE_RECOMMENDED for a long time). I have been an active user
of IGNORE_RECOMMENDED since it was available.
As suggested, I removed the documentation sentences suggesting bumping for
"security" issues.
As discussed on tech-pkg.
I will commit to revbump, pkglint, pkg_install, createbuildlink separately.
Note that if you use wip, it will fail! I will commit to pkgsrc-wip
later (within day).
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.
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.
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.
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.
not good style to make the package author define variables from the
pkgsrc-internal namespace. The variables REPLACE.* and REPLACE_FILES.*
can now be used as replacements for _REPLACE.* and _REPLACE_FILES.*.
Support for the old variable names will be removed after 2006Q2.
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.
developer is officially maintaining the package.
The rationale for changing this from "tech-pkg" to "pkgsrc-users" is
that it implies that any user can try to maintain the package (by
submitting patches to the mailing list). Since the folks most likely
to care about the package are the folks that want to use it or are
already using it, this would leverage the energy of users who aren't
developers.
file pkgsrc/mk/bsd.pkg.clean.mk.
* Reimplement the clean target so that we don't need to invoke a separate
make process just to do clean-depends.
* Reimplement clean-depends using a pipe to avoid command-line length
issues.
show-depends-dirs
show-all-depends-dirs
show-all-depends-dirs-excl
While we're here, reimplement them using the new pkg_paths and
depends-depth-first.awk scripts. As a side effect, this speeds up
the execution of these targets by around 5-15% depending on the
complexity of the dependency graph.
NOTE: This *does* change the behavior of these targets slightly because
the output is now newline-separated instead of space-separated,
and the order of the output lines doesn't match the original
targets because the dependency graph is now walked depth-first
instead of breadth first.
the code that performs the dependency graph traversal (in depth-first
fashion). This script has a hook that allows executing a shell command
line upon visiting a dependency's package directory in either prefix
or postfix order, and may be used to simplify the code in bsd.pkg.mk
that iterates over dependencies.
This awk script requires the target "show-depends-pkgpaths", which is
defined in a new Makefile pkgsrc/mk/bsd.utils.mk. This file should
accumulate "utility" targets that current exist in bsd.pkg.mk, i.e.,
"helper" targets for various actions.
for manipulating PLISTs. This module is not used by default pending
more widespread testing -- currently the variable _USE_PLIST_MODULE
must be defined in /etc/mk.conf to enable its use.
The main features of the new PLIST module are:
(1) Splits out the PLIST-handling code from bsd.pkg.mk into a
separate "plist" module.
(2) Splits out giant, multi-line awk scripts stored in make
variables into separate awk scripts that may be joined
together to post-process PLISTs. Each of these awk scripts
consolidates the processing for one set of files, e.g.,
man pages, info pages, etc., and is more easily commented
than a make variable.
(3) Splits out the print-PLIST code from the regular PLIST code
since they have no common pieces (print-plist.mk vs.
plist.mk).
(4) Completely re-implements the shared-library handling to be
more efficient. Along the way, this also fixes a problem
for Mac OS X users where the PLISTs incorrectly contained
absolute paths.
(5) Completely re-implements the info-file handling so that we
can migrate from INFO_FILES definitions to just adding
info/foo.info entries in the static PLISTs.
(6) Adds commented-out support for automatically compressed or
decompressed info page entries based on the value of MANZ.
These changes will be activated after texinfo.mk has been
replaced by something that is built using the more modern
primitives now available in pkgsrc.
(7) Move the file compression logic into a separate script
"doc-compress" that compresses or decompresses files while
minding symlinks. This script is now called by bsd.pkg.mk
to do the "autmoatic man page handling". In the future,
it will also handle the "automatic info page handling" and
possible others.
In general, the idea is to move stuff out of the Makefiles and into
separate files where we don't need to worry about quoting rules
and where each file can have a separate history of commits. This
simplifies the makefile logic (especially in terms of readability)
and also simplifies maintenance of the code.
that the interpreter of "#!"-style scripts exists. It is disabled by
default, and can be enabled by setting CHECK_INTERPRETER=yes. As for the
other check-* targets, CHECK_INTERPRETER_SKIP is a list of shell globs
that can be used to to skip certain files.
Ok'ed by jlam.
packages from branch to branch:
When a package is considered broken (for whatever reason) at branch
time, we'll mark it with BROKEN_IN=name-of-branch. At the next
branch, we can easily determine which ones have remained broken and
remove them.
BROKEN_IN is visible to users iff a build fails, when it appends a
warning message to the above effect.
With feedback from dillo. Reviewed by jlam.
BINPKG_SITES entry separately, construct an appropriate PKG_PATH
and call pkg_add only once. Patch from Chapman Flack in PR 30929.
Use PKGNAME_REQD when installing package dependencies.
Patch from Chapman Flack in PR 30954.
configure script itself so that the generated config.status script
does what we want (just exit if asked to "recheck"). This ensures
the timestamp for config.status is earlier than the timestamps for
the files that config.status generates (Makefile, config.h, etc.).
This fixes some problems where some packages end up "rebuilding" as
part of the install target, which makes the rebuilt files owned by
root and makes cleaning the work directory fail.
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.
if NO_CHECKSUM is set to "yes". This allows to run "make makepatchsum"
in the top level pkgsrc directory without having to worry about lots of
additional distinfo files being created.
to force an early exit as soon as a "cd" command fails. Otherwise, "/"
would have been added as a dependency, leading to undefined behavior.
See PR 32202 for details.
Fixes the second item of PR 32202.
every top level target that is intended to be called by the user or by a
package different from the current package. It provides the same action
as the "main" targets like "fetch", "expand", "build" before in case
PKG_FAIL_REASON is set, that is it prints all PKG_FAIL_REASONs and
fails.
Fixes PR 32202.
Implementation notes:
- The target names have the "do-" prefix to not pollute the
bsd.pkg.check.mk namespace.
- The PKG_SKIP_REASON has no influence on the do-check-pkg-fail-reason
target, although both are handled with the same code.
(This also fixes problem where on some Linux systems, ldd
outputs linux-gate.so.1 entry without corresponding library.)
This was noticed on Linux.
This was discussed and okayed on the tech-pkg list in February,
2002. I have been using this on NetBSD and Linux since then. (Also
just tested on DragonFly.)
${WRKDIR}, and just always create it as part of a "make extract". This
should fix problems where if an old work directory is lying around that
doesn't already have .pkgdb, then a "make reinstall" won't break.
completely. The only difference to revision 1.1748 is that the
PATH=$$PATH:${SU_CMD_PATH_APPEND} argument is included in single quotes.
This will lead to problems when the PATH should contain single quotes
but works in all other cases. (Single quotes in the PATH hadn't worked
before either.) The tricky part regarding this code is that the PATH and
.CURDIR bypass the SU_CMD. They are evaluated before and inserted as
literals into the command that is executed by the SU_CMD. Preserving
these variables this way circumvents interpretation and modification
through the SU_CMD, but leads to ugly rules for quoting which are
currently not handled completely correctly.
ALLOW_VULNERABLE_PACKAGES settings that applies to all packages, there can
now be per-package lists of allowed vulnerability ids:
ALLOW_VULNERABILITIES.<pkgname>=<space separated list of vulnids>
To avoid duplication of code, audit-packages is now used to do these checks.
It can be skipped altogether by setting:
SKIP_AUDIT_PACKAGES=yes
variable before if it had multiple adjacent white-space characters in
it. Removed the dependency on awk(1), as a simple shell script can do
this job, too. Another change is that all kinds of weird pathnames can
be used for PREPEND_PATH, like /bin, "/bin/Program Files", "/ ",
/foo\ bar, and so on. This had not been possible before, too.
Related to PR 32079.
Ok'ed by jlam.
directories listed in INSTALLATION_DIRS are created in ${PREFIX}, but
it's now okay to include ${PREFIX} at the front of each, directory,
e.g. this is now okay:
INSTALLATION_DIRS+= ${PREFIX}/bin
Makes using this variable a bit less unwieldy sometimes.
modified) to not rely on this change, the default value of BUILD_DIRS
can be set to ${CONFIGURE_DIRS} instead of ${WRKSRC}. There are far more
packages setting CONFIGURE_DIRS and BUILD_DIRS to the same value than
there are packages needing different values, so this default seems more
reasonable. Now the default values are:
CONFIGURE_DIRS?= ${WRKSRC} # (unchanged)
BUILD_DIRS?= ${CONFIGURE_DIRS}
INSTALL_DIRS?= ${BUILD_DIRS} # (unchanged)
they had been before my last change. I had thought it would be more
intuitive if they were based on GNU_CONFIGURE_PREFIX instead of PREFIX,
but this might break some packages.
Up to now, a package that wanted to use a different location for
--mandir had to first define CONFIGURE_HAS_MANDIR=no and then
CONFIGURE_ARGS+=--mandir=${...}, which looks weird. Now it only has to
set GNU_CONFIGURE_MANDIR.
relative to ${WRKSRC}. This makes it possible to shorten definitions
like "BUILD_DIRS=${WRKSRC}/foo ${WRKSRC}/bar" in package Makefiles to
"BUILD_DIRS=foo bar". Almost all current uses of those directories are
given as absolute directories (mostly in the form ${WRKSRC}/foo), which
will work as they did before.
pathname relative to ${PREFIX} of directory holding the manual pages
and man directories. I have been using this for over two years.
This defaults to "man" so no change.
If using GNU_CONFIGURE then set --mandir. (Unless CONFIGURE_HAS_MANDIR
is no because some old GNU configure scripts are too old. This is
similar to existing CONFIGURE_HAS_INFODIR.)
Add PKGMANDIR to PLIST_SUBST. Add plist awk pattern-action statement
to convert man/ to ${PKGMANDIR}/. (This might need to be double checked
for some PLISTs that prefix some custom settings in front. qmail
used to do this, but now I see it does not.)
When "Decompressing manual pages" convert man/ also.
I have several other changes to commit for individual packages.
I chose not to modify the INSTALL_MAN or INSTALLATION_DIRS
to also convert man/ to PKGMANDIR/ because I thought this may
make it more confusing. So instead, I modify the individual
uses of these instead. (Todo: modify pkglint to check for this?)
(agc@ of the pkgsrc-pmc asked me to make these changes.)
for cat pages having "[0-9]" suffixes instead of just "0".
Some systems install cat pages with suffix number same as the cat
section number.
(This has been in my pkgsrc tree for probably a couple years,
but looking today, I do see man/cat1/ftp.1 on one of my systems.)
file of the package. It does _not_ replace the LICENSE variable. The
variable is currently only used in the show-license target. It is
intended that LICENSE_FILE is used for licenses that only apply to a
single package or a package group, so that the number of licenses in the
licenses/ directory is kept small.
around at either build-time or at run-time is:
USE_TOOLS+= perl # build-time
USE_TOOLS+= perl:run # run-time
Also remove some places where perl5/buildlink3.mk was being included
by a package Makefile, but all that the package wanted was the Perl
executable.
script that will make the directory later. This fixes the problem
where it fails when doesn't have write access -- for example use
"make fetch-list" to create the shell script to use on another
system.
Thank you, Geert Hendrickx, for your feedback.
Also in a few places echo ${fetchfile:T} instead of ${fetchfile}.
(Todo: maybe should not say "not fetched" until has tried all sites.)
a new bsd.pkg.check.mk file. This new file will eventually collect
all of the various "check" targets that are run at install-time.
While here, change the implementation of check-files so that it is
not so monolithic.
Change the meaning of the CHECK_FILES variables so that if it's not
"no", then the file checks are run. Also, allow these checks to be
run if the user explicitly sets CHECK_FILES in /etc/mk.conf, even if
PKG_DEVELOPER is not defined.
are checked for ${WRKDIR}, but all files are checked for ${TOOLS_DIR}
(assuming that ${TOOLS_DIR} is in ${WRKDIR}). Also, let CHECK_WRKREF_PKG
set the name of the package to check.
for a package and looks for references to the build directory. If
any such references are found and PKG_DEVELOPER is defined, then exit
with an error. This target is automatically run after a package is
installed if CHECK_WRKREF is "yes". The default value for CHECK_WRKREF
is "no".
You can specify certain files to be skipped during the check by setting
CHECK_WRKREF_SKIP to a list of shell globs. Installed files that
match these globs are skipped when running the check-wrkref target.
The original implementation was from Dan McMahill sent to me in private
email. I've added a few more bells and whistles for this commit. This
target will be helpful for catching any unwrapped files or mis-embedded
tool paths.
* Improve the documentation.
* Avoid running commands during Makefile processing by using the :sh
modifier instead of defining variables using !=
* Add a new variable PKGSRC_CHANGES that holds the path to the CHANGES
file to be modified.
* Use ${ID} and ${DATE}, which are provided by the tools framework and
avoid PATH issues.
into pkgsrc/doc/CHANGES.
The type of the entry depends on what CTYPE is set to, which defaults
to "Updated". Other possible values are "Added", "Renamed", "Moved",
and "Removed". An example usage would be:
cd /usr/pkgsrc/category/package
make changes-entry CTYPE=Added
after you added a new package, and similar for the others.
If NETBSD_LOGIN_NAME is not set in /etc/mk.conf, it defaults to
your local login name.
through to dependencies, which caused dependencies to have improper
lists of tools required.
XXX This whole mess with MAKEFLAGS and which ones are passed along when
XXX running the install-depends target needs to be fixed for real.
Several changes are involved since they are all interrelated. These
changes affect about 1000 files.
The first major change is rewriting bsd.builtin.mk as well as all of
the builtin.mk files to follow the new example in bsd.builtin.mk.
The loop to include all of the builtin.mk files needed by the package
is moved from bsd.builtin.mk and into bsd.buildlink3.mk. bsd.builtin.mk
is now included by each of the individual builtin.mk files and provides
some common logic for all of the builtin.mk files. Currently, this
includes the computation for whether the native or pkgsrc version of
the package is preferred. This causes USE_BUILTIN.* to be correctly
set when one builtin.mk file includes another.
The second major change is teach the builtin.mk files to consider
files under ${LOCALBASE} to be from pkgsrc-controlled packages. Most
of the builtin.mk files test for the presence of built-in software by
checking for the existence of certain files, e.g. <pthread.h>, and we
now assume that if that file is under ${LOCALBASE}, then it must be
from pkgsrc. This modification is a nod toward LOCALBASE=/usr. The
exceptions to this new check are the X11 distribution packages, which
are handled specially as noted below.
The third major change is providing builtin.mk and version.mk files
for each of the X11 distribution packages in pkgsrc. The builtin.mk
file can detect whether the native X11 distribution is the same as
the one provided by pkgsrc, and the version.mk file computes the
version of the X11 distribution package, whether it's built-in or not.
The fourth major change is that the buildlink3.mk files for X11 packages
that install parts which are part of X11 distribution packages, e.g.
Xpm, Xcursor, etc., now use imake to query the X11 distribution for
whether the software is already provided by the X11 distribution.
This is more accurate than grepping for a symbol name in the imake
config files. Using imake required sprinkling various builtin-imake.mk
helper files into pkgsrc directories. These files are used as input
to imake since imake can't use stdin for that purpose.
The fifth major change is in how packages note that they use X11.
Instead of setting USE_X11, package Makefiles should now include
x11.buildlink3.mk instead. This causes the X11 package buildlink3
and builtin logic to be executed at the correct place for buildlink3.mk
and builtin.mk files that previously set USE_X11, and fixes packages
that relied on buildlink3.mk files to implicitly note that X11 is
needed. Package buildlink3.mk should also include x11.buildlink3.mk
when linking against the package libraries requires also linking
against the X11 libraries. Where it was obvious, redundant inclusions
of x11.buildlink3.mk have been removed.
doesn't happen until after the package is extracted. Prior to
extraction, cache the variables named in MAKEVARS using MAKEFLAGS
instead. This avoids invoking each expensive computation up to four
times before it gets cached. For packages that include lots of
buildlink3.mk files, this saves a lot of CPU time.
operator does not result in an empty string as make(1) doesn't like
them. Also, rewrite the variable substitution for the find(1) command
to be more readable, and get rid of the extra grep(1) in favor of
using :N.
variables that use the :sh modifier. This still causes expansion to only
happen when referenced, and has the advantage of being :Q-safe.
Bring back the changes from revision 1.19 of mk/subst.mk now that the
problem noted above has been fixed. This passes the buildlink-unwrap
regression test.
- completely redo the code which decides on the machine architecture,
operating system, and operating system version for the binary packages.
The old way just used to directory names to take a guess. The new
way creates a cache file containing meta-data for all the binary packages
in each "All" directory. This cache file is consulted when generating
the lists of available binary packages. The meta-data is obtained with
pkg_info so it should always be correct even if you do something silly
like mix OS_VERSION or MACHINE_ARCH packages up in the same directory.
Among the benefits are: works when PACKAGES is not $PKGSRC/packages,
works with a more or less arbitrary subdirectory structure, works
when there are subdirectories for multiple operating systems.
This portion of the fix should address PR25390.
The cache files are only updated when the contents of an "All" directory
changes or if the cache file format changes. There is some room for
improving the updating of the cache files, but its not too bad the way
it is.
- fix up some of the awk code so that generadme.awk works with Solaris
nawk as well as NetBSD's nawk and gawk (for pre-2.0 systems).
- remove some "if ! foo" shell constructs to increase portability.
- be more consistent with what variables get passed to mkreadme from
make and which ones are determined automatically. Mostly this meant
moving stuff into mkreadme to make it easier to run it standalone.