summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
Diffstat (limited to 'devel')
-rw-r--r--devel/ocaml-findlib/Makefile18
-rw-r--r--devel/ocaml-findlib/PLIST3
-rw-r--r--devel/ocaml-findlib/files/ocaml-findlib-register.sh23
3 files changed, 42 insertions, 2 deletions
diff --git a/devel/ocaml-findlib/Makefile b/devel/ocaml-findlib/Makefile
index ebd0818caaf..cfb82b4ec08 100644
--- a/devel/ocaml-findlib/Makefile
+++ b/devel/ocaml-findlib/Makefile
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.1.1.1 2006/05/20 10:19:35 rillig Exp $
+# $NetBSD: Makefile,v 1.2 2006/05/20 13:47:43 rillig Exp $
#
DISTNAME= findlib-1.1.2pl1
PKGNAME= ocaml-${DISTNAME}
+PKGREVISION= 1
CATEGORIES= devel
MASTER_SITES= http://www.ocaml-programming.de/packages/
@@ -19,8 +20,23 @@ CONFIGURE_ARGS+= -config ${PKG_SYSCONFDIR}/ocamlfind.conf
EGDIR= ${PREFIX}/share/examples/ocaml-findlib
INSTALL_MAKE_FLAGS+= OCAMLFIND_CONF=${EGDIR}/ocamlfind.conf
+INSTALLATION_DIRS= libexec
CONF_FILES= ${EGDIR}/ocamlfind.conf ${PKG_SYSCONFDIR}/ocamlfind.conf
+USE_TOOLS+= fgrep:run sh:run
+SUBST_CLASSES+= ofr
+SUBST_STAGE.ofr= pre-configure
+SUBST_FILES.ofr= ocaml-findlib-register.sh
+SUBST_SED.ofr= -e 's,@SH@,'${SH:Q}','
+SUBST_SED.ofr+= -e 's,@PREFIX@,${PREFIX},'
+SUBST_SED.ofr+= -e 's,@FGREP@,'${FGREP:Q}','
+
+post-extract:
+ ${CP} ${FILESDIR}/ocaml-findlib-register.sh ${WRKSRC}
+
+post-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/ocaml-findlib-register.sh ${PREFIX}/libexec/ocaml-findlib-register
+
.include "../../lang/ocaml/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/devel/ocaml-findlib/PLIST b/devel/ocaml-findlib/PLIST
index dbd3df68e5f..85606dd6ae6 100644
--- a/devel/ocaml-findlib/PLIST
+++ b/devel/ocaml-findlib/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2006/05/20 10:19:35 rillig Exp $
+@comment $NetBSD: PLIST,v 1.2 2006/05/20 13:47:43 rillig Exp $
bin/ocamlfind
bin/safe_camlp4
lib/ocaml/site-lib/bigarray/META
@@ -28,6 +28,7 @@ lib/ocaml/site-lib/str/META
lib/ocaml/site-lib/threads/META
lib/ocaml/site-lib/unix/META
lib/ocaml/topfind
+libexec/ocaml-findlib-register
man/man1/ocamlfind.1
man/man5/META.5
man/man5/findlib.conf.5
diff --git a/devel/ocaml-findlib/files/ocaml-findlib-register.sh b/devel/ocaml-findlib/files/ocaml-findlib-register.sh
new file mode 100644
index 00000000000..accf6dc2e3e
--- /dev/null
+++ b/devel/ocaml-findlib/files/ocaml-findlib-register.sh
@@ -0,0 +1,23 @@
+#! @SH@
+set -eu
+
+ldconf="@PREFIX@/lib/ocaml/ld.conf"
+fgrep="@FGREP@"
+
+usage() {
+ echo "usage: $0 <add|del> directory" 1>&2
+ exit 1
+}
+
+test $# = 2 || usage
+
+action="$1"
+dir="$2"
+
+test "$action" = "add" || test "$action" = "del" || usage
+
+$fgrep -v -- "$dir" < "${ldconf}" > "${ldconf}.tmp"
+if test "$action" = "add"; then
+ printf "%s\\n" "$dir" >> "${ldconf}.tmp"
+fi
+mv -f "${ldconf}.tmp" "${ldconf}"