Commit graph

117 commits

Author SHA1 Message Date
rillig
85575fe696 Added _VARGROUPS. 2007-10-10 02:37:13 +00:00
joerg
961f2e2499 For DESTDIR operation, no need to filter out old files. 2007-08-20 10:59:53 +00:00
joerg
34c60ba2a2 Update _USE_DESTDIR=full handling to use the new -u/-g code and
require pkg_install-20070802 for using it. It is now considered
to work correctly and ready for general consumption.
2007-08-03 14:03:39 +00:00
jlam
639a93d743 Don't substitute for OPSYS- or ARCH-related variables in print-plist
if EMUL_PLATFORMS is defined.  This facilitates making
EMUL_PLATFORM-specific PLISTs.
2007-07-31 19:51:01 +00:00
jlam
33f30156fb * Add new emulator framework in pkgsrc/mk/emulator that handles all
binary-only packages that require binary "emulation" on the native
  operating system.  Please see pkgsrc/mk/emulator/README for more
  details.

* Teach the plist framework to automatically use any existing
  PLIST.${EMUL_PLATFORM} as part of the default PLIST_SRC definition.

* Convert all of the binary-only packages in pkgsrc to use the
  emulator framework.  Most of them have been tested to install and
  deinstall correctly.  This involves the following cleanup actions:

    * Remove use of custom PLIST code and use PLIST.${EMUL_PLATFORM}
      more consistently.

    * Simplify packages by using default INSTALL and DEINSTALL scripts
      instead of custom INSTALL/DEINSTALL code.

    * Remove "SUSE_COMPAT32" and "PKG_OPTIONS.suse" from pkgsrc.
      Packages only need to state exactly which emulations they support,
      and the framework handles any i386-on-x86_64 or sparc-on-sparc64
      uses.

    * Remove "USE_NATIVE_LINUX" from pkgsrc.  The framework will
      automatically detect when the package is installing on Linux.

  Specific changes to packages include:

    * Bump the PKGREVISIONs for all of the suse100* and suse91* packages
      due to changes in the +INSTALL/+DEINSTALL scripts used in all
      of the packages.

    * Remove pkgsrc/emulators/suse_linux, which is unused by any
      packages.

    * cad/lc -- remove custom code to create the distinfo file for
	all supported platforms; just use "emul-fetch" and "emul-distinfo"
	instead.

    * lang/Cg-compiler -- install the shared libraries under ${EMULDIR}
	instead of ${PREFIX}/lib so that compiled programs will find
	the shared libraries.

    * mail/thunderbird-bin-nightly -- update to latest binary
	distributions for supported platforms.

    * multimedia/ns-flash -- update Linux version to 9.0.48 as the
	older version is no longer available for interactive fetch.

    * security/uvscan -- set LD_LIBRARY_PATH explicitly so that
	it's not necessary to install library symlinks into
	${EMULDIR}/usr/local/lib.

    * www/firefox-bin-flash -- update Linux version to 9.0.48 as the
	older version is no longer available for interactive fetch.
2007-07-29 05:18:36 +00:00
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
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
12d6ee2282 Preserve the default value of PLIST_SRC as PLIST_SRC_DFLT while still
allowing PLIST_SRC to be overridden in a package Makefile.

It's now possible to do:

	PLIST_SRC=	${PLIST_SRC_DFLT} ${WRKDIR}/PLIST_DYNAMIC

and still use the default PLIST.* fragment handling.
2007-07-18 14:12:30 +00:00
wiz
73da25f40a + be@latin for libwnck. 2007-07-03 19:40:43 +00:00
joerg
409b183fc0 Remove USE_MTREE support. Keep one copy (the NetBSD version) for
the purpose of print-PLIST in plist/common-dirs.mtree.

Discussed with wiz@, no objections on tech-pkg@.
2007-07-02 14:54:09 +00:00
rillig
4c3c864e51 Fixed the description of PLIST_SRC. 2007-06-09 11:02:23 +00:00
heinz
a215fa598d Changed suffix for _PLIST_NOKEYWORDS to be more in line with other files
in WRKDIR.
2007-05-28 13:59:10 +00:00
heinz
ada9d78f21 In order to avoid incorrect information about needed shared libraries in
+BUILD_INFO we must ensure that we only test valid lines from PLIST and
not lines like "@unexec /bin/rmdir..." where "/bin/rmdir" is not a part
of the resulting package.
To achieve this, a stripped version of PLIST, called _PLIST_NOKEYWORDS,
is introduced.
2007-05-28 13:54:25 +00:00
tnn
446bd88591 rename shared modules from .so to .sl 2007-04-22 19:54:44 +00:00
tnn
b2d49fdea7 .so -> .sl substitution 2007-04-21 14:15:59 +00:00
tnn
4fb278e0f0 add awk script to be used for Spectrum Object Module shlib handling. 2007-04-19 23:13:42 +00:00
tnn
d7b532d96e ECOFF on OSF1 behaves like ELF as far as PLISTs are concerned. 2007-04-11 19:01:00 +00:00
rillig
528cd68dee Fixed a GNU awk warning about quoting. 2007-03-07 16:32:45 +00:00
wiz
5dce6c7d9d Make MTREE_FILE and MTREE_ARGS internal by prefixing them with '_'.
They are not supposed to be set by the user.
2007-03-02 09:08:33 +00:00
uebayasi
2a60f0037b A missing quote. 2007-02-20 09:22:14 +00:00
joerg
bf76172a69 Font-related entries we skip for CHECK_FILES should be skipped for
print-PLIST as well.
2006-11-15 10:40:34 +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
aa237578e1 Include some more magic to set ownership of packages build with
use-destdir to ${ROOT_USER}:${ROOT_GROU}. This allows us to safely
use it on all packages which don't install setuid/setgid binaries.
2006-10-15 16:20:34 +00:00
joerg
5b374e445d Main infrastructure for DESTDIR support.
Packages may set PKG_DESTDIR_SUPPORT to either "destdir" or
"user-destdir" to flag support for this, following the same
rules as PKG_INSTALLATION_TYPES (e.g. define before first include
of bsd.prefs.mk).

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

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

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

This commit does not change the handling of DEPENDS_TARGET or
bin-install to allow recursive usage.
2006-10-09 12:25:44 +00:00
jlam
80369fb5c8 Modify the shlib-type script so that it doesn't need to compile anything
-- 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.
2006-07-21 13:40:27 +00:00
rillig
2221827892 Split the variable BUILD_DEFS into those that are defined by packages
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.
2006-07-15 23:58:52 +00:00
jlam
356f5e8af5 Rename <phase>_COOKIE variables to _COOKIE.<phase>. These are private
variables so there are no user-visible changes.  This change just makes
it a little easier to write for loops.
2006-07-07 21:24:27 +00:00
jlam
92a54f35b8 Fix an inverted test that caused all catman pages to be stripped from
the PLIST on platforms where IMAKE_MANINSTALL != MANINSTALL, e.g.
Solaris.  Solution noted by adrianp in private email.  This should fix
the problem noted in PR pkg/33629.
2006-06-08 03:11:17 +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
9425b46021 Removed superfluous backslashes. 2006-06-01 07:11:09 +00:00
rillig
68ade070e9 In AWK string literals, backslashes must be doubled. Otherwise they are
simply discarded.
2006-06-01 06:12:48 +00:00
jlam
5ff73b27ca When filtering out unrelated info files, only check the last bit of
the name instead of the whole name.  This avoids some problems where
the file name contains awk-special characters, e.g. +.
2006-05-29 20:01:39 +00:00
seb
ad25735eb4 Re-add ${PREFIX} to the list of directories print-PLIST target
should ignore or it is broken for packages that installing files right
under ${PREFIX}.  Example in lang/sun-jre15:
$ make print-PLIST
...
@dirrm java/sun-1.5
ls: /usr/pkg//usr/pkg/.: No such file or directory
@dirrm /usr/pkg/.
$

It looks to me that was removed by mistake in revision 1.5
of this file.
2006-05-14 14:27:41 +00:00
minskim
c43654731a Apply PRINT_PLIST_AWK and _PLIST_PLIST_AWK_SUBST in the same order
for both files and directories.
2006-05-09 21:37:33 +00:00
jlam
1c8d9b58f1 Use brackets "[]" to quote characters instead of backslash "\". This
is more bulletproof across different versions of awk.  From PR pkg/33410
by Aleksey Cheusov.
2006-05-02 14:32:35 +00:00
rillig
4dcf0c7e97 Added the shebang line. 2006-04-24 01:31:04 +00:00
jlam
138140738b Only do the locale transformation if USE_PKGLOCALEDIR is defined. This
avoids any problems with current packages that install locale files but
don't honor PKGLOCALEDIR yet.
2006-04-17 06:30:48 +00:00
jlam
d19161d212 Modify the plist module to automatically transform "^share/locale" in
PLISTs to "${PKGLOCALEDIR}/locale" for the installed PLIST.  This is
similar to the work that's already done to automatically handle
PKGINFODIR and PKGMANDIR.  PLISTs in pkgsrc will be modified so that
they would just list the message files to be under "share/locale".
USE_PKGLOCALEDIR must continue to be set in package Makefiles so that
localedir substitutions happen at post-configure time.
2006-04-17 06:12:46 +00:00
jlam
f85023f9da Now that all info file entries have been pushed from INFO_FILES into
the PLISTs, drop support for listing info files in INFO_FILES.  The
INFO_FILES variable is now strictly defined/undefined.
2006-04-16 04:27:17 +00:00
minskim
45ddb3557a Apply jlam's awk fix done in plist-info.awk 1.12.
- Avoid () as a regular expression as the interpretation seems to be
    implementation-defined by various awks.
2006-04-15 04:25:17 +00:00
jlam
c3dcd17e53 Avoid () as a regular expression as the interpretation seems to be
implementation-defined by various awks.
2006-04-14 13:23:42 +00:00
jlam
694478afb8 If the info file doesn't exist on the disk, we should still output an
entry for it in the final PLIST.  This allows us to locate info files
in the PLIST that aren't on the system during the CHECK_FILES stage.
2006-04-12 20:49:12 +00:00
jlam
7cc69019ce Create a new variable IGNORE_LIBTOOLIZE containing files which should
not be expanded by the plist module.
2006-04-05 05:54:01 +00:00
jlam
833aaa4f40 Whitespace changes. 2006-03-30 03:03:52 +00:00
jlam
df10fbdf66 Skip symlinks without emitting warnings during PLIST creation as these
are harmless.
2006-03-30 03:02:40 +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
56082f039b Properly rename "info" to ${INFO_DIR} in any @dirrm statements. Also
add a guard so that we don't re-expand any "info" in ${INFO_DIR} again.
2006-03-14 23:16:01 +00:00
jlam
e9045e1673 Teach the plist framework a new variable IGNORE_INFO_DIRS that is a
list of ${PREFIX}-relative paths of directories that do *not* contain
info files.  This allows avoiding the auto info-file-entry munging
that occurs for all PLIST entries that are in directories named "info".
2006-03-14 17:14:47 +00:00
jlam
e7f393b63b Sort _PLIST_AWK_ENV. 2006-03-14 16:54:28 +00:00
jlam
495bdf8ee8 Restructure pattern-actions a bit so that we're not lumping everything
into the last action.  This makes it easier to understand the flow.
2006-03-14 15:32:18 +00:00
jlam
ddf2e29cda Check that INFO_FILES is defined before using its value. Fixes PR pkg/33043. 2006-03-09 16:39:39 +00:00
jlam
b441b074cb Handle info directory trees that aren't rooted directly in ${PREFIX}, e.g.
${PREFIX}/<pkg>/info, etc.
2006-03-04 22:06:03 +00:00
jlam
15d65cd972 Info pages don't always end in ".info" as noted in PR pkg/32699. Fix the
PLIST handling based on the suggestion in the PR by Johan Danielsson.
This restores the behavior from the old PLIST code.
2006-02-07 19:18:42 +00:00
jlam
8651991fd4 Fix typo in comment. 2006-02-07 18:43:02 +00:00
jlam
4ed0831994 Provide default values for various variables if they're not present in
the shell environment array ENVIRON.
2006-02-07 18:42:38 +00:00
rillig
cd3132099e warning: escape sequence \.' treated as plain .' 2006-02-05 16:21:07 +00:00
rillig
b723cdb4c4 plist-info.awk:80: warning: escape sequence \.' treated as plain .' 2006-02-05 16:12:56 +00:00
jlam
64000a0f19 SUS says awk's delete command only deletes array elements, not the array
itself.
2006-01-22 16:54:13 +00:00
jlam
91a276733e Fix a weird newline error (probably cut-and-paste error). 2006-01-21 14:44:34 +00:00
jlam
d4a3fc56e6 Fix a typo in the comment. 2006-01-19 17:24:44 +00:00
jlam
0533f0f79e Add a catman page to the script comments to clarify how this script
should be used.  Also, do a minor reordering of lines so that the logic
is more clear.
2006-01-19 17:22:26 +00:00
seb
060fe0fd29 Signature police. 2006-01-14 00:58:37 +00:00
jlam
1591f24e5d Make use of ${.TARGET} within a target instead of re-specifying the
file again.
2006-01-13 23:09:39 +00:00
jlam
8da0cdded2 Remove the show-shlib-type target since it's no longer needed ... the
same value is returned by querying for SHLIB_TYPE via show-var, so
convert the only remaining use of show-shlib-type to just use SHLIB_TYPE.
2006-01-13 22:37:02 +00:00
jlam
cefd18eb01 Force compression and decompression to avoid the default behavior of
gzip/gunzip where hard-linked files aren't compressed/decompressed.
2006-01-13 20:03:26 +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