summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorjlam <jlam>2000-10-23 17:32:06 +0000
committerjlam <jlam>2000-10-23 17:32:06 +0000
commitd699c57f99d2a994201e63746cf3040f2b06b97b (patch)
treecfbcf370a71a57d4b04810664b49d82b649d418d /pkgtools
parent604a3bca245cb10b29e27fd31c5f95f3a94e34a1 (diff)
downloadpkgsrc-d699c57f99d2a994201e63746cf3040f2b06b97b.tar.gz
Update xpkgwedge to 1.0 and make appropriate changes to bsd.pkg.mk to handle
the new version of xpkgwedge. Changes from xpkgwedge 0.4: * Redefine ImakeCmd to "imake -I$(PREFIX)/lib/X11/config" to pick up X11 config files in $(PREFIX)/lib/X11/config before the ones in the standard X11 tree. * Install a program called "pkgxmkmf" that's actually xmkmf, but checks in $(PREFIX)/lib/X11/config before the standard X11 config directory. * Create the host.def file in $(PREFIX)/lib/X11/config instead of always in ${X11BASE}/lib/X11/config. The benefits of this are: 1) xpkgwedge can now install into $(PREFIX) instead of always into $(X11BASE). 2) Keeps the X11 tree "pure", and doesn't affect people who want to run xmkmf and not include all the xpkgwedge stuff, even if it's installed. 3) Packages that install config files (lesstif, xview-config) can now do so in $(PREFIX). 4) People only have to use 'pkgxmkmf' instead of 'xmkmf', and (hopefully) no other changes, if they want to use the config files in xpkgwedge'd packages.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/xpkgwedge/Makefile49
-rw-r--r--pkgtools/xpkgwedge/files/Imakefile13
-rw-r--r--pkgtools/xpkgwedge/files/pkgxmkmf.in67
-rw-r--r--pkgtools/xpkgwedge/files/xpkgwedge.def13
-rw-r--r--pkgtools/xpkgwedge/pkg/COMMENT2
-rwxr-xr-xpkgtools/xpkgwedge/pkg/DEINSTALL34
-rw-r--r--pkgtools/xpkgwedge/pkg/DESCR7
-rw-r--r--pkgtools/xpkgwedge/pkg/INSTALL35
-rw-r--r--pkgtools/xpkgwedge/pkg/MESSAGE.pre4
-rw-r--r--pkgtools/xpkgwedge/pkg/PLIST5
10 files changed, 190 insertions, 39 deletions
diff --git a/pkgtools/xpkgwedge/Makefile b/pkgtools/xpkgwedge/Makefile
index 882106beafa..6bbbb6476e0 100644
--- a/pkgtools/xpkgwedge/Makefile
+++ b/pkgtools/xpkgwedge/Makefile
@@ -1,18 +1,21 @@
-# $NetBSD: Makefile,v 1.14 2000/07/14 04:22:41 jlam Exp $
+# $NetBSD: Makefile,v 1.15 2000/10/23 17:32:07 jlam Exp $
#
-DISTNAME= xpkgwedge-0.4
+DISTNAME= xpkgwedge-1.0
CATEGORIES= pkgtools devel x11
-DISTFILES= # none
+MASTER_SITES= # empty
+DISTFILES= # empty
-MAINTAINER= tv@netbsd.org
+MAINTAINER= jlam@netbsd.org
+HOMEPAGE= http://www.netbsd.org/Documentation/netbsd/Packages.txt
-NO_CHECKSUM= yes
-NO_BUILD= yes
-NO_MTREE= yes
-NO_WRKSUBDIR= yes
-USE_IMAKE= yes
+EXTRACT_ONLY= # empty
+NO_CONFIGURE= # defined
+NO_WRKSUBDIR= # defined
+NO_CHECKSUM= # defined
+DEINSTALL_FILE= ${WRKDIR}/DEINSTALL
+INSTALL_FILE= ${WRKDIR}/INSTALL
MESSAGE_FILE= ${WRKDIR}/MESSAGE
pre-extract:
@@ -23,18 +26,28 @@ pre-extract:
${FALSE}; \
fi
-pre-configure:
- @${CP} ${FILESDIR}/Imakefile ${FILESDIR}/xpkgwedge.def ${WRKSRC}
+do-build:
+ ${SED} -e "s,@X11BASE@,${X11BASE},g" \
+ -e "s,@PREFIX@,${PREFIX},g" \
+ < ${FILESDIR}/pkgxmkmf.in > ${WRKDIR}/pkgxmkmf
-pre-install:
- @${SED} -e 's|@@PREFIX@@|${LOCALBASE}|g' < ${PKGDIR}/MESSAGE.pre \
- > ${MESSAGE_FILE}
+post-build:
+ ${SED} -e "s,@X11BASE@,${X11BASE},g" \
+ < ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}
+ ${SED} -e "s,@X11BASE@,${X11BASE},g" \
+ < ${PKGDIR}/INSTALL > ${INSTALL_FILE}
+ ${SED} -e "s,@PREFIX@,${PREFIX},g" \
+ < ${PKGDIR}/MESSAGE.pre > ${MESSAGE_FILE}
-.include "../../mk/bsd.pkg.mk"
+do-install:
+ ${INSTALL_DATA_DIR} ${PREFIX}/lib/X11/config
+ ${INSTALL_DATA} ${FILESDIR}/xpkgwedge.def ${PREFIX}/lib/X11/config
+ ${INSTALL_SCRIPT} ${WRKSRC}/pkgxmkmf ${PREFIX}/bin/pkgxmkmf
+
+post-install:
+ PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
-# In order to force xpkgwedge to install into X11BASE, we forcibly override
-# the PREFIX definition. _NO_ other pkg should do this.
-PREFIX=${X11BASE}
+.include "../../mk/bsd.pkg.mk"
# Clear the build dependencies list so that xpkgwedge will not be recursively
# dependent on itself.
diff --git a/pkgtools/xpkgwedge/files/Imakefile b/pkgtools/xpkgwedge/files/Imakefile
deleted file mode 100644
index c1bca3a885b..00000000000
--- a/pkgtools/xpkgwedge/files/Imakefile
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $NetBSD: Imakefile,v 1.2 1998/08/07 11:18:26 agc Exp $
-#
-# 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/pkgxmkmf.in b/pkgtools/xpkgwedge/files/pkgxmkmf.in
new file mode 100644
index 00000000000..82b6759d15b
--- /dev/null
+++ b/pkgtools/xpkgwedge/files/pkgxmkmf.in
@@ -0,0 +1,67 @@
+#!/bin/sh
+#
+# XConsortium Id: xmkmf.cpp /main/22 1996/09/28 16:17:05 rws
+#
+# $NetBSD: pkgxmkmf.in,v 1.1 2000/10/23 17:32:08 jlam Exp $
+#
+# make a Makefile from an Imakefile from inside or outside the sources
+# with support for config files in ${PREFIX}/lib/X11/config
+
+usage="usage: $0 [-a] [top_of_sources_pathname [current_directory]]"
+
+xcfgdir=@X11BASE@/lib/X11/config
+lcfgdir=@PREFIX@/lib/X11/config
+configdirspec=''
+if [ "${xcfgdir}" != "${lcfgdir}" -a -d ${lcfgdir} ]; then
+ configdirspec="${configdirspec} -I${lcfgdir}"
+fi
+configdirspec="${configdirspec} -I${xcfgdir}"
+
+topdir=
+curdir=.
+do_all=
+
+case "$1" in
+-a)
+ do_all="yes"
+ shift
+ ;;
+esac
+
+case $# in
+ 0) ;;
+ 1) topdir=$1 ;;
+ 2) topdir=$1 curdir=$2 ;;
+ *) echo "$usage" 1>&2; exit 1 ;;
+esac
+
+case "$topdir" in
+ -*) echo "$usage" 1>&2; exit 1 ;;
+esac
+
+if [ -f Makefile ]; then
+ echo mv -f Makefile Makefile.bak
+ mv -f Makefile Makefile.bak
+fi
+
+if [ "$topdir" = "" ]; then
+ args="-DUseInstalled "$configdirspec
+else
+ args="-I$topdir/config/cf -DTOPDIR=$topdir -DCURDIR=$curdir"
+fi
+
+echo imake $args
+case "$do_all" in
+yes)
+ imake $args &&
+ echo "make Makefiles" &&
+ make Makefiles &&
+ echo "make includes" &&
+ make includes &&
+ echo "make depend" &&
+ make depend
+ ;;
+*)
+ imake $args
+ ;;
+esac
diff --git a/pkgtools/xpkgwedge/files/xpkgwedge.def b/pkgtools/xpkgwedge/files/xpkgwedge.def
index 904c0878542..ced27ab7c6b 100644
--- a/pkgtools/xpkgwedge/files/xpkgwedge.def
+++ b/pkgtools/xpkgwedge/files/xpkgwedge.def
@@ -1,4 +1,4 @@
-/* $NetBSD: xpkgwedge.def,v 1.2 1998/07/01 15:56:36 tv Exp $ */
+/* $NetBSD: xpkgwedge.def,v 1.3 2000/10/23 17:32:08 jlam Exp $ */
#ifdef AfterVendorCF
@@ -33,4 +33,15 @@ X11_ROOT = ProjectRoot
*/
#define X11ProjectRoot $(X11_ROOT)
+#ifdef UseInstalled
+/*
+ * We need to redefine ImakeCmd so that imake will look in
+ * $(PREFIX)/lib/X11/config *before* looking in the standard X
+ * config directory to override any configurate files installed
+ * there.
+ */
+#undef ImakeCmd
+#define ImakeCmd imake -I$(PREFIX)/lib/X11/config
+#endif
+
#endif
diff --git a/pkgtools/xpkgwedge/pkg/COMMENT b/pkgtools/xpkgwedge/pkg/COMMENT
index b9e6c92a882..15ab1505ee2 100644
--- a/pkgtools/xpkgwedge/pkg/COMMENT
+++ b/pkgtools/xpkgwedge/pkg/COMMENT
@@ -1 +1 @@
-Allows X11 pkgs to be built for installation outside of /usr/X11R6
+allows X11 pkgs to be built and used outside of /usr/X11R6
diff --git a/pkgtools/xpkgwedge/pkg/DEINSTALL b/pkgtools/xpkgwedge/pkg/DEINSTALL
new file mode 100755
index 00000000000..896deeaefab
--- /dev/null
+++ b/pkgtools/xpkgwedge/pkg/DEINSTALL
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# $NetBSD: DEINSTALL,v 1.5 2000/10/23 17:32:08 jlam Exp $
+
+PKGNAME=$1
+STAGE=$2
+
+case ${STAGE} in
+DEINSTALL)
+ ;;
+POST-DEINSTALL)
+ X11BASE=@X11BASE@
+ X11_HOSTDEF=${X11BASE}/lib/X11/config/host.def
+ HOSTDEF=${PKG_PREFIX}/lib/X11/config/host.def
+
+ echo -n "Updating ${HOSTDEF}..."
+ cp -f ${HOSTDEF} ${HOSTDEF}.bak
+ ( grep -v xpkgwedge ${HOSTDEF}.bak || true ) \
+ > ${HOSTDEF}
+ rm -f ${HOSTDEF}.bak
+ if [ ${PKG_PREFIX} != ${X11BASE} ] && \
+ diff -q ${X11_HOSTDEF} ${HOSTDEF} >/dev/null
+ then
+ rm -f ${HOSTDEF}
+ fi
+ echo "done."
+ rmdir -p ${PKG_PREFIX}/lib/X11/config 2>/dev/null || true
+ ;;
+*)
+ echo "Unexpected argument: ${STAGE}"
+ exit 1
+ ;;
+esac
+exit 0
diff --git a/pkgtools/xpkgwedge/pkg/DESCR b/pkgtools/xpkgwedge/pkg/DESCR
index 7ee80728a0e..f6cdecdeedf 100644
--- a/pkgtools/xpkgwedge/pkg/DESCR
+++ b/pkgtools/xpkgwedge/pkg/DESCR
@@ -1,3 +1,8 @@
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
-outside of the X11 tree - even if they use Imake.
+outside of the X11 tree - even if they use Imake - by using pkgxmkmf.
+
+Pkgxmkmf is a slightly modified xmkmf from the X11R6.3 release and supports
+finding config files in ${LOCALBASE}/lib/X11/config, if it exists, and in
+${X11BASE}/lib/X11/config. In all other respects, it is identical to xmkmf.
+Please refer to xmkmf(1) for more information.
diff --git a/pkgtools/xpkgwedge/pkg/INSTALL b/pkgtools/xpkgwedge/pkg/INSTALL
new file mode 100644
index 00000000000..33791450445
--- /dev/null
+++ b/pkgtools/xpkgwedge/pkg/INSTALL
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# $NetBSD: INSTALL,v 1.1 2000/10/23 17:32:08 jlam Exp $
+
+PKGNAME=$1
+STAGE=$2
+
+case ${STAGE} in
+PRE-INSTALL)
+ ;;
+POST-INSTALL)
+ X11BASE=@X11BASE@
+ X11_HOSTDEF=${X11BASE}/lib/X11/config/host.def
+ HOSTDEF=${PKG_PREFIX}/lib/X11/config/host.def
+
+ if [ ${PKG_PREFIX} = ${X11BASE} -o -f ${HOSTDEF} ]
+ then
+ echo -n "Updating ${HOSTDEF}..."
+ cp -f ${HOSTDEF} ${HOSTDEF}.bak
+ else
+ echo -n "Creating ${HOSTDEF}..."
+ cp -f ${X11_HOSTDEF} ${HOSTDEF}.bak
+ fi
+ ( echo '#include <xpkgwedge.def>'; \
+ grep -v xpkgwedge ${HOSTDEF}.bak ) \
+ > ${HOSTDEF}
+ rm -f ${HOSTDEF}.bak
+ echo "done."
+ ;;
+*)
+ echo "Unexpected argument: ${STAGE}"
+ exit 1
+ ;;
+esac
+exit 0
diff --git a/pkgtools/xpkgwedge/pkg/MESSAGE.pre b/pkgtools/xpkgwedge/pkg/MESSAGE.pre
index c85d923d8e3..230ad06225e 100644
--- a/pkgtools/xpkgwedge/pkg/MESSAGE.pre
+++ b/pkgtools/xpkgwedge/pkg/MESSAGE.pre
@@ -1,5 +1,5 @@
==========================================================================
-$NetBSD: MESSAGE.pre,v 1.5 2000/06/28 15:02:33 agc Exp $
+$NetBSD: MESSAGE.pre,v 1.6 2000/10/23 17:32:08 jlam Exp $
NOTES:
@@ -7,7 +7,7 @@ NOTES:
/etc/csh.login by hand in order to make pkgs built with xpkgwedge run
properly, e.g.
- XAPPLRESDIR=@@PREFIX@@/lib/X11/app-defaults
+ XAPPLRESDIR=@PREFIX@/lib/X11/app-defaults
If any users set XAPPLRESDIR in their own environment, these settings
will not work -- such users need to set XUSERFILESEARCHPATH (syntax
diff --git a/pkgtools/xpkgwedge/pkg/PLIST b/pkgtools/xpkgwedge/pkg/PLIST
index 35da2232c1a..c0dd1ccbc62 100644
--- a/pkgtools/xpkgwedge/pkg/PLIST
+++ b/pkgtools/xpkgwedge/pkg/PLIST
@@ -1,4 +1,3 @@
-@comment $NetBSD: PLIST,v 1.3 2000/10/04 19:02:31 jlam Exp $
+@comment $NetBSD: PLIST,v 1.4 2000/10/23 17:32:08 jlam Exp $
+bin/pkgxmkmf
lib/X11/config/xpkgwedge.def
-@exec echo "updating %D/lib/X11/config/host.def"; cp %D/lib/X11/config/host.def %D/lib/X11/config/host.def.bak; (echo '#include <xpkgwedge.def>'; grep -v xpkgwedge %D/lib/X11/config/host.def.bak') >%D/lib/X11/config/host.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