pkgsrc/mk/pkginstall/shlibs
jlam 4dde9bc3a4 Move the +SHLIBS generation code back into the pkginstall module. In the
plist module, it was being "defined" too late, and the pkginstall module
never created any +SHLIBS scripts.  Sidestep the tools problems with
SHLIB_TYPE by pretending they don't exist (for now).

XXX SHLIB_TYPE needs to be re-thought or removed altogether.
2007-07-27 18:37:35 +00:00

51 lines
1.1 KiB
Text

# $NetBSD: shlibs,v 1.7 2007/07/27 18:37:35 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 <metadatadir>.
#
ECHO="@ECHO@"
PWD_CMD="@PWD_CMD@"
TRUE="@TRUE@"
SELF=$0
ACTION=$1
CURDIR=`${PWD_CMD}`
PKG_METADATA_DIR="${2-${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@ ) >/dev/null 2>&1 || ${TRUE}
;;
REMOVE)
${ECHO} "${PKGNAME}: rebuilding run-time library search paths database"
( @LDCONFIG_REMOVE_CMD@ ) >/dev/null 2>&1 || ${TRUE}
;;
esac
exit $exitcode
EOF
${SED} -n "/^\# SHLIBS: /p" ${SELF} >> ./+SHLIBS
${CHMOD} +x ./+SHLIBS
;;
esac