Commit graph

39 commits

Author SHA1 Message Date
jlam
4dde9bc3a4 Move the +SHLIBS generation code back into the pkginstall module. In the
plist module, it was being "defined" too late, and the pkginstall module
never created any +SHLIBS scripts.  Sidestep the tools problems with
SHLIB_TYPE by pretending they don't exist (for now).

XXX SHLIB_TYPE needs to be re-thought or removed altogether.
2007-07-27 18:37:35 +00:00
jlam
9bb51d11c7 Putting bsd.pkginstall.mk under bsd.tools.mk was a bad idea -- the
former set several USE_TOOLS lines that were being missed by bsd.tools.mk.

Rearrange the +SHLIBS code so that bsd.tools.mk can now be included
after bsd.pkginstall.mk again.  The +SHLIBS code has now been moved
over to the plist module, which is so far the repository for all of
the shlib-type handling.

This should fix the problem with fonts handling being broken.
2007-07-23 15:23:46 +00:00
jlam
b07ac962c6 Reversed file descriptors 1 and 2... time for a coffee break... 2007-07-18 18:55:56 +00:00
jlam
e11696b2dd Ignore the result of the ldconfig command. 2007-07-18 18:53:18 +00:00
jlam
e586cdd924 PKG_METADATADIR is the *second* argument. 2007-07-18 18:46:12 +00:00
jlam
681069ad5f Add missing definition for "$ACTION", which is the first argument to the
+SHLIBS script.
2007-07-18 18:43:05 +00:00
jlam
2d76049e1e Add back a facility to rebuild the run-time library search paths database
on platforms that need it.

XXX Right now, if the platform needs it, then it runs for every package.
XXX This needs to be fixed to only run for packages that install shared
XXX libraries.

* Move mk/plist/shlib-type to mk/scripts.

* Move definition of SHLIB_TYPE from mk/plist/plist.mk to bsd.pkg.mk.

* Move inclusion of bsd.pkginstall.mk below bsd.tools.mk so that it
  can use SHLIB_TYPE.  This is necessary because SHLIB_TYPE's value
  is the result of evaluating a command, and the command needs "TOOL"
  definitions provided by bsd.tools.mk.
2007-07-18 18:01:02 +00:00
jlam
83f1c3afae * Add a user-settable variable to tune the default verbosity of the
+INSTALL and +DEINSTALL scripts:

  PKGINSTALL_VERBOSE
	A list of scriptlets that will be verbose and output a message
	noting the actions taken.

	* "all" is a special value that implies all of the other items
	* "fonts" for +FONTS
	* "info-files" for +INFO_FILES

	Default value: "all" for PKG_DEVELOPERs, empty otherwise.

* Be "one-liner brief" when doing the default actions.  For example,
  the info files output now looks like:

	gmake-3.81: registering info file /usr/pkg/info/make.info

  We retain the current verbosity for the CHECK-* actions.
2007-07-12 19:41:46 +00:00
jlam
c616c5fb10 On second thought, maybe the rest of the world's software isn't as
well-audited as NetBSD's /usr/bin/su.  Change the default
SETUID_ROOT_PERMS to 4511 to raise the bar slightly on finding
vulnerabilities in setuid-root binaries.
2007-06-15 22:04:33 +00:00
jlam
ac27702398 Change the default setuid-root permissions from 4711 to 4555. This
strips off the write bit for root and gets rid of the unnecessary lack
of read permissions for "group" and "other".  Inspired by /usr/bin/su
on NetBSD.
2007-06-15 14:46:02 +00:00
jlam
bfa6395385 Document PKG_SYSCONFDIR_PERMS, which has existed for quite some time. 2007-06-15 14:14:36 +00:00
rillig
49052c55cc Added keywords for SPECIAL_PERMS, so it is found by
"bmake help topic=setuid".
2007-03-13 09:43:59 +00:00
joerg
24f2398eb9 ... and quote the $ for subst so that ${RM} ends up in the final file. 2007-01-24 14:33:50 +00:00
joerg
62b0e7af34 *blush* Fix variable substituation to not substitute the same string
twice.
2007-01-24 13:26:26 +00:00
rillig
9802f825b9 Reformatted the documentation of INFO_DIR to make it suitable for "make
help".
2007-01-02 17:15:24 +00:00
joerg
f3ec0636be Add fonts magic for TrueType and Type1 fonts.
XXX Do we want to prefer mkfontscale on other installations as well?
2007-01-02 11:47:26 +00:00
obache
bee48189f3 Relative $infodir is allowed, so if it's relative, add ${PREFIX}. 2006-12-29 07:06:31 +00:00
martti
e2610fb8c8 Remove trailing tabs. 2006-12-15 13:15:06 +00:00
martti
2cc4216d5e Remove trailing spaces. 2006-12-15 12:46:23 +00:00
joerg
8e79aa8c40 Rename _INSTALL_ROOT_USER to REAL_ROOT_USER. Use it as default for
SETUID_ROOT_PERMS.
2006-11-05 15:10:08 +00:00
joerg
7bf4961562 RC scripts should be installed relative to DESTDIR as well. 2006-11-05 14:51:24 +00:00
ben
4c1456124a Linux shadow-utils provides a useradd that fails when creating a home
directory under a base directory hat does not exist.  Add workaround
to ensure that the base directory does exist.  This addresses PR#34779
2006-10-12 23:10:55 +00:00
joerg
7545d135e6 - Compute CHEKCK_FILES filter on the entries requested and keep it
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.
2006-09-22 21:53:56 +00:00
jlam
fa2d895a21 Be more conservative and avoid possible shell implementation differences
by not using `...` inside ${...#...}.
2006-07-19 22:26:26 +00:00
jlam
034c5b9566 Add messages noting when the PRE-INSTALL and POST-INSTALL actions are run. 2006-07-19 18:05:35 +00:00
wiz
7288c31942 Fix grammar in messages. From David A. Holland in PR 33975. 2006-07-11 13:28:32 +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
jlam
e811379bc2 Pluralize INSTALL_TEMPLATE and DEINSTALL_TEMPLATE variable names as per
the pkglint warning:

    As {INSTALL,DEINSTALL}_TEMPLATE is modified using "+=", its name
    should indicate plural.

This does make the variables a bit more suggestive of the fact that they
hold lists of values.
2006-06-15 22:13:58 +00:00
jlam
fa494e1722 make(1) will automatically delete partially made targets if the target
creation fails, so remove instances where temporary files were created
then moved to the final target filename, and just directly create the
target.  This is just for brevity/clarity, and saves a few tool calls.
2006-06-09 16:41:09 +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
0c1e91164b Avoid using ::= construct which apparently is somewhat buggy in bmake.
This hopefully fixes user/group creation problems on platforms using
bootstrap bmake, e.g. Solaris.  Problem noted by adrianp in private
email.
2006-06-08 03:30:37 +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
8efe9d7045 Avoid using PKGNAME in target names since they are "immediately"
resolved in much the same manner as variables set using :=.  PKGNAME
could be set after including bsd.pkg.mk (which is poor form), and it's
too close to the pkgsrc-2006Q2 branch to fix that all over pkgsrc at
this time).  This fixes building shells/static-bash2.
2006-06-06 19:49:52 +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
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
jlam
143b5f7d14 Move mk/install to mk/pkginstall to better reflect the contents (the
pkginstall framework).
2006-05-21 23:50:15 +00:00