From 8b7a42ed902e8b6d1413fc3d98519a51d83e592e Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 26 Jun 1998 16:39:23 +0000 Subject: Add xpkgwedge, an experimental patch that enables the build of X11 pkgs (even imake ones) that will install in /usr/pkg instead of /usr/X11R6. This is NOT (yet?) the standard X11 pkg build procedure, but it does provide a "way out" for users that do not want to pollute their /usr/X11R6 tree with pkgs. --- pkgtools/xpkgwedge/Makefile | 32 ++++++++++++++++++++++++++++++++ pkgtools/xpkgwedge/files/Imakefile | 10 ++++++++++ pkgtools/xpkgwedge/files/md5 | 1 + pkgtools/xpkgwedge/files/xpkgwedge.def | 33 +++++++++++++++++++++++++++++++++ pkgtools/xpkgwedge/pkg/COMMENT | 1 + pkgtools/xpkgwedge/pkg/DEINSTALL | 16 ++++++++++++++++ pkgtools/xpkgwedge/pkg/DESCR | 3 +++ pkgtools/xpkgwedge/pkg/MESSAGE | 18 ++++++++++++++++++ pkgtools/xpkgwedge/pkg/PLIST | 3 +++ 9 files changed, 117 insertions(+) create mode 100644 pkgtools/xpkgwedge/Makefile create mode 100644 pkgtools/xpkgwedge/files/Imakefile create mode 100644 pkgtools/xpkgwedge/files/md5 create mode 100644 pkgtools/xpkgwedge/files/xpkgwedge.def create mode 100644 pkgtools/xpkgwedge/pkg/COMMENT create mode 100755 pkgtools/xpkgwedge/pkg/DEINSTALL create mode 100644 pkgtools/xpkgwedge/pkg/DESCR create mode 100644 pkgtools/xpkgwedge/pkg/MESSAGE create mode 100644 pkgtools/xpkgwedge/pkg/PLIST (limited to 'pkgtools') diff --git a/pkgtools/xpkgwedge/Makefile b/pkgtools/xpkgwedge/Makefile new file mode 100644 index 00000000000..90af81e608e --- /dev/null +++ b/pkgtools/xpkgwedge/Makefile @@ -0,0 +1,32 @@ +# $NetBSD: Makefile,v 1.1 1998/06/26 16:39:23 tv Exp $ +# + +DISTNAME= xpkgwedge-0.1 +CATEGORIES= devel x11 +DISTFILES= # none + +MAINTAINER= tv@netbsd.org + +RESTRICTED= optional # NOT for distro as a "binary" pkg +IS_INTERACTIVE= yes # should not be built when batch + +NO_BUILD= yes +NO_WRKSUBDIR= yes +USE_IMAKE= yes + +pre-extract: + @if [ x${LOCALBASE} = x${X11BASE} ]; then \ + ${ECHO} '$$LOCALBASE == $$X11BASE; this patch cannot be applied.'; \ + ${ECHO} 'During install, xpkgwedge requires $$X11BASE to point to the real X distribution.'; \ + ${ECHO} 'If you are setting this variable in mk.conf, remove the setting temporarily'; \ + ${ECHO} 'and then install xpkgwedge.'; \ + ${FALSE}; \ + fi + +pre-configure: + @${CP} ${FILESDIR}/Imakefile ${FILESDIR}/xpkgwedge.def ${WRKSRC} + +post-install: + @${SED} -e s,@@PREFIX@@,${LOCALBASE}, ${PKGDIR}/MESSAGE + +.include "../../mk/bsd.pkg.mk" diff --git a/pkgtools/xpkgwedge/files/Imakefile b/pkgtools/xpkgwedge/files/Imakefile new file mode 100644 index 00000000000..b9d01d0360b --- /dev/null +++ b/pkgtools/xpkgwedge/files/Imakefile @@ -0,0 +1,10 @@ +# in case this hack is already installed +X11_ROOT ?= ProjectRoot +PREFIX = ${X11_ROOT} + +install:: + ${BSD_INSTALL_DATA} xpkgwedge.def ${CONFIGDIR} + @echo updating ${CONFIGDIR}/host.def + @echo '#include ' >${CONFIGDIR}/host.def.new + @grep -v xpkgwedge ${CONFIGDIR}/host.def >>${CONFIGDIR}/host.def.new || true + @mv -f ${CONFIGDIR}/host.def.new ${CONFIGDIR}/host.def diff --git a/pkgtools/xpkgwedge/files/md5 b/pkgtools/xpkgwedge/files/md5 new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/pkgtools/xpkgwedge/files/md5 @@ -0,0 +1 @@ + diff --git a/pkgtools/xpkgwedge/files/xpkgwedge.def b/pkgtools/xpkgwedge/files/xpkgwedge.def new file mode 100644 index 00000000000..879fcdb3e93 --- /dev/null +++ b/pkgtools/xpkgwedge/files/xpkgwedge.def @@ -0,0 +1,33 @@ +/* $NetBSD: xpkgwedge.def,v 1.1 1998/06/26 16:39:25 tv Exp $ */ + +#ifdef AfterVendorCF + +/* + * The following defines inject a "PREFIX=" make-time option that lets the + * user twiddle the ProjectRoot setting with a single switch. This makes + * the command "make PREFIX=/path/to/install all install" work as expected. + * + * Note that ?= is a special Pmake construct and probably will not work on + * other makes. + */ + +#ifndef ProjectRoot +/* + * Assume the worst: this should not happen in practice, as this setup + * does not work with the classical /usr/{include,lib}/X11 layout. + */ +#define ProjectRoot /usr/X11 +#endif + +PREFIX ?= ProjectRoot +X11_ROOT = ProjectRoot +#undef ProjectRoot +#define ProjectRoot $(PREFIX) + +/* + * This emits dual -I and -L options to cc automatically, one for the actual + * X11 root, and one for the user-set prefix. + */ +#define X11ProjectRoot $(X11_ROOT) + +#endif diff --git a/pkgtools/xpkgwedge/pkg/COMMENT b/pkgtools/xpkgwedge/pkg/COMMENT new file mode 100644 index 00000000000..b9e6c92a882 --- /dev/null +++ b/pkgtools/xpkgwedge/pkg/COMMENT @@ -0,0 +1 @@ +Allows X11 pkgs to be built for installation outside of /usr/X11R6 diff --git a/pkgtools/xpkgwedge/pkg/DEINSTALL b/pkgtools/xpkgwedge/pkg/DEINSTALL new file mode 100755 index 00000000000..451d838fc3d --- /dev/null +++ b/pkgtools/xpkgwedge/pkg/DEINSTALL @@ -0,0 +1,16 @@ +#! /bin/sh + +case "$2" in + DEINSTALL) cat <%D/lib/X11/config/host.def -- cgit v1.2.3