Skip site navigation (1)Skip section navigation (2)
Date:      Sun,  6 Aug 2006 22:53:34 +0400 (MSD)
From:      Stanislav Sedov <ssedov@mbsd.msk.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/101525: [MAINTAINER] lang/ocaml: add patch to allow painless non-standard PREFIX installation/removal
Message-ID:  <20060806185334.8D8B912C83@fonon.realnet>
Resent-Message-ID: <200608061900.k76J0T9G018165@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         101525
>Category:       ports
>Synopsis:       [MAINTAINER] lang/ocaml: add patch to allow painless non-standard PREFIX installation/removal
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 06 19:00:28 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Stanislav Sedov
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
MBSD labs, Inc.
>Environment:
System: FreeBSD fonon.realnet 7.0-CURRENT FreeBSD 7.0-CURRENT #1: Wed Aug  2 21:44:37 MSD
>Description:
Add hack to allow ocaml ports delete shared ocaml dirs on uninstall. Required
when installed to non-standard prefix.

>How-To-Repeat:
>Fix:

--- ocaml-3.09.2_1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/lang/ocaml/bsd.ocaml.mk /var/tmp/ocaml/bsd.ocaml.mk
--- /usr/ports/lang/ocaml/bsd.ocaml.mk	Sun Aug  6 22:50:19 2006
+++ /var/tmp/ocaml/bsd.ocaml.mk	Sun Aug  6 22:50:55 2006
@@ -1,7 +1,7 @@
 # ex:ts=4
 #
-# $MBSDlabs: portmk/bsd.ocaml.mk,v 1.17 2006/08/02 19:31:46 stas Exp $
-# $FreeBSD: /repoman/r/pcvs/ports/lang/ocaml/bsd.ocaml.mk,v 1.2 2006/08/04 14:22:50 itetcu 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 @@
 
 .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 @@
 . 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 @@
 	@${DO_NADA}
 .endif
 
+.if !target(ocaml-wash)
+ocaml-wash:
+	@${DO_NADA}
+.endif
+
 #
 # XXX: temporary workaround for non-standard PREFIX
 #
@@ -162,15 +182,6 @@
 	@${ECHO_CMD} "@unexec rmdir %D 2> /dev/null || true" >> ${TMPPLIST}
 . else
 	@${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
--- ocaml-3.09.2_1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060806185334.8D8B912C83>