[js-of-ocaml/f16] initial import
Scott Tsai
scottt at fedoraproject.org
Thu Dec 22 20:17:27 UTC 2011
commit d08e15c8d523c99d7c2f65dd7fb0b3cf8a9656c3
Author: Scott Tsai <scottt.tw at gmail.com>
Date: Fri Dec 23 04:16:23 2011 +0800
initial import
.gitignore | 1 +
Makefile.common.js-of-ocaml.examples | 21 ++++++++
js-of-ocaml.spec | 95 ++++++++++++++++++++++++++++++++++
sources | 1 +
4 files changed, 118 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..b4d7218 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/js_of_ocaml-1.0.9.tar.gz
diff --git a/Makefile.common.js-of-ocaml.examples b/Makefile.common.js-of-ocaml.examples
new file mode 100644
index 0000000..8aab968
--- /dev/null
+++ b/Makefile.common.js-of-ocaml.examples
@@ -0,0 +1,21 @@
+LIBNAME=js_of_ocaml
+COMP=js_of_ocaml
+JSLIBDIR=$(wildcard /usr/lib*/ocaml/js_of_ocaml)
+JSFILES=$(JSLIBDIR)/runtime.js
+OCAMLC=ocamlfind ocamlc -package lwt -pp "camlp4o $(JSLIBDIR)/pa_js.cmo" -I $(JSLIBDIR) -g
+STDLIB=$(LIBNAME).cma
+
+$(NAME).js: $(NAME).byte
+ $(COMP) -noruntime $(JSFILES) $(NAME).byte $(OPTIONS)
+
+$(NAME).byte: $(OBJS)
+ $(OCAMLC) -linkpkg -o $@ $(STDLIB) $^
+
+%.cmo: %.ml
+ $(OCAMLC) -c $<
+
+%.cmi: %.mli
+ $(OCAMLC) -c $<
+
+clean::
+ rm -f *.cm[io] $(NAME).byte $(NAME).js
diff --git a/js-of-ocaml.spec b/js-of-ocaml.spec
new file mode 100644
index 0000000..7ca3b82
--- /dev/null
+++ b/js-of-ocaml.spec
@@ -0,0 +1,95 @@
+%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
+%global debug_package %{nil}
+%global __provides_exclude_from ^%{_libdir}/ocaml/stublibs/.*\.so$
+
+Name: js-of-ocaml
+Version: 1.0.9
+Release: 1%{?dist}
+Summary: An OCaml to Javascript compiler
+
+License: LGPLv2+ with exceptions
+URL: http://ocsigen.org/js_of_ocaml
+Source0: http://ocsigen.org/download/js_of_ocaml-%{version}.tar.gz
+
+# Allow examples to be built with the distro packaged js-of-ocaml
+Source1: Makefile.common.js-of-ocaml.examples
+
+BuildRequires: ocaml
+BuildRequires: ocaml-findlib-devel
+BuildRequires: ocaml-ocamldoc
+BuildRequires: ocaml-camlp4-devel
+BuildRequires: ocaml-lwt >= 2.3.0
+BuildRequires: chrpath
+ExclusiveArch: %{ocaml_arches}
+
+%description
+js_of_ocaml is a compiler of OCaml byte-code to JavaScript.
+It makes it possible to run OCaml programs in a web browser.
+Its key features are the following:
+ * the whole language, and most of the standard library are
+ supported;
+ * the generated code can be used with any web server and browser;
+ * you can use a standard installation of OCaml to compile your
+ programs. In particular, you do not have to recompile a library to
+ use it with Js_of_ocaml. You just have to link your program with a
+ specific library to interface with the browser APIs.
+
+%package doc
+Summary: User manual and other documentation for %{name}
+Group: Development/Libraries
+BuildArch: noarch
+License: (LGPLv2+ with exceptions) and GPLv2+ and WTFPL
+
+%description doc
+The %{name}-doc package contains the user manual, API
+reference and examples for %{name}.
+
+%prep
+%setup -q -n js_of_ocaml-%{version}
+
+
+%build
+make
+
+%install
+export DESTDIR=$RPM_BUILD_ROOT
+export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
+mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
+D=$RPM_BUILD_ROOT%{_libdir}/ocaml/js_of_ocaml
+mkdir -p $D
+cp -p lib/META \
+ lib/*.{cmi,cma,a,mli} \
+ lib/syntax/pa_js.cmo \
+ runtime/runtime.js \
+ $D
+mkdir -p $RPM_BUILD_ROOT%{_bindir}
+cp -p compiler/js_of_ocaml $RPM_BUILD_ROOT%{_bindir}/
+cp -p lib/dlljs_of_ocaml.so $OCAMLFIND_DESTDIR/stublibs/
+
+strip $OCAMLFIND_DESTDIR/stublibs/dll*.so
+chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so
+
+# NB. Do NOT strip the binaries and prevent prelink from stripping them too.
+# (https://bugzilla.redhat.com/show_bug.cgi?id=435559)
+mkdir -p $RPM_BUILD_ROOT/etc/prelink.conf.d
+echo '-b /usr/bin/js_of_ocaml' > $RPM_BUILD_ROOT/etc/prelink.conf.d/js-of-ocaml.conf
+
+# docs
+find examples '(' -name '*.cmi' -or -name '*.cmo' -or -name '*.byte' -or -name '.depend' ')' -exec rm '{}' ';'
+# Replacing Makefile.common allows the user to build the examples
+cp -p %{SOURCE1} examples/Makefile.common
+
+%files
+%doc LICENSE README
+%{_libdir}/ocaml/js_of_ocaml/
+%{_libdir}/ocaml/stublibs/*.so
+%{_bindir}/js_of_ocaml
+%config(noreplace) /etc/prelink.conf.d/js-of-ocaml.conf
+
+%files doc
+%doc LICENSE README examples doc/api-html doc/manual-aux doc/manual-wiki
+
+
+%changelog
+* Tue Dec 13 2011 Scott Tsai <scottt.tw at gmail.com> 1.0.9-1
+- Initial RPM release.
diff --git a/sources b/sources
index e69de29..45c1ad7 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+e3ddba862f046859eb0d0456853d195a js_of_ocaml-1.0.9.tar.gz
More information about the scm-commits
mailing list