aboutsummaryrefslogtreecommitdiff
path: root/lang/ocaml
diff options
context:
space:
mode:
authorIon-Mihai Tetcu <itetcu@FreeBSD.org>2006-08-07 06:55:27 +0000
committerIon-Mihai Tetcu <itetcu@FreeBSD.org>2006-08-07 06:55:27 +0000
commit1bfe4026472d34741aa5132fd31dfff26b3c7f6e (patch)
treec6130d881471ac1ad7b0cdba4c329e0d85dc2bf1 /lang/ocaml
parent14bb2085c4dc161be907891ce108dad720144a8e (diff)
downloadports-1bfe4026472d34741aa5132fd31dfff26b3c7f6e.tar.gz
ports-1bfe4026472d34741aa5132fd31dfff26b3c7f6e.zip
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)
Notes
Notes: svn path=/head/; revision=169905
Diffstat (limited to 'lang/ocaml')
-rw-r--r--lang/ocaml/bsd.ocaml.mk33
1 files changed, 22 insertions, 11 deletions
diff --git a/lang/ocaml/bsd.ocaml.mk b/lang/ocaml/bsd.ocaml.mk
index c77b5eef40fe..b1d48900f33d 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)