Subject: Re: DESTDIR and `make package'
To: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
From: Jim Wise <jwise@draga.com>
List: tech-pkg
Date: 01/26/2001 16:06:41
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 26 Jan 2001, Hubert Feyrer wrote:

>On Fri, 26 Jan 2001, Jim Wise wrote:
>> I have a fix for bsd.pkg.mk to fix this for `make package', while
>> maintaining the current (IMHO correct) behavior for `make install'.
>>
>> I would like to commit this ASAP.  Does anyone object?
>
>Um, how about posting that fix? 8-)

:-)  Here it is:

- ----- snip -----

Index: bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.650
diff -r1.650 bsd.pkg.mk
705,708c705,708
< PKG_ARGS=		-v -c ${COMMENT} -d ${DESCR} -f ${PLIST} -l
< PKG_ARGS+=		-b ${BUILD_VERSION_FILE} -B ${BUILD_INFO_FILE}
< PKG_ARGS+=		-s ${SIZE_PKG_FILE} -S ${SIZE_ALL_FILE}
< PKG_ARGS+=		-p ${PREFIX} -P "`${MAKE} ${MAKEFLAGS} run-depends-list PACKAGE_DEPENDS_QUICK=true|sort -u`"
- ---
> BASE_PKG_ARGS=		-v -c ${COMMENT} -d ${DESCR} -f ${PLIST} -l
> BASE_PKG_ARGS+=		-b ${BUILD_VERSION_FILE} -B ${BUILD_INFO_FILE}
> BASE_PKG_ARGS+=		-s ${SIZE_PKG_FILE} -S ${SIZE_ALL_FILE}
> BASE_PKG_ARGS+=		-P "`${MAKE} ${MAKEFLAGS} run-depends-list PACKAGE_DEPENDS_QUICK=true|sort -u`"
710c710
< PKG_ARGS+=		-C "${CONFLICTS}"
- ---
> BASE_PKG_ARGS+=		-C "${CONFLICTS}"
713c713
< PKG_ARGS+=		-i ${INSTALL_FILE}
- ---
> BASE_PKG_ARGS+=		-i ${INSTALL_FILE}
716c716
< PKG_ARGS+=		-k ${DEINSTALL_FILE}
- ---
> BASE_PKG_ARGS+=		-k ${DEINSTALL_FILE}
719c719
< PKG_ARGS+=		-D ${MESSAGE_FILE}
- ---
> BASE_PKG_ARGS+=		-D ${MESSAGE_FILE}
722c722
< PKG_ARGS+=		-m ${MTREE_FILE}
- ---
> BASE_PKG_ARGS+=		-m ${MTREE_FILE}
723a724,726
>
> PKG_ARGS=		-p ${PREFIX} ${BASE_PKG_ARGS}
> BINPKG_ARGS=		-p ${PREFIX:C/^${DESTDIR}//} -L ${PREFIX} ${BASE_PKG_ARGS}
1565c1568
< 	if ${PKG_CREATE} ${PKG_ARGS} ${PKGFILE}; then		\
- ---
> 	if ${PKG_CREATE} ${BINPKG_ARGS} ${PKGFILE}; then		\

- ------ snip ------

Note that this just uses the -L / @src support already in pkg_create
(presumably implemented to support this sort of thing).

- -- 
				Jim Wise
				jwise@draga.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (NetBSD)
Comment: For info see http://www.gnupg.org

iD8DBQE6cebo2JhG4/qi8rQRApobAKC2TLzswCqwGtJVjci0AY6o+HAAuwCgqB3Q
bERRAfFV/iMbyAYkNVGovkk=
=TTQb
-----END PGP SIGNATURE-----