summaryrefslogtreecommitdiff
path: root/mk/pkginstall/shlibs
diff options
context:
space:
mode:
Diffstat (limited to 'mk/pkginstall/shlibs')
-rw-r--r--mk/pkginstall/shlibs49
1 files changed, 49 insertions, 0 deletions
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 <metadatadir>.
+#
+
+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
+