summaryrefslogtreecommitdiffstats
path: root/ocaml/ocaml-xmlm.spec
diff options
context:
space:
mode:
Diffstat (limited to 'ocaml/ocaml-xmlm.spec')
-rw-r--r--ocaml/ocaml-xmlm.spec87
1 files changed, 87 insertions, 0 deletions
diff --git a/ocaml/ocaml-xmlm.spec b/ocaml/ocaml-xmlm.spec
new file mode 100644
index 0000000..28f0b07
--- /dev/null
+++ b/ocaml/ocaml-xmlm.spec
@@ -0,0 +1,87 @@
+%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
+%global debug_package %{nil}
+%global _use_internal_dependency_generator 0
+%global __find_requires /usr/lib/rpm/ocaml-find-requires.sh
+%global __find_provides /usr/lib/rpm/ocaml-find-provides.sh
+%define libname %(echo %{name} | sed -e 's/^ocaml-//')
+
+Name: ocaml-xmlm
+Version: 1.2.0
+Release: 1%{?dist}
+Summary: A streaming XML codec
+
+License: BSD
+URL: http://erratique.ch/software/xmlm
+Source0: http://erratique.ch/software/xmlm/releases/xmlm-%{version}.tbz
+
+BuildRequires: ocaml >= 3.10.0
+BuildRequires: ocaml-findlib-devel
+BuildRequires: ocaml-ocamldoc
+BuildRequires: chrpath
+
+%description
+Xmlm is an OCaml streaming codec to decode and encode the XML data
+format. It can process XML documents without a complete in-memory
+representation of the data.
+
+
+%package devel
+Summary: Development files for %{name}
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+The %{name}-devel package contains libraries and signature files for
+developing applications that use %{name}.
+
+
+%prep
+%setup -q -n xmlm-%{version}
+
+
+%build
+./pkg/build true
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+# These rules work if the library uses 'ocamlfind install' to install itself.
+export DESTDIR=$RPM_BUILD_ROOT
+export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
+mkdir -p $RPM_BUILD_ROOT%{_bindir}
+mkdir -p $OCAMLFIND_DESTDIR/%{libname}
+
+cp -p _build/test/xmltrip.native $RPM_BUILD_ROOT%{_bindir}/xmltrip
+cp -p _build/pkg/META _build/src/xmlm.{a,cm*,mli} $OCAMLFIND_DESTDIR/%{libname}/
+
+strip $RPM_BUILD_ROOT%{_bindir}/xmltrip
+strip $OCAMLFIND_DESTDIR/%{libname}/xmlm.cmxs
+#chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so
+
+
+%files
+# LICENSE not bundled
+#doc LICENSE
+%{_bindir}/xmltrip
+%{_libdir}/ocaml/xmlm/
+%if %opt
+%exclude %{_libdir}/ocaml/*/*.a
+%exclude %{_libdir}/ocaml/*/*.cmxa
+%exclude %{_libdir}/ocaml/*/*.cmx
+%endif
+%exclude %{_libdir}/ocaml/*/*.mli
+
+
+%files devel
+# LICENSE not bundled
+%doc README.md CHANGES.md _build/test/examples.ml _build/test/xhtml.ml
+%if %opt
+%{_libdir}/ocaml/*/*.a
+%{_libdir}/ocaml/*/*.cmxa
+%{_libdir}/ocaml/*/*.cmx
+%endif
+%{_libdir}/ocaml/*/*.mli
+
+
+%changelog
+* Mon Jan 20 2014 Michel Salim <salimma@fedoraproject.org> - 1.2.0-1
+- Initial package