summaryrefslogtreecommitdiff
path: root/mk/pkginstall/shlibs
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2007-07-27 18:37:35 +0000
committerjlam <jlam@pkgsrc.org>2007-07-27 18:37:35 +0000
commit0df85924cf247e7d63d572371154e9c4fa867114 (patch)
treeec0c170578229698f0f119838fd82a62982a1c13 /mk/pkginstall/shlibs
parenta936d5382dfea8dab45e3d7287ef70386681dda6 (diff)
downloadpkgsrc-0df85924cf247e7d63d572371154e9c4fa867114.tar.gz
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.
Diffstat (limited to 'mk/pkginstall/shlibs')
-rw-r--r--mk/pkginstall/shlibs51
1 files changed, 51 insertions, 0 deletions
diff --git a/mk/pkginstall/shlibs b/mk/pkginstall/shlibs
new file mode 100644
index 00000000000..be36408b88b
--- /dev/null
+++ b/mk/pkginstall/shlibs
@@ -0,0 +1,51 @@
+# $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
+