diff options
-rw-r--r-- | mk/bsd.pkg.mk | 22 | ||||
-rw-r--r-- | pkgtools/xpkgwedge/Makefile | 49 | ||||
-rw-r--r-- | pkgtools/xpkgwedge/files/Imakefile | 13 | ||||
-rw-r--r-- | pkgtools/xpkgwedge/files/pkgxmkmf.in | 67 | ||||
-rw-r--r-- | pkgtools/xpkgwedge/files/xpkgwedge.def | 13 | ||||
-rw-r--r-- | pkgtools/xpkgwedge/pkg/COMMENT | 2 | ||||
-rwxr-xr-x | pkgtools/xpkgwedge/pkg/DEINSTALL | 34 | ||||
-rw-r--r-- | pkgtools/xpkgwedge/pkg/DESCR | 7 | ||||
-rw-r--r-- | pkgtools/xpkgwedge/pkg/INSTALL | 35 | ||||
-rw-r--r-- | pkgtools/xpkgwedge/pkg/MESSAGE.pre | 4 | ||||
-rw-r--r-- | pkgtools/xpkgwedge/pkg/PLIST | 5 |
11 files changed, 208 insertions, 43 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index fdcb1558b2f..1d8423e7c14 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.591 2000/10/22 14:05:24 fredb Exp $ +# $NetBSD: bsd.pkg.mk,v 1.592 2000/10/23 17:32:06 jlam Exp $ # # This file is in the public domain. # @@ -89,11 +89,18 @@ CONFIGURE_ENV+= CLASSPATH=${CLASSPATH} JAVA_HOME=${JAVA_HOME} SCRIPTS_ENV+= CLASSPATH=${CLASSPATH} JAVA_HOME=${JAVA_HOME} .endif -# set X11PREFIX to reflect installed dir of X11 packages -.if exists(${X11BASE}/lib/X11/config/xpkgwedge.def) +# Set X11PREFIX to reflect the install directory of X11 packages. +# +# The check for the existence of ${X11BASE}/lib/X11/config/xpkgwedge.def +# is to catch users of xpkgwedge<1.0. +# +.if exists(${LOCALBASE}/lib/X11/config/xpkgwedge.def) || \ + exists(${X11BASE}/lib/X11/config/xpkgwedge.def) X11PREFIX= ${LOCALBASE} +XMKMF?= pkgxmkmf -a .else X11PREFIX= ${X11BASE} +XMKMF?= xmkmf -a .endif .if defined(USE_MOTIF12) @@ -117,6 +124,14 @@ MOTIFBASE?= ${X11PREFIX} .endif # USE_MOTIF .if defined(USE_IMAKE) || defined(USE_MOTIF) || defined(USE_X11BASE) +.if exists(${LOCALBASE}/lib/X11/config/xpkgwedge.def) || \ + exists(${X11BASE}/lib/X11/config/xpkgwedge.def) +# XXX: actually, here we would need something like +# BUILD_DEPENDS+=xpkgwedge>=1.0:../../pkgtools/xpkgwedge +.if make(install-run-depends) +DEPENDS+= xpkgwedge>=1.0:../../pkgtools/xpkgwedge +.endif +.endif PREFIX= ${X11PREFIX} .elif defined(USE_CROSSBASE) PREFIX= ${CROSSBASE} @@ -246,7 +261,6 @@ PACKAGE_COOKIE= ${WRKDIR}/.package_done # Miscellaneous overridable commands: SHCOMMENT?= ${ECHO_MSG} >/dev/null '***' -XMKMF?= xmkmf -a .if exists(/sbin/md5) MD5?= /sbin/md5 .elif exists(/bin/md5) 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 |