summaryrefslogtreecommitdiff
path: root/pkgtools/xpkgwedge
diff options
context:
space:
mode:
authortv <tv@pkgsrc.org>1998-06-26 16:39:23 +0000
committertv <tv@pkgsrc.org>1998-06-26 16:39:23 +0000
commit03f5014574ff3d135b3852f24b4cbd373b28b7e0 (patch)
tree3acce4bd302483f0976530c4ad692d323880e773 /pkgtools/xpkgwedge
parentc027152742b3a541743b59afded69b1450572952 (diff)
downloadpkgsrc-03f5014574ff3d135b3852f24b4cbd373b28b7e0.tar.gz
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.
Diffstat (limited to 'pkgtools/xpkgwedge')
-rw-r--r--pkgtools/xpkgwedge/Makefile32
-rw-r--r--pkgtools/xpkgwedge/files/Imakefile10
-rw-r--r--pkgtools/xpkgwedge/files/md51
-rw-r--r--pkgtools/xpkgwedge/files/xpkgwedge.def33
-rw-r--r--pkgtools/xpkgwedge/pkg/COMMENT1
-rwxr-xr-xpkgtools/xpkgwedge/pkg/DEINSTALL16
-rw-r--r--pkgtools/xpkgwedge/pkg/DESCR3
-rw-r--r--pkgtools/xpkgwedge/pkg/MESSAGE18
-rw-r--r--pkgtools/xpkgwedge/pkg/PLIST3
9 files changed, 117 insertions, 0 deletions
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 <xpkgwedge.def>' >${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 <<EOF
+
+===============================================================
+
+Note that you now need to remove the line which assigns X11BASE
+(such as X11BASE=\${LOCALBASE}) from your /etc/mk.conf! If you
+do not remove that change, X11 pkgs will no longer build.
+
+===============================================================
+
+EOF
+ ;;
+esac
diff --git a/pkgtools/xpkgwedge/pkg/DESCR b/pkgtools/xpkgwedge/pkg/DESCR
new file mode 100644
index 00000000000..88f7a916216
--- /dev/null
+++ b/pkgtools/xpkgwedge/pkg/DESCR
@@ -0,0 +1,3 @@
+Xpkgwedge, not a "real" program in the traditional sense, is a hack that
+allows NetBSD users to compile X11 pkgs from pkgsrc and install them in
+/usr/pkg - even if they use Imake.
diff --git a/pkgtools/xpkgwedge/pkg/MESSAGE b/pkgtools/xpkgwedge/pkg/MESSAGE
new file mode 100644
index 00000000000..f1f2442d940
--- /dev/null
+++ b/pkgtools/xpkgwedge/pkg/MESSAGE
@@ -0,0 +1,18 @@
+==============================================================================
+
+NOTES:
+
+- Add the following line in /etc/mk.conf to enable building of X pkgs into
+ the regular pkg binary tree:
+ X11BASE=${LOCALBASE}
+
+- You MUST set the environment variable XAPPLRESDIR in /etc/profile and
+ /etc/csh.login by hand in order to make pkgs built with xpkgwedge run
+ properly. The setting should point to:
+ @@PREFIX@@/lib/X11/app-defaults
+
+ If any users set XAPPLRESDIR in their own environment, these settings
+ will not work - such users should instead append their own directories to
+ XAPPLRESDIR after a : character (similar to PATH).
+
+==============================================================================
diff --git a/pkgtools/xpkgwedge/pkg/PLIST b/pkgtools/xpkgwedge/pkg/PLIST
new file mode 100644
index 00000000000..cd3b63e3f3b
--- /dev/null
+++ b/pkgtools/xpkgwedge/pkg/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1 1998/06/26 16:39:28 tv Exp $
+lib/X11/config/xpkgwedge.def
+@unexec echo "updating %D/lib/X11/config/host.def"; cp %D/lib/X11/config/host.def %D/lib/X11/config/host.def.bak; (grep -v xpkgwedge %D/lib/X11/config/host.def.bak || true) >%D/lib/X11/config/host.def