Initial import.
This commit is contained in:
parent
443883c133
commit
798c643482
|
@ -0,0 +1 @@
|
||||||
|
/menhir-20111019.tar.gz
|
|
@ -0,0 +1,123 @@
|
||||||
|
From 9b49e1917d623f7058a135bbfe1facbe1f700540 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Scott Tsai <scottt.tw@gmail.com>
|
||||||
|
Date: Sat, 17 Dec 2011 09:35:18 +0800
|
||||||
|
Subject: [PATCH] Makfile: use menhir-ocamldep instead off ocamldep.wrapper
|
||||||
|
|
||||||
|
---
|
||||||
|
demos/Makefile.shared | 2 +-
|
||||||
|
demos/OMakefile.shared | 2 +-
|
||||||
|
demos/calc-param/Makefile | 1 -
|
||||||
|
demos/calc-param/OMakefile | 6 +++---
|
||||||
|
demos/calc-two/Makefile | 1 -
|
||||||
|
demos/calc-two/OMakefile | 5 ++---
|
||||||
|
demos/calc/Makefile | 1 -
|
||||||
|
demos/calc/OMakefile | 1 -
|
||||||
|
8 files changed, 7 insertions(+), 12 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/demos/Makefile.shared b/demos/Makefile.shared
|
||||||
|
index 93add01..29e2207 100644
|
||||||
|
--- a/demos/Makefile.shared
|
||||||
|
+++ b/demos/Makefile.shared
|
||||||
|
@@ -119,7 +119,7 @@ ifndef OCAMLDEP
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef OCAMLDEPWRAPPER
|
||||||
|
- OCAMLDEPWRAPPER:= ./ocamldep.wrapper
|
||||||
|
+ OCAMLDEPWRAPPER:= $(shell which menhir-ocamldep)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef OCAMLLEX
|
||||||
|
diff --git a/demos/OMakefile.shared b/demos/OMakefile.shared
|
||||||
|
index af8e0ca..4ff1157 100644
|
||||||
|
--- a/demos/OMakefile.shared
|
||||||
|
+++ b/demos/OMakefile.shared
|
||||||
|
@@ -139,7 +139,7 @@ if $(not $(defined OCAMLDEP))
|
||||||
|
export
|
||||||
|
|
||||||
|
if $(not $(defined OCAMLDEPWRAPPER))
|
||||||
|
- OCAMLDEPWRAPPER = ./ocamldep.wrapper
|
||||||
|
+ OCAMLDEPWRAPPER = $(shell which menhir-ocamldep)
|
||||||
|
export
|
||||||
|
|
||||||
|
if $(not $(defined OCAMLLEX))
|
||||||
|
diff --git a/demos/calc-param/Makefile b/demos/calc-param/Makefile
|
||||||
|
index 35d91ef..2f10b9a 100644
|
||||||
|
--- a/demos/calc-param/Makefile
|
||||||
|
+++ b/demos/calc-param/Makefile
|
||||||
|
@@ -3,7 +3,6 @@ PGFLAGS := --infer
|
||||||
|
GENERATED := parser.ml parser.mli lexer.ml tokens.ml tokens.mli
|
||||||
|
MODULES := parser lexer calc
|
||||||
|
EXECUTABLE := calc
|
||||||
|
-OCAMLDEPWRAPPER := ../ocamldep.wrapper
|
||||||
|
include ../Makefile.shared
|
||||||
|
$(eval $(call menhir_monomodule,tokens,--only-tokens))
|
||||||
|
$(eval $(call menhir_multimodule,parser,tokens.mly parser.mly,--external-tokens Tokens))
|
||||||
|
diff --git a/demos/calc-param/OMakefile b/demos/calc-param/OMakefile
|
||||||
|
index 3a54e55..9241e7a 100644
|
||||||
|
--- a/demos/calc-param/OMakefile
|
||||||
|
+++ b/demos/calc-param/OMakefile
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
-GENERATED = parser.ml parser.mli lexer.ml
|
||||||
|
+GENERATED = parser.ml parser.mli lexer.ml tokens.ml tokens.mli
|
||||||
|
MODULES = parser lexer calc
|
||||||
|
EXECUTABLE = calc
|
||||||
|
-OCAMLDEPWRAPPER = ../ocamldep.wrapper
|
||||||
|
include ../OMakefile.shared
|
||||||
|
-MenhirAuto()
|
||||||
|
+MenhirMono(tokens,--only-tokens)
|
||||||
|
+MenhirMulti(parser,tokens.mly parser.mly,--external-tokens Tokens)
|
||||||
|
.DEFAULT: $(EXECUTABLE)$(OSUFFIX)
|
||||||
|
diff --git a/demos/calc-two/Makefile b/demos/calc-two/Makefile
|
||||||
|
index 29a6d52..c5dbc39 100644
|
||||||
|
--- a/demos/calc-two/Makefile
|
||||||
|
+++ b/demos/calc-two/Makefile
|
||||||
|
@@ -3,7 +3,6 @@ PGFLAGS := --infer
|
||||||
|
GENERATED := tokens.ml tokens.mli algebraic.ml algebraic.mli reverse.ml reverse.mli lexer.ml
|
||||||
|
MODULES := algebraic reverse lexer calc
|
||||||
|
EXECUTABLE := calc
|
||||||
|
-OCAMLDEPWRAPPER := ../ocamldep.wrapper
|
||||||
|
include ../Makefile.shared
|
||||||
|
$(eval $(call menhir_monomodule,tokens,--only-tokens))
|
||||||
|
$(eval $(call menhir_multimodule,algebraic,tokens.mly algebraic.mly common.mly,--external-tokens Tokens))
|
||||||
|
diff --git a/demos/calc-two/OMakefile b/demos/calc-two/OMakefile
|
||||||
|
index 0cb1482..b725fa6 100644
|
||||||
|
--- a/demos/calc-two/OMakefile
|
||||||
|
+++ b/demos/calc-two/OMakefile
|
||||||
|
@@ -1,9 +1,8 @@
|
||||||
|
GENERATED = tokens.ml tokens.mli algebraic.ml algebraic.mli reverse.ml reverse.mli lexer.ml
|
||||||
|
MODULES = algebraic reverse lexer calc
|
||||||
|
EXECUTABLE = calc
|
||||||
|
-OCAMLDEPWRAPPER = ../ocamldep.wrapper
|
||||||
|
include ../OMakefile.shared
|
||||||
|
MenhirMono(tokens,--only-tokens)
|
||||||
|
-MenhirMulti(algebraic,tokens.mly algebraic.mly,--external-tokens Tokens)
|
||||||
|
-MenhirMulti(reverse,tokens.mly reverse.mly,--external-tokens Tokens)
|
||||||
|
+MenhirMulti(algebraic,tokens.mly algebraic.mly common.mly,--external-tokens Tokens)
|
||||||
|
+MenhirMulti(reverse,tokens.mly reverse.mly common.mly,--external-tokens Tokens)
|
||||||
|
.DEFAULT: $(EXECUTABLE)$(OSUFFIX)
|
||||||
|
diff --git a/demos/calc/Makefile b/demos/calc/Makefile
|
||||||
|
index f411226..f80582d 100644
|
||||||
|
--- a/demos/calc/Makefile
|
||||||
|
+++ b/demos/calc/Makefile
|
||||||
|
@@ -3,6 +3,5 @@ PGFLAGS := --infer
|
||||||
|
GENERATED := parser.ml parser.mli lexer.ml
|
||||||
|
MODULES := parser lexer calc
|
||||||
|
EXECUTABLE := calc
|
||||||
|
-OCAMLDEPWRAPPER := ../ocamldep.wrapper
|
||||||
|
include ../Makefile.shared
|
||||||
|
include ../Makefile.auto
|
||||||
|
diff --git a/demos/calc/OMakefile b/demos/calc/OMakefile
|
||||||
|
index 3a54e55..00e1a5c 100644
|
||||||
|
--- a/demos/calc/OMakefile
|
||||||
|
+++ b/demos/calc/OMakefile
|
||||||
|
@@ -1,7 +1,6 @@
|
||||||
|
GENERATED = parser.ml parser.mli lexer.ml
|
||||||
|
MODULES = parser lexer calc
|
||||||
|
EXECUTABLE = calc
|
||||||
|
-OCAMLDEPWRAPPER = ../ocamldep.wrapper
|
||||||
|
include ../OMakefile.shared
|
||||||
|
MenhirAuto()
|
||||||
|
.DEFAULT: $(EXECUTABLE)$(OSUFFIX)
|
||||||
|
--
|
||||||
|
1.7.7.4
|
||||||
|
|
|
@ -0,0 +1,89 @@
|
||||||
|
%global debug_package %{nil}
|
||||||
|
%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
|
||||||
|
%if %opt
|
||||||
|
%global target opt
|
||||||
|
%else
|
||||||
|
%global target byte
|
||||||
|
%endif
|
||||||
|
|
||||||
|
Name: ocaml-menhir
|
||||||
|
Version: 20111019
|
||||||
|
Release: 2%{?dist}
|
||||||
|
Summary: LR(1) parser generator for OCaml
|
||||||
|
|
||||||
|
License: (QPL with exceptions) and (LGPLv2+ with exceptions)
|
||||||
|
URL: http://gallium.inria.fr/~fpottier/menhir/
|
||||||
|
Source0: http://gallium.inria.fr/~fpottier/menhir/menhir-%{version}.tar.gz
|
||||||
|
# Patch from Scott Tsai to allow demos to build outside of source tree
|
||||||
|
Patch0: 0001-Makfile-use-menhir-ocamldep-instead-of-ocamldep.wra.patch
|
||||||
|
|
||||||
|
BuildRequires: ocaml
|
||||||
|
BuildRequires: ocaml-findlib-devel
|
||||||
|
|
||||||
|
ExclusiveArch: %{ocaml_arches}
|
||||||
|
|
||||||
|
%description
|
||||||
|
Menhir is a LR(1) parser generator for the Objective Caml programming
|
||||||
|
language. That is, Menhir compiles LR(1) grammar specifications down to
|
||||||
|
OCaml code. Menhir was designed and implemented by François Pottier and
|
||||||
|
Yann Régis-Gianas.
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: Development files for %{name}
|
||||||
|
License: LGPLv2+ with exceptions
|
||||||
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
|
|
||||||
|
%description devel
|
||||||
|
The %{name}-devel package contains libraries and signature files
|
||||||
|
for developing applications that use %{name}.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n menhir-%{version}
|
||||||
|
%patch0 -p1
|
||||||
|
|
||||||
|
# Fix encodings
|
||||||
|
for f in AUTHORS menhir.1; do
|
||||||
|
iconv -f ISO8859-1 -t UTF-8 $f > $f.fixed
|
||||||
|
touch -r $f $f.fixed
|
||||||
|
mv -f $f.fixed $f
|
||||||
|
done
|
||||||
|
|
||||||
|
# Remove OMake generated files in the upstream tarball
|
||||||
|
rm -f demos/calc/.omakedb* demos/calc/*.omc
|
||||||
|
|
||||||
|
# Fix a dependency
|
||||||
|
sed "s|/usr/bin/env ocaml|/usr/bin/ocaml|" demos/ocamldep.wrapper > foo
|
||||||
|
touch -r demos/ocamldep.wrapper foo
|
||||||
|
mv -f foo demos/ocamldep.wrapper
|
||||||
|
chmod a+x demos/ocamldep.wrapper
|
||||||
|
|
||||||
|
%build
|
||||||
|
make PREFIX=%{_prefix} TARGET=%{target}
|
||||||
|
strip src/menhir
|
||||||
|
make -C demos clean
|
||||||
|
|
||||||
|
%install
|
||||||
|
export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
|
||||||
|
mkdir -p $OCAMLFIND_DESTDIR
|
||||||
|
make install PREFIX=$RPM_BUILD_ROOT%{_prefix} TARGET=%{target}
|
||||||
|
rm -fr $RPM_BUILD_ROOT%{_defaultdocdir}/menhir
|
||||||
|
|
||||||
|
# Install the ocamldep wrapper
|
||||||
|
mv demos/ocamldep.wrapper $RPM_BUILD_ROOT%{_bindir}/menhir-ocamldep
|
||||||
|
|
||||||
|
%files
|
||||||
|
%doc AUTHORS CHANGES LICENSE manual.pdf demos
|
||||||
|
%{_bindir}/menhir*
|
||||||
|
%{_mandir}/man1/menhir.1*
|
||||||
|
%{_datadir}/menhir/
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%{_libdir}/ocaml/menhirLib/
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Mon Dec 19 2011 Jerry James <loganjerry@gmail.com> - 20111019-2
|
||||||
|
- Change the subpackages to match Debian
|
||||||
|
- Add patch to allow building demos outside of the menhir source tree
|
||||||
|
|
||||||
|
* Wed Nov 9 2011 Jerry James <loganjerry@gmail.com> - 20111019-1
|
||||||
|
- Initial RPM
|
Loading…
Reference in New Issue