"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.
one of "native" or "xorg". Failing with an error message in the right
file is better than failing somewhere else with a completely obscure
error message.
cache together with MAKE_FLAGS=-j. The cache file is now regenerated
into a temporary file and then renamed (atomically) to the "real" cache
file.
Fixed some code that would fail when run in "set -e" mode. If you want to
test the "set -e" mode, just uncomment the line in wrapper.sh.
pathnames anymore. Therefore cd to ${PREFIX} to correctly resolve
the relative pathnames.
While here unbreak CHECK_WRKREF for another reason:
Append to ${ERROR_DIR}/${.TARGET} otherwise the "_NONZERO_FILESIZE_P"
check is always false...
alias for apache.mk, since I don't see a reason why a package should
query the apache version without also adding a dependency on apache.
Fixed the documentation to match the code. Made the code simpler. Added
sanity checks for both package-settable and user-settable variables.
The actual check has moved into a shell file to allow for nice-looking
code. Instead of only the configure scripts, it scans all files whose
first line matches "#!*/bin/sh". Therefore the check is run no matter if
HAS_CONFIGURE is set or not.
Added a warning (not an error) for every use of $RANDOM that is not
combined with $$, the process ID. $RANDOM is only implemented by bash
and some versions of the ksh.
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.
are run with elevated privileges. Remove MAKE_PACKAGE_AS_ROOT
for now, since it is not sure whether the functionality in the current
form will stay and developers should spend time on the destdir support
instead.
errors. Now "make depends" stops on dependency directories that don't
exist.
The dependencies are first extracted into two temporary files and then
combined with cat(1) because otherwise "make depends" passes silently on
errors when it is called for the second time. Somehow ${.TARGET} didn't
get removed.
package needs to be packed by root or whether the unprivileged user can
do that as well. Most packages don't need root privileges, but the
default value is nevertheless "yes" to not break too many existing
packages.
pkgsrc users are encouraged to add the following to their mk.conf:
MAKE_PACKAGES_AS_ROOT?= no
The "?=" operator here is important because after the testing phase,
this variable is only intended to be set by packages. If "=" would be
used instead, packages could not override the value.
lead to overloads of very first distribution site. Moreover, if first
site in the list is not available (often seen for sourceforge mirrors)
you have to wait for timeout each time. To distribute load on master
distribution sites and to make second problem not so annoying randomly
intermix list of MASTER_SITES with MASTER_SORT_RANDOM feature. Any of
MASTER_SORT and MASTER_SORT_REGEX can be applied later.
The feature is turned ON by default and is disabled for PKG_DEVELOPERs
or if MASTER_SORT_RANDOM=no.
fetch files with an empty name, for example "geda/".
The problem was that the expression ${LIST:S,^,${DIST_SUBDIR}/,} results
in ${DIST_SUBDIR}/ when ${LIST} is empty. This is surprising but matches
the documentation in the manual page, so this cannot be called a bug.
The proper fix is to use ${LIST:@f@${DIST_SUBDIR}/${f}@} instead.
Noticed by Don Woodstock on #netbsd-code.
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.
for some reason. That way, error and warning messages that have long
been hidden are now shown. They don't appear very prominently by now,
but it's much better than showing them not at all.
since it is user settable and most of the time set by the user.
X11BASE follows the same reasons. For staged installations, we don't
want to register the package directly, so there's no need to prefix
PKG_DBDIR either.
target.
MAKE_JOBS is undefined by default. You can test this by setting
in mk.conf: MAKE_JOBS=5 for example.
Some package just won't build correctly with this -- these individual
packages can set MAKE_JOBS_SAFE=no to disable it.
This is based on discussion from last December 2005. Some pkgsrc
users are using ideas like this.
Note I have been using this since December 2005 on various single
processor and multiprocessor systems. (Once I kept some stats on
performance but have misplaced that now.) I haved tested this with
many packages (but not a bulk build) on Linux, NetBSD and DragonFly.
This commit doesn't include the commits for the MAKE_JOB_SAFE. As
this is experimental it needs more testing. Some examples of problems
are: comms/lrzsz, databases/gramps2, editors/vim, graphics/MesaLib,
graphics/netpbm, net/bind9, print/ghostscript-esp, textproc/libxml,
and www/lynx.
recursively. This bug was reported by Hans Rosenfeld in
http://mail-index.netbsd.org/tech-pkg/2006/10/03/0002.html
As a side effect, when bin-install fails to install a binary package,
the package is still built from source, but not as a privileged user.
The particular /bin/sh bug that was biting here is
"${x}"/*/*/"$y"
doesn't expand the *'s if $y starts with a "." which, unfortunately, it
does. Using
"${x}"/*/*/$y
works correctly.
operator in test(1). It is enabled by default when PKG_DEVELOPER is
selected.
In my private bulk build of about 3700 packages, there had been no false
positive.
as tight as possible. Files we don't handle shouldn't be skipped.
- fonts.alias is not created automatically, so don't remove it.
- create fonts.encoding with mkfontdir using -e X11_ENCODINGSDIR.
On platforms not following the X11R6 loayout this might need to
be overriden.
- Fix type1inst calls.
- Modify packages which installed fonts.alias before to actually
include it in the PLIST and bump the revisions accordingly.
- Modify xorg-fonts* packages to use FONTS_DIRS.* to build indices
at run time.
Discussed with wiz and jlam.
command line
$debug_log $arguments
tries to execute the empty command. This results in error messages of
the form
cc[50]: : cannot execute (IRIX)
bash: : command not found (Bash)
: permission denied (NetBSD /bin/sh)
Setting IFS to the original value as soon as possible fixes these bugs.
Fixes PR 34135.
Setting "WRAPPER_SKIP_TRANSFORM" to "yes" isn't enough because "imake"
will invoke the C compiler which might be a wrapper script which always
fails because the package didn't use "USE_LANGUAGES+= c".
The "imake-check" script now simply uses the original command path before
"bsd.pkg.mk" modified and will therefore avoid using any wrappers.
${EXTRACT_SUFX}, so one can directly use EXTRACT_ONLY instead.
EXTRACT_ONLY defaults to ${DISTFILES} which in turn defaults to
${DISTNAME}${EXTRACT_SUFX}. So if EXTRACT_SUFX is relevant for determining
which tools are needed this can only happen if neither DISTFILES nor
EXTRACT_ONLY have been set by the package, in which case the relevant
variable EXTRACT_ONLY would contain EXTRACT_SUFX.
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.
packages that use a sub-directory for prefix, like
/usr/pkg/qt3/.
(I have been using this for a couple years but recently
merged my patch over to new flavor mk file.)
Okayed by jlam on tech-pkg.
_WRKDIR_LOCKFILE and never _PREFIX_LOCKFILE, so use that to keep things
simple.
Replaced ECHO with ECHO_MSG in the message for creating the WRKDIR
symlink.
WRKDIR against foreign processes. Instead, the PKG_DBDIR is locked,
preventing other (pkgsrc) processes from modifying the set of installed
packages while another one is doing that.
This allows to use "bmake update" efficiently on multi-processor
machines by just running it in four different package directories.
Note that the pkg_add and pkg_delete tools may still interfere with this
locking when they are directly run.
have been empty to qualify as a comment. Otherwise "make help
TOPIC=configure" shows a lot of misleading contents.
Removed the duplicate appearance of RCS Ids in the help texts, which
often occured when the help text was the header comment of a file.
word after the leading "#" for the comment. This format is also
recognized. The RCS Id of the current file is printed together with the
help text, so that the user can see which file defines the variable.
Removed the :M* operator for _HELP_AWK, since bmake has a bug when "" is
passed to the :M* operator. I've sent a bug report for this.
Since more and more files follow the convention of documenting variables
in a common format, it makes sense to be able to get the documentation
of a single variable by simple means, instead of searching through the
whole mk/ directory.
Try "make help TOPIC=CONFIGURE_DIRS" for an example.
While here, ...
- Added stricter checking by using "set -eu".
- The bulk build configuration file is properly included, and the
MAKECONF definition that it may contain is properly exported.
- All progress messages and error messages are prefixed by "upload>",
so that it is obvious where the messages come from.
- Since extracting the make(1) variables takes quite a long time, print
an informational message before doing that.
- Removed the use of the error-prone lintpkgsrc to detect whether a
package is restricted or vulnerable.
- If an error occurs, the upload program returns an exitcode of 1,
which is common among Unix utilities.
- Removed almost all pipe operators, since they tend to hide program
failures.
- All error messages are redirected to stderr instead of stdout.
- add a -n|--no-upload flag which does everything but actually executing
the upload to help see what would happen
- add a -d|--debug flag to preserve the temporary files to help with
debugging
- add a -V|--version flag
http://mail-index.netbsd.org/tech-pkg/2006/07/30/0005.html
2. Too much is logged in the .wrapper.log
The wrappers log quite a lot of detailed information by
default, with the result that my .work.log file is 176236028
bytes {for ghc}.
The wrapper functionality is mature, so this detailed
information is seldom needed, and you can in general determine
what happened by looking at the input/output-lines (i.e.
those lines marked as "[*]" and "<.>" in the .work.log).
I would therefore like to change the default behavior to
only log the input/output-lines.
Flip the switch for WRAPPER_DEBUG from "yes" to "no" by default so
that the detailed and rather verbose "push", "pop", "transform", etc.
messages are not printed. While here, also make WRAPPER_DEBUG a
pkgsrc-private variable by prepending with an underscore.
show-all-depends-dirs
show-all-depends-dirs-excl
Replace them with calls to pkgsrc/mk/scripts/depends-depth-first.awk
which does the same thing but without the extra overhead of invoking
a recursive make.
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.
If ${FILESDIR}/getsite.sh exists, then use it to determine the fetch
URL for each of the distfiles for the package. Otherwise, use
SITE_<file> and MASTER_SITES, in order, to determine the URL for each
distfile.
If the script path differs from ${FILESDIR}/getsite.sh, then set
DYNAMIC_SITE_SCRIPT to the full path to that script.
Remove the need to set DYNAMIC_MASTER_SITES explicitly in the package
Makefile for:
graphics/ns-cult3d
wm/sawfish-themes
www/apache-tomcat55
www/jakarta-tomcat4
www/jakarta-tomcat5
compiler toolchain until the configure stage, move the "wrapper" stage
back to between "patch" and "configure".
This makes "make extract NO_DEPENDS=" work again for all packages.
that does not exist, it stopped.
Now it instead adds an entry to the main broken file and marks
it as not package with maintainer "directory_does_not_exist"
in the HTML output. (Not packaged directories are not mentioned
in the text version.)
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.
to all internal recursive make processes. As such, rename it to
"PKGSRC_MAKE_ENV".
XXX Note, some of the usage of this variable in package Makefiles seems
XXX incorrect. They probably want "MAKE_ENV", which is the environment
XXX passed to the make process when running "make" within ${WRKSRC}.
-- instead, we just check "pkg_info", which should exist on all pkgsrc
platforms.
XXX Note that this may need to change when we later support other package
XXX system flavors.
Back out revision 1.79 of pkgtools/x11-links/Makefile which was only to
work around needing a C compiler for shlib-type to work.
it for plurals support, but that is already handled correctly (FSVO
"correctly") by the pkgsrc/mk/tools/msgfmt.sh script.
Also remove _USE_GNU_GETTEXT definitions from pkgsrc/mk/platform/*.mk
files as that value has been unused by pkgsrc for quite some time
(going back several branches).
package said USE_LANGUAGES=#none or USE_LANGUAGES=fortran. Added a
c-fail-wrapper that works like the other fail-wrappers. The default
value for USE_LANGUAGES is still "c". Some problems are expected with
packages that say USE_LANGUAGES+=c++ or with packages containing GNU
configure scripts and setting USE_LANGUAGES=c++, as those scripts always
need a working C compiler.
symlink in the pkgsrc tree in case it's actually a stale work directory.
This gets rid of this error:
===> Cleaning for pkg_install-20060701
rm: work: is a directory
*** Error code 1 (ignored)
currently exist. This triggers a bug in the Bourne shell of at least
DragonFly and Irix, when set -e is also active. Remove set -e to avoid
this. Discussed with jlam@, shown by DragonFly bulk builds, complains on
DragonFly's user list and PR 34036.
A test case for this shell bug is, which should return 0:
set -e
testf () {
test -f /nonexistent || return 1
return 0
}
if testf; then
exit 1
fi
exit 0
had actually been ignoring LTCONFIG_OVERRIDE anyway and just using
the default LIBTOOL_OVERRIDE to replace libtool scripts in packages.
This just formalizes the fact that LTCONFIG_OVERRIDE is not used
meaningfully by pkgsrc.
the old bsd.pkg.mk behavior (noted by adrianp in private email). Keep
"makedistinfo" as an alias for "distinfo".
While here, sprinkle some .PHONY declarations for correctness.
in do-fetch-file (formerly they were inserted by the old _FETCH_FILE
inserting some quotes that are no longer added by the fetch command list
macro). This makes fetching with MASTER_SORT* set work again.
* All the smarts is now encapsulated in the "fetch" script. The fetch
script understands how to use the distinfo file (if specified) to
look up the size and checksums of the file to fetch and will use
that information to verify checksums of the fetched files or resume
transfers of interrupted fetches.
* Move the default settings for FETCH_RESUME_ARGS and FETCH_OUTPUT_ARGS
for "ftp" from mk/defaults/mk.conf into mk/fetch/fetch.mk. We rewrite
it to avoid needing conditional statements.
* Avoid spawning a new make(1) process just to mirror a distfile.
* Split out fetch-list targets into a separate file fetch-list.mk.
These targets should probably be moved into a standalone script.
* Fix distclean target to properly remove partial downloads.
fetch.mk. This script currently completely replaces the functionality
in _FETCH_FILE. I will eventually add the ability to resume a file
transfer to this script.
"fetch" target, but it does affect the "checksum" target's shell
script, which errors out on the second occurrence of a file. The
shell script should perhaps also be fixed, but it seems sensible
regardless for ${ALLFILES} not to contain duplicate filenames. As
a side effect, the file list is sorted.
Regression found by building mail/qmail with the "qmail-netqmail"
option, which adds to PATCHFILES a file that's already in ${DISTFILES}.
Arguably this is gross, but it worked before, and now works again.
Tested on my usual pkg_comp(8) build of 200+ packages, with an
initially empty ${DISTDIR} and ${PACKAGES}. Thanks seb@ for the
more idiomatic make(1) construction.
and those that are defined by the infrastructure (_BUILD_DEFS). This
allows the build-defs-message target to be moved to the end of
bsd.pkg.mk. Now it prints the correct result even in unprivileged
builds, which had been wrong due to the order in which the files have
been included. For example, ${UNPRIVILEGED_USER} was displayed as (not
defined) although its value was defined, which could be checked with
"bmake show-var".
Tested with one package that _does_ define BUILD_DEFS and with one that
doesn't. The behavior stays the same.
replaced automatically by defining REPLACE_AWK, REPLACE_BASH or
REPLACE_SH and an appropriate addition to USE_TOOLS.
The replace-interpreter.mk file is included unconditionally because the
number of variables that would trigger the inclusion of this file is
quite large.
This fixes problems where a package sets PKG_*_REASON, which causes
bsd.pkg.mk to define its own "checksum" replacement, which causes a
"duplicate script" make error to occur.
* Avoid shell differences between /bin/sh and Korn shell by using:
while read line; do list; done < FILE
instead of
cat FILE | while read line; do list; done