From c45921f9b357e9b31d5b2981a36f324a27d9682c Mon Sep 17 00:00:00 2001 From: jlam Date: Wed, 18 Jul 2007 18:01:02 +0000 Subject: Add back a facility to rebuild the run-time library search paths database on platforms that need it. XXX Right now, if the platform needs it, then it runs for every package. XXX This needs to be fixed to only run for packages that install shared XXX libraries. * Move mk/plist/shlib-type to mk/scripts. * Move definition of SHLIB_TYPE from mk/plist/plist.mk to bsd.pkg.mk. * Move inclusion of bsd.pkginstall.mk below bsd.tools.mk so that it can use SHLIB_TYPE. This is necessary because SHLIB_TYPE's value is the result of evaluating a command, and the command needs "TOOL" definitions provided by bsd.tools.mk. --- mk/pkginstall/shlibs | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 mk/pkginstall/shlibs (limited to 'mk/pkginstall/shlibs') diff --git a/mk/pkginstall/shlibs b/mk/pkginstall/shlibs new file mode 100644 index 00000000000..5733a4c2cb2 --- /dev/null +++ b/mk/pkginstall/shlibs @@ -0,0 +1,49 @@ +# $NetBSD: shlibs,v 1.1 2007/07/18 18:01:03 jlam Exp $ +# +# Generate a +SHLIBS script that updates the system run-time library +# search paths database for the package. +# +case "${STAGE},$1" in +UNPACK,|UNPACK,+SHLIBS) + ${CAT} > ./+SHLIBS << 'EOF' +#!@SH@ +# +# +SHLIBS - system run-time library search paths database management script +# +# Usage: ./+SHLIBS ADD|REMOVE [metadatadir] +# +# This scripts rebuilds the system database of run-time library search +# paths so that the system can find the shared libraries of the package +# associated with . +# + +ECHO="@ECHO@" +PWD_CMD="@PWD_CMD@" + +SELF=$0 + +CURDIR=`${PWD_CMD}` +PKG_METADATA_DIR="${1-${CURDIR}}" +: ${PKGNAME=${PKG_METADATA_DIR##*/}} +: ${PKG_PREFIX=@PREFIX@} + +exitcode=0 +case $ACTION in +ADD) + ${ECHO} "${PKGNAME}: rebuilding run-time library search paths database" + @LDCONFIG_ADD_CMD@ + ;; + +REMOVE) + ${ECHO} "${PKGNAME}: rebuilding run-time library search paths database" + @LDCONFIG_REMOVE_CMD@ + ;; +esac +exit $exitcode + +EOF + ${SED} -n "/^\# SHLIBS: /p" ${SELF} >> ./+SHLIBS + ${CHMOD} +x ./+SHLIBS + ;; +esac + -- cgit v1.2.3