Permalink
Browse files

Add custom ldconfig to pbi-manager10

  • Loading branch information...
1 parent f5cbb14 commit 9b2c4e1e6db9e1b9397b88cf433ab335cde6edcd @kmoore134 kmoore134 committed Oct 21, 2013
@@ -129,9 +129,11 @@ mv pbiwrapper ${LB}/share/pbi-manager/.pbiwrapper-`uname -m`
cd ${DIR}/pbime && make
install -o root -g wheel -m 4751 pbime ${LB}/share/pbi-manager/.pbime
install -o root -g wheel -m 755 pbimount ${LB}/share/pbi-manager/.pbimount
+install -o root -g wheel -m 755 ldconfig ${LB}/share/pbi-manager/.ldconfig
if [ "${LB}" = "/usr/local" ] ; then
install -o root -g wheel -m 4751 pbime /usr/pbi/.pbime
install -o root -g wheel -m 755 pbimount /usr/pbi/.pbimount
+ install -o root -g wheel -m 755 ldconfig /usr/pbi/.ldconfig
fi
# Install the nullfs binary
@@ -7,3 +7,4 @@ pbime: pbime.c
install: pbime
install -o root -g wheel -m 4751 pbime /usr/pbi/.pbime
install -o root -g wheel -m 755 pbimount /usr/pbi/.pbimount
+ install -o root -g wheel -m 755 ldconfig /usr/pbi/.ldconfig
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: ldconfig
+# REQUIRE: mountcritremote FILESYSTEMS
+# BEFORE: DAEMON
+
+. /etc/rc.subr
+
+name="ldconfig"
+ldconfig_command="/sbin/ldconfig"
+start_cmd="ldconfig_start"
+stop_cmd=":"
+
+ldconfig_start()
+{
+ local _files _ins
+
+ _ins="-i"
+ ldconfig=${ldconfig_command}
+ if [ -x "${ldconfig_command}" ]; then
+ _LDC="/lib /usr/lib"
+ 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
+ for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do
+ if [ -r "${i}" ]; then
+ _LDC="${_LDC} ${i}"
+ fi
+ done
+ check_startmsgs && echo 'ELF ldconfig path:' ${_LDC}
+ ${ldconfig} -elf ${_ins} ${_LDC}
+
+ case `sysctl -n hw.machine_arch` in
+ amd64)
+ 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
+ _LDC=""
+ for i in ${ldconfig32_paths}; do
+ if [ -r "${i}" ]; then
+ _LDC="${_LDC} ${i}"
+ fi
+ done
+ check_startmsgs &&
+ echo '32-bit compatibility ldconfig path:' ${_LDC}
+ ${ldconfig} -32 -m ${_ins} ${_LDC}
+ ;;
+ esac
+
+ # Legacy aout support for i386 only
+ case `sysctl -n hw.machine_arch` in
+ i386)
+ # Default the a.out ldconfig path.
+ : ${ldconfig_paths_aout=${ldconfig_paths}}
+ _LDC=""
+ for i in /usr/lib/aout ${ldconfig_paths_aout} /etc/ld.so.conf; do
+ if [ -r "${i}" ]; then
+ _LDC="${_LDC} ${i}"
+ fi
+ done
+ check_startmsgs && echo 'a.out ldconfig path:' ${_LDC}
+ ${ldconfig} -aout ${_ins} ${_LDC}
+ ;;
+ esac
+ fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
@@ -35,6 +35,7 @@ IGNORE= requires FreeBSD 9.0 or later
.if ${OSVERSION} > 1000000
PLIST_FILES+= share/pbi-manager/.pbime \
share/pbi-manager/.pbimount \
+ share/pbi-manager/.ldconfig \
share/pbi-manager/.mount_nullfs \
etc/man.d/pbi.conf
.endif
@@ -31,6 +31,7 @@ fi
if [ -e "${PREFIX}/share/pbi-manager/.pbime" ] ; then
install -o root -g wheel -m 4751 ${PREFIX}/share/pbi-manager/.pbime /usr/pbi/.pbime
install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.pbimount /usr/pbi/.pbimount
+ install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.ldconfig /usr/pbi/.ldconfig
install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.mount_nullfs /usr/pbi/.mount_nullfs
fi

0 comments on commit 9b2c4e1

Please sign in to comment.