Commit graph

2014 commits

Author SHA1 Message Date
jlam
0fde1ce52f Make it a little easier to read the lock/unlock output by inserting some
quotes.
2006-07-06 21:59:38 +00:00
jlam
1d395074e5 Refactor the README.html generation code from bsd.pkg.mk into a separate
bsd.pkg.readme.mk and document the public targets and variables for this
new file.
2006-07-06 21:07:33 +00:00
jlam
36690002fb Fix previous... instead of moving bsd.pkg.barrier.mk down below .MAIN,
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.
2006-07-06 16:58:17 +00:00
jlam
50170b85af Move inclusion of bsd.pkg.barrier.mk under the .MAIN target because
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.
2006-07-06 15:43:10 +00:00
rillig
a820e0b7bb Fixed the test on PKG_{FAIL,SKIP}_REASON. Added a prefix line to the
output of PKG_SKIP_REASON, since the plain message does not say where it
comes from.
2006-07-05 23:27:34 +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
e31200b87c Refactor configure, build, test and wrapper phases out of bsd.pkg.mk
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.
2006-07-05 06:09:15 +00:00
rillig
947e6826c3 devel/tla has the GNU config scripts in a */*/* directory. 2006-06-18 09:40:25 +00:00
rillig
c253911751 Define CONFIG_{GUESS,SUB,RPATH}_OVERRIDE also when
OVERRIDE_GNU_CONFIG_SCRIPTS is defined.
2006-06-18 09:37:55 +00:00
rillig
84f1fd3ebf Fixed wrong indentation of .if/.else/.endif. 2006-06-18 09:34:07 +00:00
rillig
4d918f29a2 Added a variable OVERRIDE_GNU_CONFIG_SCRIPTS that allows a package to
override the config.guess, config.sub and config.rpath scripts even if
GNU_CONFIGURE is not defined. This is needed for devel/tla.
2006-06-17 21:27:30 +00:00
jlam
982acd0360 Output PKG_{FAIL,SKIP}_REASON messages to standard error instead of
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.
2006-06-15 02:39:19 +00:00
jlam
d518b52c8e Allow the standard build target to be overridden by the one generated
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.
2006-06-15 02:24:41 +00:00
jlam
dab443fe1e Move the common make command executed in su-target into a separate make
variable to try to get rid of potential quoting problems.
2006-06-12 16:30:03 +00:00
jlam
89a7595587 Split out the "work" symlink creation into a separate step and add it
as a source for the "makedirs" target.  This ensures the symlink is
created regardless of whether ${WRKDIR} already exists or not.
2006-06-11 02:14:45 +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
b55dfcc740 Introduce "makedirs" as a helper target to create directories with
unprivileged ownership.
2006-06-08 16:21:51 +00:00
rillig
cb4b57b6b0 Replaced PHASE_MSG with STEP_MSG in many (but not all) places where it
wasn't used to identify a ``phase'', as defined in the pkgsrc guide.
2006-06-08 08:01:53 +00:00
jlam
68229b135c If there is _ZERO_FILESIZE_P, then it's natural to have _NONZERO_FILESIZE_P
to test for the opposite condition.
2006-06-07 18:37:06 +00:00
jlam
377d2c27f2 Move _ZERO_FILESIZE_P ftom bsd.pkginstall.mk to bsd.pkg.mk so it can more
clearly be used in other modules.
2006-06-07 17:44:29 +00:00
jlam
44fed2736c Add WARNING_CAT and ERROR_CAT which are filters for outputting file
contents to standard error.  They prefix the output with "WARNING: "
and "ERROR: " respectively.
2006-06-07 17:00:03 +00:00
jlam
3058ace76f Move some variable definitions out of bsd.prefs.mk and back into
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.
2006-06-06 15:28:51 +00:00
jlam
cd1230e8e3 Separate out the part of bsd.tools.mk that actually created the tools
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.
2006-06-06 06:30:29 +00:00
jlam
627dc60046 Refactor "patch" code into correspondingly named subdirectory of
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.
2006-06-06 04:48:19 +00:00
jlam
c78510391e Refactor "fetch" and "extract" code into correspondingly named
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.
2006-06-06 03:05:48 +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
daa9eec1ee Remove spurious comment. 2006-06-05 17:56:10 +00:00
jlam
aa5856070f Move definitions for UPDATE_TARGET and DEPENDS_TARGET closer to where
they are used.  Also, move UPDATE_RUNNING into the install module where
it is used, and make it "private" by prepending with an underscore.
2006-06-05 17:21:54 +00:00
jlam
711838a579 Ensure the directory containing the lockfile is created prior to the
lockfile's creation.  Fixes the "depends" step when PKGSRC_LOCKTYPE
is not "none".
2006-06-05 02:22:49 +00:00
jlam
a6459db5e0 Backout previous and fix in another way -- use "set -e" to force the
shell to exit if any untested command fails.  This is based on Roland
Illig's recommendation from his pkglint talk at pkgsrcCon/Paris.
2006-06-05 01:42:58 +00:00
tv
a540af7b7d Fix problem in su-target: the exitcode of the make command is discarded,
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 ;.
2006-06-04 20:10:12 +00:00
jlam
ff4b082f6f Move some "update"-only variables from bsd.pkg.mk to bsd.pkg.update.mk. 2006-06-04 08:25:52 +00:00
jlam
fd91f5268e Make LOCKFILE into a "private" variable by prepending with an underscore. 2006-06-04 06:09:36 +00:00
jlam
3ec9044454 Include bsd.pkg.update.mk to get the "update" targets and variables. 2006-06-04 05:26:45 +00:00
jlam
cf1cfc8ed5 Move test for the lockfile within the target's shell code instead of
testing for it at the Makefile level.
2006-06-04 05:25:08 +00:00
jlam
e914dab1ef Drop the use of _ACQUIRE_LOCK and _RELEASE_LOCK and replace with
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.
2006-06-04 04:31:47 +00:00
jlam
46822f43e8 Convert just-in-time su targets to use su-target instead of ${_SU_TARGET}.
Garbage-collect the (now) unused _SU_TARGET.
2006-06-04 00:39:05 +00:00
jlam
e5eb2c56af First pass at implementing support for package system flavors other
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.
2006-06-03 23:11:42 +00:00
rillig
f0c209086a Packages may set the variable FETCH_MESSAGE to a list of lines that are
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.
2006-05-23 07:39:22 +00:00
jlam
60f791e1e6 Move the check-shlibs target from bsd.pkg.mk to bsd.pkg.check.mk where
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.
2006-05-22 22:22:02 +00:00
jlam
143b5f7d14 Move mk/install to mk/pkginstall to better reflect the contents (the
pkginstall framework).
2006-05-21 23:50:15 +00:00
jlam
f89090ec85 Pass PKG_PHASE=install when recursively calling make from within the
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.
2006-05-21 14:41:29 +00:00
rillig
8a223461b1 Fixed some pkglint warnings in the do-configure, do-build, do-test and
do-install targets. This fixes an endless loop occuring when running "make"
in regress/make-quoting.
2006-05-10 17:53:34 +00:00
reed
a36ea4e941 If USE_ABI_DEPENDS=no, do not add the BUILDLINK_ABI_DEPENDS.$pkg
to BUILD_DEPENDS. (I posted about this to pkgsrc-users on April 14.)
2006-05-06 03:28:44 +00:00
jlam
b01f35bb33 Allow a package to specify the ownership and permission on
${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".
2006-04-26 05:58:44 +00:00
dillo
5a24717f5c Rename recently added BUILD_INFO variable DATE to BUILD_DATE, and
the make variable holding its value to _BUILD_DATE.

Discussed on tech-pkg.
2006-04-24 20:19:03 +00:00
rillig
1ffbacec96 Adjusted the code to the pkglint warning that NO_PACKAGE should not be
quoted.
2006-04-22 08:36:07 +00:00
jlam
2f39e321ba Rename the CHANGES file to CHANGES-2006. From now on, the changes for
each year will accumulate in CHANGES-YYYY.
2006-04-18 00:25:04 +00:00
joerg
4476e7eb89 Add INSTALL_GAME_DIR to complement INSTALL_GAME_DATA. The directories
are group-writeable by the games user on those platforms, where
GAMEMODE includes setgid. It defaults to PKGDIRMODE otherwise.
2006-04-12 21:01:15 +00:00
reed
af62eac2f9 Rename the _PKGTOOLS_VER variable in the +BUILD_INFO to
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.)
2006-04-12 19:28:47 +00:00
jlam
58140d4125 Correct comment on run-depends-list target (PR pkg/29741). 2006-04-10 04:47:30 +00:00
reed
5abef9be14 Over 1200 files touched but no revisions bumped :)
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).
2006-04-06 06:21:32 +00:00
jlam
29fefe52e3 * Creates a new variable PKGINFODIR (named similarly to PKGMANDIR)
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.
2006-03-20 01:48:57 +00:00
jlam
3a47f58511 Allow INSTALLATION_DIRS to contain absolute paths so long as they being
with ${PREFIX}.  This simplifies re-using variables that contain full
paths.
2006-03-17 08:02:41 +00:00
jlam
47283bca00 Always run the pkginstall framework targets to generate the
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.
2006-03-15 16:20:11 +00:00
jlam
ce8c6b5c7a Back out previous... it was part of some larger changes that were never
committed and I got ahead of myself.
2006-03-15 14:06:09 +00:00
jlam
934c43ebc6 We can always pass --infodir to configure scripts, regardless of whether
or not there are info files to be installed.
2006-03-14 17:24:34 +00:00
jlam
daad0f3d6c Modify the pkginstall framework so that it manages all aspects of
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.
2006-03-14 01:14:26 +00:00
rillig
3ef535342c Added the variable PHASE_MSG, STEP_MSG, WARNING_MSG and ERROR_MSG to
facilitate the generation of consistent-looking progress messages.
2006-03-12 14:55:18 +00:00
tonio
5371ea65c7 replace-interpreter should use REPLACE_FILES.${lang} instead of
_REPLACE_FILES.${lang}
2006-03-10 11:02:00 +00:00
jlam
11d32442f2 Make it safe to include bsd.pkginstall.mk directly in bsd.pkg.mk, and
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.
2006-03-09 23:31:51 +00:00
rillig
1b68c0a8f7 Since the REPLACE_INTERPRETER is used in more and more packages, it is
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.
2006-03-09 15:58:10 +00:00
jlam
51cac88fb9 Reimplement the info-file handling so that we use an +INFO_FILES
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.
2006-03-09 00:20:27 +00:00
jlam
9c8b5ede43 Point MAINTAINER to pkgsrc-users@NetBSD.org in the case where no
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.
2006-03-04 21:28:51 +00:00
joerg
530f1cacf5 Make GNU_CONFIGURE_PREFIX the default prefix for GNU_CONFIGURE_MANDIR
and GNU_CONFIGURE_INFODIR. Add the latter for symmetry.
2006-03-02 19:15:37 +00:00
rillig
7db088da96 Added SITES.${foo} as an alias for SITES_${foo}. The latter will be
deprecated after the 2006Q1 branch.
2006-02-18 15:37:22 +00:00
rillig
19488e75a4 If the replace-interpreter program cannot find a file, a warning is
printed.
2006-02-02 21:15:46 +00:00
jlam
6a485fcc01 Don't write ${FOO:Mbar} == "bar", when !empty(FOO:Mbar) will suffice.
In this case, "FOO" is "INTERACTIVE_STAGE".
2006-01-21 21:32:51 +00:00
rillig
e9f81c65bc Unquoted SUBST_MESSAGE.*, as this is no longer needed. 2006-01-21 10:10:42 +00:00
jlam
e08f70e543 Remove the old PLIST-handling code after bulk building has shown the new
PLIST module works correctly.
2006-01-20 20:17:07 +00:00
jlam
f6808df1ba Move more "patch"-related variables and targets out of bsd.pkg.mk and into
bsd.pkg.patch.mk.
2006-01-19 20:32:17 +00:00
jlam
4a3e4a25bc Move more of the "extract"-related variables and targets out of bsd.pkg.mk
and into bsd.pkg.extract.mk.
2006-01-19 19:35:25 +00:00
jlam
15e61bbe84 * Split out the "clean" targets and variables and put them into a separate
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.
2006-01-19 16:11:10 +00:00
jlam
19a4f23ea1 Move the following targets from bsd.pkg.mk to bsd.utils.mk:
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.
2006-01-18 20:18:04 +00:00
jlam
c7da3f7718 Remove unused "show-root-only" target. 2006-01-18 19:12:54 +00:00
jlam
5c5ac03ec1 Create a standalone awk script, depends-depth-first.awk, that encapsulates
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.
2006-01-18 00:10:07 +00:00
jlam
8e0e10d3fa Initial commit of a new module that encapsulates all of the code
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.
2006-01-12 23:43:56 +00:00
rillig
d3b0a7ae64 Added the target check-interpreter to bsd.pkg.check.mk, which checks
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.
2006-01-12 00:40:19 +00:00
schmonz
ae8a1c813a Since qmail and related packages install into ${PREFIX} (and have
for a while now), we no longer need to add ${QMAILDIR} in PLIST_SUBST
or MESSAGE_SUBST. Noticed by jlam.
2006-01-11 05:48:19 +00:00
joerg
f8ae6026cd Revert unintended part of last commit. 2006-01-05 23:18:26 +00:00
joerg
c750987c17 Adjust comment about SUBST_FILES to match reality:
absolute file names work as well.
2006-01-05 23:16:01 +00:00
schmonz
094c4b78c1 Add a wee bit of infrastructure to improve how we deprecate broken
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.
2006-01-04 04:25:47 +00:00
wiz
d5a0e27f9a In the bin-install target, instead of running pkg_add for every
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.
2006-01-03 17:26:56 +00:00
jlam
d7e2d97754 Instead of patching the generated config.status script, patch the GNU
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.
2006-01-03 00:41:51 +00:00
dmcmahill
ce2d3019e4 Change some remaining ONLY_FOR_ARCHS to ONLY_FOR_PLATFORM and NOT_FOR_ARCH to
NOT_FOR_PLATFORM that were missed when these variables were changed ages ago.
2006-01-02 23:24:58 +00:00
rillig
c666e33407 Don't check for PKG_FAIL_REASON when doing show-depends-dirs. This prevents
packages that set PKG_FAIL_REASON from being excluded from the bulk build
databases like .index and .dependstree.
2005-12-31 15:20:59 +00:00
wiz
14b750b437 Fix some quoting as per PR 30956 by Chapman Flack. 2005-12-31 08:18:34 +00:00
wiz
8466aed83c If target is real-su-bin-install, set DEPENDS_TARGET to bin-install.
From Chapman Flack in PR 30928.
2005-12-31 08:05:00 +00:00
wiz
62a3e4fd03 Handle automatic dependencies in bin-install correctly.
From Chapman Flack in PR 32422.
2005-12-31 07:53:11 +00:00
jlam
4ab7433a2c Teach the pkgsrc infrastructure to Just Know when the pkginstall
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.
2005-12-29 06:18:53 +00:00
rillig
999f8b6e04 Applied all quoting fixes found by "pkglint --autofix". 2005-12-05 22:07:07 +00:00
rillig
7d139e4056 The checksums for pkgsrc patches are always checked -- even if
NO_CHECKSUM is set.
2005-12-04 15:52:32 +00:00
rillig
0f75425cfe Don't create distinfo files in the "makesum" and "makepatchsum" targets
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.
2005-12-01 11:18:30 +00:00
rillig
f39d78748c Inserted "set -e" as the first command in the show-depends-dirs target
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.
2005-12-01 00:27:56 +00:00
rillig
be7bdd3b87 The new target do-check-pkg-fail-reason should to be a dependency of
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.
2005-12-01 00:17:05 +00:00
reed
31d6bf1215 Fix REQUIRES= when ldd output has wrong number of fields.
(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.)
2005-11-29 22:18:38 +00:00
erh
4d2fdd7bd5 Per request, back out all the SKIP_AUDIT_PACKAGES changes.
bsd.pkg.mk:1.1758-1.1752
bsd.prefs.mk:1.210
bulk/build:1.79
defaults/mk.conf:1.93-1.92
2005-11-23 18:27:13 +00:00
jlam
fbde187715 Missing a line from the previous commit that would cause PKG_DB_TMPDIR
to also be forcibly created (if missing) as part of "make install".
2005-11-22 03:41:20 +00:00
jlam
02f3f44940 Create PKG_DB_TMPDIR (${WRKDIR}/.pkgdb) in a separate step from creating
${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.
2005-11-22 03:38:40 +00:00
rillig
347897565a Removed a line in the _SU_TARGET variable that had been left from
debugging.
2005-11-20 15:34:33 +00:00
rillig
6f1c497a94 Added subshell parentheses around the command for updating pkg_install.
This allows for copy&paste.
2005-11-20 08:07:30 +00:00
rillig
7c0b4711eb Reverted the SU_CMD change from between 1.1748 and 1.1749 almost
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.
2005-11-20 01:11:14 +00:00
rillig
f31a09a613 If the directory of a dependency does not exist, fail instead of (almost)
silently skipping the dependency.
2005-11-19 12:30:41 +00:00
tv
8b47f68d59 Collapse two .for blocks to improve readability:
_ULIMIT_CMD to use a ${...:@var@loop ...@} construct
_ACCEPTABLE to use a !empty(var:Mfoo) conditional
2005-11-18 17:07:13 +00:00
tv
591cd3d3db Use :D and :U constructs in a few more places to collapse some .if defined
blocks to a more parallelism-readable state.
2005-11-18 14:40:21 +00:00
tv
323473ea47 Simplify the _MASTER_SITE_{BACKUP,OVERRIDE} settings a bit by using a :D
construct rather than .if defined(), and changing := to =.
2005-11-18 14:31:54 +00:00
erh
60a3dc4c1b To support variants of make that run the shell so 'set -e' is true (shell
exits on any command failing), add a '|| ${TRUE}' when running the
check-vulnerable target in do-fetch.
2005-11-17 19:30:22 +00:00
erh
ff4b561978 Back out the previous change. The output _will_ be visible to the user.
See the "*)" case in the do-fetch target.
2005-11-17 17:18:01 +00:00
rillig
d6d32da4b7 The message that audit-packages is out-of-date is printed on stderr instead
of stdout because the latter would not show up to the user.
2005-11-17 15:57:47 +00:00
erh
8dfe14c73d Only show the message about fiddling with mk.conf if the output of
check-vulnerable actually contains some vulnerability ids.
2005-11-17 04:12:54 +00:00
erh
d2e73bdcc9 Minimum audit-packages version is _1_.40, not 0.40 2005-11-17 03:58:16 +00:00
erh
9d5fe07cb8 Missed a couple of underscores. Add them. 2005-11-16 21:43:40 +00:00
erh
e2097e6bcd Improve the handling of allowed vulnerabilities. Instead of the single
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
2005-11-16 20:59:22 +00:00
rillig
74ae2eeea9 Rewrote the _PATH_CMD command, which could not handle a PATH environment
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.
2005-11-15 21:21:01 +00:00
gavan
4cdf73d5ca make install doesn't work when updating pkg_install. Recommend make update
instead.
2005-11-15 18:03:40 +00:00
rillig
b50cd76352 Allow white-space in the PATH environment variable. Fixes PR 32079. The
shell quoting still isn't completely correct for some other variables.
This needs to be fixed, too.
2005-11-15 16:29:10 +00:00
rillig
b6a86c162f Removed trailing white-space. 2005-11-14 04:41:17 +00:00
tv
5a59befb3d Use lt_cv_sys_max_cmd_len in devel/libtool-base, too. 2005-11-09 18:42:32 +00:00
wiz
12f7a2cc85 Use new automatic flag; depend on appropriate pkg_install version. 2005-11-05 13:31:43 +00:00
rillig
8a3109674e Made the dependency directory check a little stricter. In the worst case
this could produce extra warnings. It does not affect the rest of the
build process at all.
2005-11-05 09:37:10 +00:00
rillig
c0a96d5c06 The last fix did not work. Completely reverted the unintended part of
the last changes.
2005-11-04 21:26:19 +00:00
rillig
b85f8bc360 Replaced "done" with "esac" to fix a syntax error. 2005-11-04 20:52:38 +00:00
jlam
290846b86d Relax rules a bit on INSTALLATION_DIRS -- we still enforce that
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.
2005-11-04 20:36:42 +00:00
jlam
27daa6762a back out part of previous commit that was unintended. 2005-11-04 20:28:47 +00:00
jlam
8ab0dedc95 Use ${SLEEP} instead of sleep, and note that we use the sleep tool if
we're doing locking.
2005-11-04 20:06:14 +00:00
rillig
87cb035b9e Now that all packages using CONFIGURE_DIRS have been checked (and
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)
2005-11-04 11:27:41 +00:00
rillig
214f327f1b Removed the unused variable GNU_CONFIGURE_INFODIR, as suggested by
Stoned Elipod.
2005-11-02 18:32:19 +00:00
rillig
c6348f404b Changed back the default values for GNU_CONFIGURE_{INFO,MAN}DIR to what
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.
2005-10-31 09:50:44 +00:00
rillig
1b6c14947f Added two new variables, GNU_CONFIGURE_INFODIR and GNU_CONFIGURE_MANDIR.
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.
2005-10-31 09:42:19 +00:00
wiz
d31a568858 Use correct (internal) variable for pkg_add arguments. 2005-10-24 23:23:00 +00:00
rillig
a79249a753 Use $${foo} instead of $$foo to prevent ident(1) from reporting false
positives. No functional changes.
2005-10-24 18:28:42 +00:00
minskim
2ee4956c8b Pass PKG_REQD through shell environment, instead of arguments of make,
so that a dependent package can override it properly.  This makes
INSTALL_MAKE_FLAGS work when a package is installed as a dependency.
2005-10-23 16:58:42 +00:00
tv
38e53d7c11 Use show-vars-eval in show-needs-update. 2005-10-16 17:48:24 +00:00
tv
c46824e8da Add "show-vars-eval" target, which outputs eval-able shell expressions
to allow easy setting of multiple variables in one invocation.
2005-10-16 17:44:45 +00:00
reed
899ff50d6a For INSTALLATION_DIRS, use ${PKGMANDIR} instead of "man".
Also before it used a wildcard for *man and now get rid of that
wildcard in front.
2005-10-10 17:37:17 +00:00
rillig
7102a2e633 CONFIGURE_DIRS, BUILD_DIRS, TEST_DIRS and INSTALL_DIRS are interpreted
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.
2005-10-08 13:16:28 +00:00
rillig
26cc823fb4 Renamed HTML_PKGNAME to _HTML_PKGLINK, which describes its contents more
precisely. Added _HTML_PKGNAME and _HTML_PKGPATH variables for better
readability. Fixed quoting style in print-summary-data.
2005-10-07 17:39:28 +00:00
rillig
1855c76620 Replaced some if's with case's to make the code simpler. Merged
multiple ${ECHO_N} into one ${ECHO}.
2005-10-07 16:57:14 +00:00
reed
f2979429c1 For print-PLIST generation, make sure that ${PKGMANDIR} becomes "man". 2005-10-06 15:25:47 +00:00
seb
a978535e92 whitespace police. 2005-10-04 20:50:49 +00:00
reed
77b8a236ae Add PKGMANDIR in the MAKE_ENV.
(Previously in my own pkgsrc I had done this in
various individual makefiles.)
2005-10-04 17:43:57 +00:00
reed
4d913ad2d9 Remove accidental extra space.
And also fix four places using spaces instead of a tab to be consistent.
(For some reason my cvs diff didn't show anything though.)
2005-10-04 17:33:44 +00:00
reed
15356d0dfb Add custom PKGMANDIR setting to mk/defaults/mk.conf. This is a
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.)
2005-10-04 17:27:00 +00:00
reed
8f1da2c3e0 In man page routines, match the "cat" sub-directories
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.)
2005-10-04 16:45:25 +00:00
rillig
5ebf566f7d Added a variable LICENSE_FILE that may be set to point to the license
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.
2005-09-28 08:24:52 +00:00
jlam
fe848c1105 Remove the CHECK_FILES bits during deinstall so that they are regenerated
from scratch during a reinstall.  This makes CHECK_FILES more useful when
debugging packages with broken PLISTs.
2005-09-16 06:09:02 +00:00
xtraeme
e07a2c7d8b _RESUME_TRANSFER: only try to get the value of the temp file when it's
available.
2005-08-26 14:47:30 +00:00
jlam
f1e3e67038 INSTALLATION_DIRS implies NO_MTREE: If a package sets INSTALLATION_DIRS,
then it's known to pre-create all of the directories that it needs at
install-time, so we don't need mtree to do it for us.
2005-08-18 19:24:15 +00:00
jlam
9dcc7aa6ed Fix an annoying whitespace issue for 80 character-width displays. 2005-08-15 17:35:45 +00:00
rillig
60e46baa8e In print-pkg-size-this, initialize s before summing up all file sizes. This
results in "0" being printed for empty packages, which had been "" before.
Fixes PR 30955.
2005-08-15 13:05:18 +00:00
rillig
fee89c334d Reverted the change from revision 1.1710, which sorted all DEPENDS and
BUILD_DEPENDS alphabetically. Some packages depend on the
first-come-first-serve order.
2005-08-14 19:52:26 +00:00
kristerw
493773dd73 The check-files-post need to be done before post-install-script,
to prevent errors from pacakes using e.g. CONF_FILES.
2005-08-14 17:26:13 +00:00
kristerw
7af58065d9 Move the check-files-post check so that it is done after the automatic
manual page handling.  This prevents the check from reporting errors
for manpages that are (un)compressed by the automatic manual page handling.
2005-08-10 18:21:07 +00:00
veego
51a055db51 Restore the @(..)s which were removed in rev 1.1706.
They are needed in the fetch-list case to prevent outputting anything if
the distfile is allready in $DISTDIR.
2005-08-08 15:38:19 +00:00
rillig
4b97388467 Sort the dependencies list alphabetically when checking if they are
installed. That makes it easier to check if a specific package is listed
or not.
2005-07-22 18:59:55 +00:00
jlam
4032855bac Override the INSTALL setting in sys.mk that messes up the rest of the
logic in the tools framework.
2005-07-17 04:17:09 +00:00
jlam
3e474a90d8 Get rid of USE_PERL5. The new way to express needing the Perl executable
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.
2005-07-16 01:19:06 +00:00
jlam
bf9129c41e Drop distinction between PKGSRC_USE_TOOLS and USE_TOOLS by making
PKGSRC_USE_TOOLS go away.  There is now only a single USE_TOOLS variable
that specifies all of the tools we need to build/run the package.
2005-07-15 18:27:48 +00:00
reed
c3c7946905 For the fetch-list target: Do not use mkdir if just creating a shell
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.)
2005-07-06 05:52:34 +00:00
rillig
8506e905d6 pkglint does not output any "OK" lines by default, so there's no need to
filter them out.
2005-06-27 16:25:43 +00:00
wiz
2baa8b4a15 Improve English in warning. From Rhialto in PR 30610. (second occurrence) 2005-06-27 13:34:41 +00:00
wiz
6328437570 Improve English in warning. From Rhialto in PR 30610. 2005-06-27 13:33:55 +00:00
jlam
6efbd72779 Clean up some clutter in pkgsrc/mk: move the ${OPSYS}.*.dist mtree
files into mk/platform, where they now live with the ${OPSYS}.mk files.
2005-06-23 18:41:57 +00:00
wiz
085d1a2044 Back out previous -- committed by mistake. 2005-06-23 12:12:11 +00:00
wiz
e95f3821fb Add missing line continuation backslashes.
Noted by Jukka Salmi.
2005-06-23 12:11:07 +00:00
jlam
5d1e8de6bc Split out the check-wrkref implementation and related variables from
bsd.pkg.mk into bsd.pkg.check.mk file.
2005-06-23 09:02:46 +00:00
jlam
6ae4606464 Split out the check-files implementation and related variables into
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.
2005-06-23 08:31:20 +00:00
jlam
8d486b1ebd Reverse the checks for the value of CHECK_WRKREF so that if it's value
isn't "no", then we run the checks.  This allows for possibly making
CHECK_WRKREF a more multi-valued option or list in the future.
2005-06-23 04:15:47 +00:00
jlam
ccd8fe4d4c Allow the test for whether the file is a text file to be overridden via
CHECK_WRKREF_IS_TEXT_FILE.
2005-06-14 22:02:00 +00:00
jlam
1ffcef48db In the check-wrkref target, change the algorithm so that text files
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.
2005-06-13 02:25:50 +00:00
jlam
df53a167da Add a default fall-through for the shell case statement (portability
issue).
2005-06-11 04:26:17 +00:00
jlam
d8e783d924 check-wrkref is a make target that greps through the installed files
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.
2005-06-10 23:38:00 +00:00
jlam
29ef35e288 General improvements to the changes-entry target:
* 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.
2005-06-09 16:26:23 +00:00
jlam
94f3443509 Don't reinvent PKGPATH, which already contains just the "category/package"
portion of the path.
2005-06-09 16:09:58 +00:00
jlam
1ad3a3bdd6 Add a documentation block above the changes-entry target. 2005-06-09 16:08:27 +00:00
wiz
16b3e5b4cc Delay running of id until it is needed. Fixes PR 30477 by Neil Hoggarth. 2005-06-09 10:09:58 +00:00
wiz
c209ba29cb Add changes-entry target, which adds an entry for the current package
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.
2005-06-08 22:44:08 +00:00
rillig
e3aa46eedc Added a leading underscore to the names of the *_COOKIE variables, as they
are not part of the public interface.
2005-06-04 20:56:47 +00:00
jlam
a741f4ed26 Back out revision 1.1684. MAKEFLAGS was being propagated incorrectly
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.
2005-06-03 20:22:59 +00:00
jlam
95fd1f6ec9 Massive cleanup of buildlink3.mk and builtin.mk files in pkgsrc.
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.
2005-06-01 18:02:37 +00:00
jlam
d811860c7b *.makevars.mk doesn't exist until after ${WRKDIR} is created, which
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.
2005-06-01 17:27:22 +00:00
jlam
a72cd1c453 Include bsd.makevars.mk in bsd.prefs.mk instead of bsd.pkg.mk. This
allows the saved make variables to be re-set whenever bsd.prefs.mk is
included, and is a shortcut for the common case where a Makefile
includes both.
2005-06-01 17:05:19 +00:00
jlam
4631a73a95 Separate out the logic to include the correct <phase>.makevars.mk file
into a new file bsd.makevars.mk that can be included by other Makefiles.
2005-06-01 03:04:16 +00:00
jlam
54de37e60e Convert USE_GNU_TOOLS into USE_TOOLS as the former is no longer supported
in pkgsrc.
2005-05-31 21:53:26 +00:00
dillo
8cda012601 Rename describe-options to show-options, replacing the old show-options
target.
2005-05-31 12:10:07 +00:00
jmmv
d5789c138e Simplify unprivileged builds by adding a new variable, UNPRIVILEGED, that,
when set to YES, changes multiple defaults to let this work properly.
2005-05-29 17:12:15 +00:00
rillig
c7b8094edd Fixed the output of show-tools. 2005-05-26 11:15:30 +00:00
jlam
6a44e12a0b Finish removing instances of _USE_NEW_TOOLS from pkgsrc. 2005-05-22 20:15:40 +00:00
jlam
9f94b112f0 Remove the old tools framework and references to _USE_NEW_TOOLS. 2005-05-22 19:11:12 +00:00
rillig
aeb4d04119 Fixed some quoting issues. 2005-05-22 15:31:03 +00:00
jlam
1cfa811f1b In computing _REPLACE_LOCALEDIR_PATTERNS_FIND_cmd, make sure the :sh
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.
2005-05-21 01:55:53 +00:00
jlam
262ed77f43 Change instances where we stored shell command in a make variable into
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.
2005-05-20 21:36:05 +00:00
rillig
296e86963f Replaced the NO_WRKDIR_SYMLINK variable with CREATE_WRKDIR_SYMLINK, as
suggested by Alistair. If you don't want the symlinks, set the variable
to "no".
2005-05-18 23:59:44 +00:00
rillig
e6648d55fb If NO_WRKDIR_SYMLINK is defined, no symlink to ${WRKSRC} is created when
the WRKOBJDIR is set explicitly. This allows for having pkgsrc mounted
r/w without actually modifying it.
2005-05-18 19:42:01 +00:00
rillig
8a83e6b802 Added the show-tools target, which emits a shell code fragment defining all
tools known to the pkgsrc infrastructure.
2005-05-18 02:52:38 +00:00
jlam
876fcd9d31 Turn _MANCOMPRESSED into a strictly "yes" and "no" variable
(case-sensitive) to simplify writing the do-install target code that
automatically compresses or decompresses man pages after installation.
2005-05-17 22:07:56 +00:00
dmcmahill
832614bc4c Rework the README.html generation code. Major changes are:
- 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.
2005-05-17 21:46:59 +00:00
jlam
62c3dfb798 Save the names of the patches applied during the patch phase into the
patch cookie file, one per line.  A package with no patches applied
will have a patch cookie file with no lines (zero bytes).
2005-05-17 06:31:00 +00:00
jlam
e87497f3c3 Don't have USE_TOOLS+=imake replace USE_IMAKE. Rather let the former
specify that imake is used by the package, while the latter triggers
the special do-configure process.
2005-05-16 18:01:12 +00:00
jlam
d48540d243 Fix mistake in previous commit -- expr is required by the wrapper
framework.  Problem & fix from tron@.
2005-05-16 15:20:15 +00:00