diff options
author | flz <flz@FreeBSD.org> | 2006-01-08 20:38:49 +0800 |
---|---|---|
committer | flz <flz@FreeBSD.org> | 2006-01-08 20:38:49 +0800 |
commit | af647a8295d7a00a1754e071ad7509146cd086ae (patch) | |
tree | d62adb2c35c8d4cf963f8fd8c473e453adddf186 /misc | |
parent | d965b058d73f8facd24732789781118203300a9a (diff) | |
download | freebsd-ports-gnome-af647a8295d7a00a1754e071ad7509146cd086ae.tar.gz freebsd-ports-gnome-af647a8295d7a00a1754e071ad7509146cd086ae.tar.zst freebsd-ports-gnome-af647a8295d7a00a1754e071ad7509146cd086ae.zip |
Add ldconfig_compat, a port that installs a ldconfig compatibility script
to reflect latest changes to /etc/rc.d/ldconfig which are the use of ldconfig
directories (${PREFIX}/libdata/ldconfig{,32}). This change is meant to remove
so-called ldconfig startup scripts installed by ports as 000.${foo}.sh.
The bsd.ldconfig.mmk file is only temporary as this should move quickly to
bsd.port.mk. Anyway, to use it, just define the following in your ports' Makefile :
USE_LDCONFIG= dir1 dir2
and (before bsd.ldconfig.mk moves to bsd.port.mk) :
post-install: install-rc-script
Diffstat (limited to 'misc')
-rw-r--r-- | misc/Makefile | 1 | ||||
-rw-r--r-- | misc/ldconfig_compat/Makefile | 54 | ||||
-rw-r--r-- | misc/ldconfig_compat/bsd.ldconfig.mk | 29 | ||||
-rw-r--r-- | misc/ldconfig_compat/files/ldconfig_compat.sh.in | 48 | ||||
-rw-r--r-- | misc/ldconfig_compat/pkg-descr | 5 |
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 |