diff options
author | itetcu <itetcu@FreeBSD.org> | 2006-08-07 06:55:27 +0000 |
---|---|---|
committer | itetcu <itetcu@FreeBSD.org> | 2006-08-07 06:55:27 +0000 |
commit | d09a462df0921e3314b44ba70cb49655707a05bb (patch) | |
tree | 91dc9e20f12407ac388c6e3082efafae1a173168 /lang/ocaml | |
parent | 4bbe3ccfa3407893ad4dbd255d57d4da78ac760d (diff) | |
download | FreeBSD-ports-d09a462df0921e3314b44ba70cb49655707a05bb.zip FreeBSD-ports-d09a462df0921e3314b44ba70cb49655707a05bb.tar.gz |
Add USE_OCAML_WASH hack to allow ocaml ports delete shared ocaml dirs on
uninstall. Required when installed to non-standard prefix.
PR: ports/101525
Submitted by: Stanislav Sedov (maintainer)
Diffstat (limited to 'lang/ocaml')
-rw-r--r-- | lang/ocaml/bsd.ocaml.mk | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/lang/ocaml/bsd.ocaml.mk b/lang/ocaml/bsd.ocaml.mk index c77b5ee..b1d4890 100644 --- a/lang/ocaml/bsd.ocaml.mk +++ b/lang/ocaml/bsd.ocaml.mk @@ -1,6 +1,6 @@ # ex:ts=4 # -# $MBSDlabs: portmk/bsd.ocaml.mk,v 1.17 2006/08/02 19:31:46 stas Exp $ +# $MBSDlabs: portmk/bsd.ocaml.mk,v 1.18 2006/08/06 18:47:23 stas Exp $ # $FreeBSD$ # # bsd.ocaml.mk - Support for the Objective Caml language packages @@ -20,6 +20,9 @@ # USE_OCAML_LDCONFIG - Set if your port installs shared libraries # into ocaml site-lib dir. OCaml ld.conf file # will be automatically processed. +# USE_OCAML_WASH - Set if your port wants to automatically +# purge shared Ocaml dirs on uninstall. It's +# useful when installing to non-standard PREFIX # OCAML_PKGDIRS - Directories under site-lib to be processed # if USE_OCAML_FINDLIB specified. # Default: ${PORTNAME} @@ -90,7 +93,7 @@ PLIST_SUB+= OCAML_SITELIBDIR="${OCAML_SITELIBDIR}" .if defined(USE_OCAML_FINDLIB) || defined(USE_OCAML_LDCONFIG) . if !target(post-install-script) -post-install-script: ocaml-findlib ocaml-ldconfig +post-install-script: ocaml-findlib ocaml-ldconfig ocaml-wash . endif .endif @@ -142,6 +145,18 @@ ocaml-ldconfig: . endif .endif +.if defined(USE_OCAML_WASH) +. if !target(ocaml-wash) +ocaml-wash: + @${ECHO_CMD} "@unexec rmdir %D/${OCAML_SITELIBDIR} 2>/dev/null || true"\ + >> ${TMPPLIST} +# If ld.conf is empty + @${ECHO_CMD} "@unexec if [ ! -s %D/${OCAML_LDCONF} ]; then ${RM} -f %D/${OCAML_LDCONF}; fi || true" >> ${TMPPLIST} + @${ECHO_CMD} "@unexec rmdir %D/${OCAML_LIBDIR} 2>/dev/null || true" \ + >> ${TMPPLIST} +. endif +.endif + .if !target(ocaml-findlib) ocaml-findlib: @${DO_NADA} @@ -152,6 +167,11 @@ ocaml-ldconfig: @${DO_NADA} .endif +.if !target(ocaml-wash) +ocaml-wash: + @${DO_NADA} +.endif + # # XXX: temporary workaround for non-standard PREFIX # @@ -164,15 +184,6 @@ add-plist-post: @${DO_NADA} . endif -. if (${PREFIX} != ${LOCALBASE}) - @${ECHO_CMD} "@unexec rmdir %D/${OCAML_SITELIBDIR} 2>/dev/null || true"\ - >> ${TMPPLIST} -# If PREFIX is non-standard and ld.conf is empty - @${ECHO_CMD} "@unexec if [ ! -s %D/${OCAML_LDCONF} ]; then ${RM} -f %D/${OCAML_LDCONF}; fi || true" >> ${TMPPLIST} - @${ECHO_CMD} "@unexec rmdir %D/${OCAML_LIBDIR} 2>/dev/null || true" \ - >> ${TMPPLIST} -. endif - # If we are using PORTDOCS macro port cannot delete OCAML_DOCSDIR, so # we shoud try to accomodate it . if defined(PORTDOCS) |