1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +00:00

Make use of the ldconfig_local_dirs mechanism just committed to

7-CURRENT.

flz has plans to develop the USE_LDCONFIG code in bsd.port.mk,
but this will serve as a POC for now.
This commit is contained in:
Doug Barton 2006-01-08 10:41:48 +00:00
parent e48c722005
commit ea6a5da318
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=153045
4 changed files with 50 additions and 10 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= compat4x
PORTVERSION= ${COMPAT4X_PORTVERSION}
PORTREVISION= 6
PORTREVISION= 7
CATEGORIES= misc
MASTER_SITES= ${COMPAT4X_MASTER_SITES}
MASTER_SITE_SUBDIR= ${COMPAT4X_MASTER_SITE_SUBDIR}
@ -19,18 +19,24 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= A convenience package to install the compat4x libraries
WRKSRC= ${WRKDIR}/usr/lib/compat
NO_MTREE= yes
TARGET_DIR= ${PREFIX}/lib/compat
TARGET32_DIR= ${PREFIX}/lib32/compat
USE_RC_SUBR= 000.${PORTNAME}.sh
INSTALLS_SHLIB= yes
LDCONFIG_DIRS= %%PREFIX%%/lib/compat
.include <bsd.port.pre.mk>
.if ${OSVERSION} > 700011
USE_LDCONFIG= ${TARGET_DIR}
PLIST_SUB+= USE_LDCONFIG=""
.else
NO_MTREE= yes
USE_RC_SUBR= 000.${PORTNAME}.sh
SUB_LIST+= LDCONFIG="${LDCONFIG}"
PLIST_SUB+= USE_LDCONFIG="@comment "
.endif
.if ${OSVERSION} >= 600016
RUN_DEPENDS= ${LOCALBASE}/share/compat/locale/UTF-8/LC_CTYPE:${PORTSDIR}/misc/localedata
@ -82,11 +88,15 @@ PLIST_SUB+= I386_ONLY="@comment "
.if ${ARCH} == amd64
PLIST_SUB+= AMD64_ONLY=""
PLIST_SUB+= LDCONFIG_LIB32="${LDCONFIG} -32"
.if defined(USE_RC_SUBR)
SUB_LIST+= AMD64="" TARGET32_DIR="${TARGET32_DIR}"
.endif
.else
PLIST_SUB+= AMD64_ONLY="@comment "
.if defined(USE_RC_SUBR)
SUB_LIST+= AMD64="@comment "
.endif
.endif
OPENSSL_LIBS= libcrypto.so.1 libcrypto.so.2 libssl.so.1 libssl.so.2
.if defined(FORCE_VULNERABLE_OPENSSL)
@ -128,6 +138,7 @@ do-extract:
.endif
post-extract:
.if defined(USE_RC_SUBR)
@( ${ECHO} ""; \
${ECHO} "******************************************************"; \
${ECHO} "To enable the ldconfig of these libraries at boot time"; \
@ -135,8 +146,8 @@ post-extract:
${ECHO} "/etc/rc.conf.local or /etc/rc.conf"; \
${ECHO} "******************************************************"; \
${ECHO} ""; ) > ${WRKDIR}/pkg-message
PKGMESSAGE= ${WRKDIR}/pkg-message
.endif
NO_BUILD= yes
@ -154,6 +165,13 @@ do-install:
post-install:
@${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL
.if defined(USE_LDCONFIG)
@${ECHO} ${USE_LDCONFIG} > ${PREFIX}/libdata/ldconfig/${UNIQUENAME}
.if ${ARCH} == amd64
@${ECHO} ${TARGET32_DIR} > ${PREFIX}/libdata/ldconfig32/${UNIQUENAME}
.endif
.else
@${CAT} ${PKGMESSAGE}
.endif
.include <bsd.port.post.mk>

View File

@ -37,6 +37,8 @@
%%LIBDIR%%/compat/pam_ssh.so
%%LIBDIR%%/compat/pam_tacplus.so
%%LIBDIR%%/compat/pam_unix.so
%%USE_LDCONFIG%%libdata/ldconfig/compat4x
%%USE_LDCONFIG%%%%AMD64%%libdata/ldconfig32/compat4x
%%AMD64_ONLY%%@exec %%LDCONFIG_LIB32%% -m %D/%%LIBDIR%%/compat
@unexec rmdir %D/%%LIBDIR%%/compat 2>/dev/null || true
@comment Hardcode lib32 since we should not remove lib.

View File

@ -11,7 +11,7 @@
PORTNAME= compat5x
PORTVERSION= 5.4.0.8
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= misc
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR=lesi/compat5x
@ -23,13 +23,11 @@ COMMENT= A convenience package to install the compat5x libraries
ONLY_FOR_ARCHS= alpha amd64 i386 sparc64
USE_BZIP2= yes
NO_MTREE= yes
WRKSRC= ${WRKDIR}/${PORTNAME}
INSTALLS_SHLIB= yes
LDCONFIG_DIRS= %%PREFIX%%/lib/compat
TARGET_DIR= ${PREFIX}/lib/compat
TARGET32_DIR= ${PREFIX}/lib32/compat
USE_RC_SUBR= 000.${PORTNAME}.sh
.include <bsd.port.pre.mk>
@ -37,12 +35,20 @@ USE_RC_SUBR= 000.${PORTNAME}.sh
IGNORE= is for FreeBSD 6.x and newer
.endif
.if ${OSVERSION} > 700011
USE_LDCONFIG= ${TARGET_DIR}
PLIST_SUB+= USE_LDCONFIG=""
.else
NO_MTREE= yes
USE_RC_SUBR= 000.${PORTNAME}.sh
SUB_LIST+= LDCONFIG="${LDCONFIG}"
PLIST_SUB+= USE_LDCONFIG="@comment "
.endif
.if ${OSVERSION} >= 600016
RUN_DEPENDS= ${LOCALBASE}/share/compat/locale/UTF-8/LC_CTYPE:${PORTSDIR}/misc/localedata
.endif
SUB_LIST+= LDCONFIG="${LDCONFIG}"
.if ${ARCH} == alpha
PLIST_SUB+= ALPHA=""
.else
@ -51,11 +57,15 @@ PLIST_SUB+= ALPHA="@comment "
.if ${ARCH} == amd64
PLIST_SUB+= AMD64=""
PLIST_SUB+= LDCONFIG_LIB32="${LDCONFIG} -32"
.if defined(USE_RC_SUBR)
SUB_LIST+= AMD64="" TARGET32_DIR="${TARGET32_DIR}"
.endif
.else
PLIST_SUB+= AMD64="@comment "
.if defined(USE_RC_SUBR)
SUB_LIST+= AMD64="@comment "
.endif
.endif
.if ${ARCH} == i386
PLIST_SUB+= I386=""
.else
@ -68,6 +78,7 @@ PLIST_SUB+= SPARC64="@comment "
.endif
post-extract:
.if defined(USE_RC_SUBR)
@( ${ECHO} ""; \
${ECHO} "******************************************************"; \
${ECHO} "To enable the ldconfig of these libraries at boot time"; \
@ -75,8 +86,8 @@ post-extract:
${ECHO} "/etc/rc.conf.local or /etc/rc.conf"; \
${ECHO} "******************************************************"; \
${ECHO} ""; ) > ${WRKDIR}/pkg-message
PKGMESSAGE= ${WRKDIR}/pkg-message
.endif
NO_BUILD= yes
@ -90,6 +101,13 @@ do-install:
.endif
post-install:
.if defined(USE_LDCONFIG)
@${ECHO} ${USE_LDCONFIG} > ${PREFIX}/libdata/ldconfig/${UNIQUENAME}
.if ${ARCH} == amd64
@${ECHO} ${TARGET32_DIR} > ${PREFIX}/libdata/ldconfig32/${UNIQUENAME}
.endif
.else
@${CAT} ${PKGMESSAGE}
.endif
.include <bsd.port.post.mk>

View File

@ -107,6 +107,8 @@ lib/compat/pam_unix.so.2
lib/compat/snmp_atm.so.2
lib/compat/snmp_mibII.so.2
lib/compat/snmp_netgraph.so.2
%%USE_LDCONFIG%%libdata/ldconfig/compat5x
%%USE_LDCONFIG%%%%AMD64%%libdata/ldconfig32/compat5x
%%AMD64%%lib32/compat/libalias.so.4
%%AMD64%%lib32/compat/libarchive.so.1
%%AMD64%%lib32/compat/libatm.so.2