Provide new style rc.d boot scripts, using the infrastructure that

is present in both bsd.port.mk and rc.subr to make things as simple
as possible.
This commit is contained in:
Doug Barton 2005-12-18 21:04:37 +00:00
parent 3d571a7c4d
commit 08c14fd9a4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=151512
7 changed files with 71 additions and 21 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= compat4x
PORTVERSION= ${COMPAT4X_PORTVERSION}
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= misc
MASTER_SITES= ${COMPAT4X_MASTER_SITES}
MASTER_SITE_SUBDIR= ${COMPAT4X_MASTER_SITE_SUBDIR}
@ -22,12 +22,16 @@ WRKSRC= ${WRKDIR}/usr/lib/compat
NO_MTREE= yes
TARGET_DIR= ${PREFIX}/lib/compat
TARGET32_DIR= ${PREFIX}/lib32/compat
USE_RC_SUBR= ${PORTNAME}.sh
INSTALLS_SHLIB= yes
LDCONFIG_DIRS= %%PREFIX%%/lib/compat
.include <bsd.port.pre.mk>
SUB_LIST+= LDCONFIG="${LDCONFIG}"
.if ${OSVERSION} >= 600016
RUN_DEPENDS= ${LOCALBASE}/share/compat/locale/UTF-8/LC_CTYPE:${PORTSDIR}/misc/localedata
.endif
@ -41,7 +45,7 @@ COMPAT4X_DISTFILES= ${PORTNAME}.aa \
.elif ${ARCH} == amd64
ARCH= i386
PKGNAMESUFFIX= -i386
TARGET_DIR= ${PREFIX}/lib32/compat
TARGET_DIR= ${TARGET32_DIR}
PLIST_SUB+= LIBDIR="lib32"
COMPAT4X_DISTFILES= ${PORTNAME}.aa \
${PORTNAME}.ab
@ -78,8 +82,10 @@ PLIST_SUB+= I386_ONLY="@comment "
.if ${ARCH} == amd64
PLIST_SUB+= AMD64_ONLY=""
PLIST_SUB+= LDCONFIG_LIB32="${LDCONFIG} -32"
SUB_LIST+= AMD64="" TARGET32_DIR="${TARGET32_DIR}"
.else
PLIST_SUB+= AMD64_ONLY="@comment "
SUB_LIST+= AMD64="@comment "
.endif
OPENSSL_LIBS= libcrypto.so.1 libcrypto.so.2 libssl.so.1 libssl.so.2
@ -121,15 +127,10 @@ do-extract:
.endfor
.endif
do-build:
@( ${ECHO_CMD} '#!/bin/sh'; ${ECHO_CMD} '${LDCONFIG} -m ${LDCONFIG_RUNLIST}'; \
) > ${WRKDIR}/000.${PORTNAME}.sh
.if ${TARGET_DIR} == ${PREFIX}/lib32/compat
@${ECHO_CMD} '${LDCONFIG} -32 -m ${TARGET_DIR}' >> ${WRKDIR}/000.${PORTNAME}.sh
.endif
NO_BUILD= yes
do-install:
${MKDIR} ${TARGET_DIR} ${PREFIX}/etc/rc.d
${MKDIR} ${TARGET_DIR}
${INSTALL_DATA} ${WRKSRC}/* ${TARGET_DIR}/
.if ${OSVERSION} >= 500000
.for lib in ${FREEBSD4_LIBS}
@ -139,7 +140,6 @@ do-install:
.if ${ARCH} == amd64
${LDCONFIG} -32 -m ${TARGET32_DIR}
.endif
${INSTALL_SCRIPT} ${WRKDIR}/000.${PORTNAME}.sh ${PREFIX}/etc/rc.d/
post-install:
@${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL

View file

@ -0,0 +1,27 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: compat4x
# REQUIRE: mountcritremote
#
# Add the following to /etc/rc.conf[.local] to enable this service
#
# compat4x_enable="YES"
#
. %%RC_SUBR%%
name=compat4x
rcvar=`set_rcvar`
command=%%LDCONFIG%%
command_args='-m %%PREFIX%%/lib/compat'
%%AMD64%%
%%AMD64%%start_postcmd=${name}_poststart
%%AMD64%%compat4x_poststart () {
%%AMD64%% %%LDCONFIG%% -32 -m %%TARGET32_DIR%%
%%AMD64%%}
load_rc_config ${name}
run_rc_command "$1"

View file

@ -1,4 +1,3 @@
etc/rc.d/000.compat4x.sh
%%FORBIDDEN:%%lib/compat/libcrypto.so.1
%%FORBIDDEN:%%lib/compat/libcrypto.so.2
lib/compat/libfetch.so.2

View file

@ -1,4 +1,3 @@
etc/rc.d/000.compat4x.sh
%%LIBDIR%%/compat/libc.so.4
@unexec if [ -e %B/libc_r.so.4.compat3x ]; then ln -sf libc_r.so.4.compat3x %B/libc_r.so.4; else rm %B/libc_r.so.4; fi
%%LIBDIR%%/compat/libc_r.so.4.compat4x

View file

@ -11,6 +11,7 @@
PORTNAME= compat5x
PORTVERSION= 5.4.0.8
PORTREVISION= 1
CATEGORIES= misc
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR=lesi/compat5x
@ -28,7 +29,7 @@ INSTALLS_SHLIB= yes
LDCONFIG_DIRS= %%PREFIX%%/lib/compat
TARGET_DIR= ${PREFIX}/lib/compat
TARGET32_DIR= ${PREFIX}/lib32/compat
RCSCRIPT= ${WRKDIR}/000.compat5x.sh
USE_RC_SUBR= ${PORTNAME}.sh
.include <bsd.port.pre.mk>
@ -40,6 +41,8 @@ IGNORE= is for FreeBSD 6.x and newer
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
@ -48,8 +51,10 @@ PLIST_SUB+= ALPHA="@comment "
.if ${ARCH} == amd64
PLIST_SUB+= AMD64=""
PLIST_SUB+= LDCONFIG_LIB32="${LDCONFIG} -32"
SUB_LIST+= AMD64="" TARGET32_DIR="${TARGET32_DIR}"
.else
PLIST_SUB+= AMD64="@comment "
SUB_LIST+= AMD64="@comment "
.endif
.if ${ARCH} == i386
PLIST_SUB+= I386=""
@ -62,12 +67,7 @@ PLIST_SUB+= SPARC64=""
PLIST_SUB+= SPARC64="@comment "
.endif
do-build:
${ECHO_CMD} '#!/bin/sh' > ${RCSCRIPT}
${ECHO_CMD} '${LDCONFIG} -m ${LDCONFIG_RUNLIST}' >> ${RCSCRIPT}
.if ${ARCH} == amd64
${ECHO_CMD} '${LDCONFIG} -32 -m ${TARGET32_DIR}' >> ${RCSCRIPT}
.endif
NO_BUILD= yes
do-install:
${MKDIR} ${TARGET_DIR}
@ -77,6 +77,5 @@ do-install:
(cd ${WRKSRC}/lib32 && ${INSTALL_DATA} *.so.* ${TARGET32_DIR})
${LDCONFIG} -32 -m ${TARGET32_DIR}
.endif
${INSTALL_SCRIPT} ${RCSCRIPT} ${PREFIX}/etc/rc.d/
.include <bsd.port.post.mk>

View file

@ -0,0 +1,27 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: compat5x
# REQUIRE: mountcritremote
#
# Add the following to /etc/rc.conf[.local] to enable this service
#
# compat5x_enable="YES"
#
. %%RC_SUBR%%
name=compat5x
rcvar=`set_rcvar`
command=%%LDCONFIG%%
command_args='-m %%PREFIX%%/lib/compat'
%%AMD64%%
%%AMD64%%start_postcmd=${name}_poststart
%%AMD64%%compat5x_poststart () {
%%AMD64%% %%LDCONFIG%% -32 -m %%TARGET32_DIR%%
%%AMD64%%}
load_rc_config ${name}
run_rc_command "$1"

View file

@ -1,4 +1,3 @@
etc/rc.d/000.compat5x.sh
lib/compat/libalias.so.4
lib/compat/libarchive.so.1
lib/compat/libasn1.so.7