From 15fb8ccb41ce4cc02c78508b936fb74f7165683c Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 6 Oct 2009 12:34:44 +0300 Subject: [PATCH] Teach the internal dep generator about OCaml - OCaml seems to have fairly well detectable magic in its files, nice - Dont call the regular find-requires from the scripts now that internal is working --- build/rpmfc.c | 8 +++++++- build/rpmfc.h | 3 ++- macros.in | 3 +++ scripts/ocaml-find-requires.sh | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/build/rpmfc.c b/build/rpmfc.c index 308d7da..f215b82 100644 --- a/build/rpmfc.c +++ b/build/rpmfc.c @@ -471,6 +471,8 @@ static const struct rpmfcTokens_s const rpmfcTokens[] = { { "libtool library ", RPMFC_LIBTOOL|RPMFC_INCLUDE }, { "pkgconfig ", RPMFC_PKGCONFIG|RPMFC_INCLUDE }, + { "Objective caml ", RPMFC_OCAML|RPMFC_INCLUDE }, + /* XXX .NET executables and libraries. file(1) cannot differ from win32 * executables unfortunately :( */ { "Mono/.Net assembly", RPMFC_MONO|RPMFC_INCLUDE }, @@ -770,6 +772,10 @@ static int rpmfcSCRIPT(rpmfc fc) xx = rpmfcHelper(fc, 'P', "mono"); if (is_executable) xx = rpmfcHelper(fc, 'R', "mono"); + } else + if (fc->fcolor->vals[fc->ix] & RPMFC_OCAML) { + xx = rpmfcHelper(fc, 'P', "ocaml"); + xx = rpmfcHelper(fc, 'R', "ocaml"); } return 0; @@ -1115,7 +1121,7 @@ typedef const struct rpmfcApplyTbl_s { static const struct rpmfcApplyTbl_s const rpmfcApplyTable[] = { { rpmfcELF, RPMFC_ELF }, { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_BOURNE| - RPMFC_PERL|RPMFC_PYTHON|RPMFC_MONO| + RPMFC_PERL|RPMFC_PYTHON|RPMFC_MONO|RPMFC_OCAML| RPMFC_PKGCONFIG|RPMFC_LIBTOOL) }, { rpmfcMISC, RPMFC_FONT|RPMFC_TEXT }, { NULL, 0 } diff --git a/build/rpmfc.h b/build/rpmfc.h index 84808a3..96cb93f 100644 --- a/build/rpmfc.h +++ b/build/rpmfc.h @@ -33,7 +33,8 @@ enum FCOLOR_e { #define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32) /* (1 << 3) leaks into package headers, reserved */ - /* bits 4-7 unused */ + /* bits 4-6 unused */ + RPMFC_OCAML = (1 << 7), RPMFC_PKGCONFIG = (1 << 8), RPMFC_LIBTOOL = (1 << 9), RPMFC_BOURNE = (1 << 10), diff --git a/macros.in b/macros.in index d21b042..6b64690 100644 --- a/macros.in +++ b/macros.in @@ -496,6 +496,9 @@ print (t)\ %__pkgconfig_provides %{_rpmconfigdir}/pkgconfigdeps.sh --provides %__pkgconfig_requires %{_rpmconfigdir}/pkgconfigdeps.sh --requires +%__ocaml_provides %{_rpmconfigdir}/ocaml-find-provides.sh +%__ocaml_requires %{_rpmconfigdir}/ocaml-find-requires.sh + %__fontconfig_provides %{_rpmconfigdir}/fontconfig.prov %__desktop_provides %{_rpmconfigdir}/desktop-file.prov diff --git a/scripts/ocaml-find-requires.sh b/scripts/ocaml-find-requires.sh index 654747f..6ab0fa9 100644 --- a/scripts/ocaml-find-requires.sh +++ b/scripts/ocaml-find-requires.sh @@ -39,7 +39,7 @@ done files=`sed "s/['\"]/\\\&/g"` # Use ordinary find-requires first. -echo $files | tr [:blank:] '\n' | /usr/lib/rpm/find-requires +# echo $files | tr [:blank:] '\n' | /usr/lib/rpm/find-requires # Get list of .cmi, .cmo and .cma files. files=`echo $files | tr [:blank:] '\n' | grep '\.cm[ioa]$'` -- 2.7.4