aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorFlorent Thoumie <flz@FreeBSD.org>2006-01-08 12:38:49 +0000
committerFlorent Thoumie <flz@FreeBSD.org>2006-01-08 12:38:49 +0000
commitc211d9d33f3a582bf123eda2afce1d26d848bbfb (patch)
tree2325cd90ac9876fce3da5c7cae02af98a6daad17 /misc
parent307b87971bdc65fbd1acb692befd34cfef72e1c9 (diff)
downloadports-c211d9d33f3a582bf123eda2afce1d26d848bbfb.tar.gz
ports-c211d9d33f3a582bf123eda2afce1d26d848bbfb.zip
Notes
Diffstat (limited to 'misc')
-rw-r--r--misc/Makefile1
-rw-r--r--misc/ldconfig_compat/Makefile54
-rw-r--r--misc/ldconfig_compat/bsd.ldconfig.mk29
-rw-r--r--misc/ldconfig_compat/files/ldconfig_compat.sh.in48
-rw-r--r--misc/ldconfig_compat/pkg-descr5
5 files changed, 137 insertions, 0 deletions
diff --git a/misc/Makefile b/misc/Makefile
index ddc88452b730..787262bcee1a 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -276,6 +276,7 @@
SUBDIR += kwatch
SUBDIR += latex-mk
SUBDIR += lc
+ SUBDIR += ldconfig_compat
SUBDIR += lesspipe
SUBDIR += libhome
SUBDIR += libmcal
diff --git a/misc/ldconfig_compat/Makefile b/misc/ldconfig_compat/Makefile
new file mode 100644
index 000000000000..b3d75aee009d
--- /dev/null
+++ b/misc/ldconfig_compat/Makefile
@@ -0,0 +1,54 @@
+# New ports collection makefile for: ldconfig_compat
+# Date created: 30 Dec 2005
+# Whom: Florent Thoumie <flz@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= ldconfig_compat
+PORTVERSION= 1.0
+CATEGORIES= misc
+MASTER_SITES= # none
+DISTFILES= # none
+
+MAINTAINER= flz@FreeBSD.org
+COMMENT= Ldconfig compatibility script
+
+NO_BUILD= yes
+SUB_FILES= ldconfig_compat.sh
+USE_RC_SUBR= yes
+
+LOCAL_DIRS= ${LDCONFIG_DIR} \
+ ${LDCONFIG32_DIR}
+
+.include <bsd.port.pre.mk>
+.include "${.CURDIR}/bsd.ldconfig.mk"
+
+.if ${OSVERSION} >= 700012
+IGNORE= isn't needed (part of base rc.d)
+.endif
+
+do-fetch:
+ @${DO_NADA}
+
+do-install:
+.if ${OSVERSION} >= 600101
+ @${INSTALL_SCRIPT} ${WRKDIR}/ldconfig_compat.sh ${PREFIX}/etc/rc.d/ldconfig_compat
+ @${ECHO_CMD} "etc/rc.d/ldconfig_compat" >> ${TMPPLIST}
+.elif ${OSVERSION} >= 500037
+ @${INSTALL_SCRIPT} ${WRKDIR}/ldconfig_compat.sh /etc/rc.d/ldconfig_compat
+ @${ECHO_CMD} "@cwd /" >> ${TMPPLIST}
+ @${ECHO_CMD} "etc/rc.d/ldconfig_compat" >> ${TMPPLIST}
+.else
+ @${INSTALL_SCRIPT} ${WRKDIR}/ldconfig_compat.sh ${PREFIX}/etc/rc.d/000.ldconfig_compat.sh
+ @${ECHO_CMD} "etc/rc.d/000.ldconfig_compat.sh" >> ${TMPPLIST}
+.endif
+.for prefix in ${PREFIX} ${X11BASE}
+ @${ECHO_CMD} "@cwd ${prefix}" >> ${TMPPLIST}
+.for dir in ${LOCAL_DIRS}
+ @${MKDIR} ${prefix}/${dir}
+ @${ECHO_CMD} "@dirrm ${dir}" >> ${TMPPLIST}
+.endfor
+.endfor
+
+.include <bsd.port.post.mk>
diff --git a/misc/ldconfig_compat/bsd.ldconfig.mk b/misc/ldconfig_compat/bsd.ldconfig.mk
new file mode 100644
index 000000000000..17896abb4bf8
--- /dev/null
+++ b/misc/ldconfig_compat/bsd.ldconfig.mk
@@ -0,0 +1,29 @@
+LDCONFIG_DIR= libdata/ldconfig
+LDCONFIG32_DIR= libdata/ldconfig32
+
+.if defined(USE_LDCONFIG) || defined(USE_LDCONFIG32)
+.if (${OSVERSION} < 700012)
+RUN_DEPENDS+= ${LDCONFIG_DIR}:${PORTSDIR}/misc/ldconfig_compat
+.endif
+.endif
+
+.if !target(install-ldconfig-file)
+install-ldconfig-file:
+.if defined(USE_LDCONFIG) || defined(USE_LDCONFIG32)
+ @${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}
+.if defined(USE_LDCONFIG)
+ @${ECHO_MSG} "===> Installing ldconfig configuration file"
+ @${ECHO_CMD} ${USE_LDCONFIG} | ${TR} ' ' '\n' \
+ > ${PREFIX}/${LDCONFIG_DIR}/${UNIQUENAME}
+ @${ECHO_CMD} ${LDCONFIG_DIR}/${UNIQUENAME} >> ${TMPPLIST}
+.endif
+.if defined(USE_LDCONFIG32)
+ @${ECHO_MSG} "===> Installing 32-bit ldconfig configuration file"
+ @${ECHO_CMD} ${USE_LDCONFIG32} | ${TR} ' ' '\n' \
+ > ${PREFIX}/${LDCONFIG32_DIR}/${UNIQUENAME}
+ @${ECHO_CMD} ${LDCONFIG32_DIR}/${UNIQUENAME} >> ${TMPPLIST}
+.endif
+.else
+ @${DO_NADA}
+.endif
+.endif
diff --git a/misc/ldconfig_compat/files/ldconfig_compat.sh.in b/misc/ldconfig_compat/files/ldconfig_compat.sh.in
new file mode 100644
index 000000000000..fe8abc2d2a61
--- /dev/null
+++ b/misc/ldconfig_compat/files/ldconfig_compat.sh.in
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: ldconfig_compat
+# REQUIRE: mountcritremote ldconfig
+# BEFORE: DAEMON
+
+. /etc/rc.subr
+
+name="ldconfig"
+ldconfig_command="/sbin/ldconfig"
+start_cmd="ldconfig_start"
+stop_cmd=":"
+
+ldconfig_start()
+{
+ _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
+ ldconfig_paths="${ldconfig_paths} `find ${i} -type f`"
+ 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
+ ldconfig32_paths="${ldconfig32_paths} `find ${i} -type f`"
+ fi
+ done
+ echo 'Local 32-bits ldconfig path:' ${ldconfig32_paths}
+ ${ldconfig} -32 -m ${_ins} ${ldconfig32_paths}
+ ;;
+ esac
+ fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/misc/ldconfig_compat/pkg-descr b/misc/ldconfig_compat/pkg-descr
new file mode 100644
index 000000000000..8c931e93dddf
--- /dev/null
+++ b/misc/ldconfig_compat/pkg-descr
@@ -0,0 +1,5 @@
+This port installs a compatibility script that enable old
+FreeBSD systems to use ldconfig local directories.
+
+- Florent Thoumie
+flz@FreeBSD.org