f7c550083d
being created at install-time (LDCONFIG*_DIR defined in bsd.port.post.mk). [1] - Update to a more recent version the ldconfig script. Reported by: fenner [1]
59 lines
1.3 KiB
Bash
59 lines
1.3 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: ldconfig_compat
|
|
# REQUIRE: mountcritremote ldconfig
|
|
# BEFORE: DAEMON
|
|
|
|
. "%%RC_SUBR%%"
|
|
|
|
name="ldconfig"
|
|
ldconfig_command="/sbin/ldconfig"
|
|
start_cmd="ldconfig_start"
|
|
stop_cmd=":"
|
|
|
|
load_rc_config $name
|
|
: ${ldconfig_local_dirs="%%PREFIX%%/%%LDCONFIG_DIR%% %%X11BASE%%/%%LDCONFIG_DIR%%"}
|
|
: ${ldconfig_local32_dirs="%%PREFIX%%/%%LDCONFIG32_DIR%% %%X11BASE%%/%%LDCONFIG32_DIR%%"}
|
|
|
|
ldconfig_start()
|
|
{
|
|
local _files
|
|
|
|
_ins=
|
|
ldconfig=${ldconfig_command}
|
|
checkyesno ldconfig_insecure && _ins="-i"
|
|
if [ -x "${ldconfig_command}" ]; then
|
|
ldconfig_paths=""
|
|
for i in ${ldconfig_local_dirs}; do
|
|
if [ -d "${i}" ]; then
|
|
_files=`find ${i} -type f`
|
|
if [ -n "${_files}" ]; then
|
|
ldconfig_paths="${ldconfig_paths} `cat ${_files} | sort -u`"
|
|
fi
|
|
fi
|
|
done
|
|
echo 'Local ldconfig path:' ${ldconfig_paths}
|
|
${ldconfig} -m ${_ins} ${ldconfig_paths}
|
|
|
|
case `sysctl -n hw.machine_arch` in
|
|
amd64)
|
|
ldconfig32_paths=""
|
|
for i in ${ldconfig_local32_dirs}; do
|
|
if [ -d "${i}" ]; then
|
|
_files=`find ${i} -type f`
|
|
if [ -n "${_files}" ]; then
|
|
ldconfig32_paths="${ldconfig32_paths} `cat ${_files} | sort -u`"
|
|
fi
|
|
fi
|
|
done
|
|
echo 'Local 32-bits ldconfig path:' ${ldconfig32_paths}
|
|
${ldconfig} -32 -m ${_ins} ${ldconfig32_paths}
|
|
;;
|
|
esac
|
|
fi
|
|
}
|
|
|
|
run_rc_command "$1"
|