2014-12-08 08:37:39 +00:00
|
|
|
#
|
|
|
|
# spec file for package ocaml-xml-light
|
|
|
|
#
|
|
|
|
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
%global debug_package %{nil}
|
|
|
|
%global svnrev 287
|
|
|
|
|
|
|
|
Name: ocaml-xml-light
|
|
|
|
Version: 2.3
|
2014-12-08 21:00:39 +00:00
|
|
|
%{ocaml_preserve_bytecode}
|
2014-12-08 08:37:39 +00:00
|
|
|
Release: 0.svn%{svnrev}
|
|
|
|
Summary: Minimal XML parser and printer for OCaml
|
|
|
|
License: LGPL-2.0+
|
|
|
|
Group: Development/Libraries/Other
|
|
|
|
Url: http://tech.motion-twin.com/xmllight.html
|
|
|
|
# Upstream does not have releases (or rather, it did up to version 2.2
|
|
|
|
# and then they stopped). Use the SVN repository here:
|
|
|
|
# https://code.google.com/p/ocamllibs/source/checkout
|
|
|
|
#
|
|
|
|
# To prepare a source release:
|
|
|
|
# (1) Adjust 'svnrev' above to the latest release.
|
|
|
|
# (2) Check out the sources:
|
|
|
|
# svn checkout http://ocamllibs.googlecode.com/svn/trunk/ ocamllibs
|
|
|
|
# (3) Create a tarball:
|
|
|
|
# cd ocamllibs/xml-light/
|
|
|
|
# tar -zcf /tmp/xml-light-NNN.tar.gz --xform='s,^\.,xml-light-NNN,' .
|
|
|
|
# (where NNN is the svnrev above)
|
|
|
|
Source0: xml-light-%{svnrev}.tar.gz
|
|
|
|
BuildRequires: gawk
|
|
|
|
BuildRequires: ocaml >= 4.00.1
|
2014-12-08 21:00:39 +00:00
|
|
|
BuildRequires: ocaml-rpm-macros >= 4.02.1
|
2014-12-08 08:37:39 +00:00
|
|
|
BuildRequires: ocaml-findlib-devel >= 1.3.3-3
|
|
|
|
BuildRequires: ocaml-ocamldoc
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2015-11-10 10:35:10 +00:00
|
|
|
# ocaml autodep start for pkg: ocaml-xml-light
|
|
|
|
# hardcoded rpm dependency for pre 12.1 to compensate for lack of ocaml() provides/requires
|
|
|
|
%if 0%{?suse_version} < 1210
|
|
|
|
Requires: ocaml-runtime
|
|
|
|
%endif
|
|
|
|
# ocaml autodep end for pkg: ocaml-xml-light
|
2014-12-08 08:37:39 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
Xml-Light is a minimal XML parser & printer for OCaml. It provides
|
|
|
|
functions to parse an XML document into an OCaml data structure, work
|
|
|
|
with it, and print it back to an XML document. It support also DTD
|
|
|
|
parsing and checking, and is entirely written in OCaml, hence it does
|
|
|
|
not require additional C library.
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Development files for %{name}
|
|
|
|
Group: Development/Libraries/Other
|
|
|
|
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 xml-light-%{svnrev}
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
# Build breaks if parallelized.
|
|
|
|
unset MAKEFLAGS
|
|
|
|
make all
|
|
|
|
make %{?_smp_mflags} doc
|
2014-12-08 21:00:39 +00:00
|
|
|
%if %{ocaml_native_compiler}
|
2014-12-08 08:37:39 +00:00
|
|
|
make %{?_smp_mflags} opt
|
|
|
|
%endif
|
|
|
|
sed -e 's/@VERSION@/%{VERSION}/' < META.in > META
|
|
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
./test.exe <<EOF
|
|
|
|
<abc><123/></abc>
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
2014-12-08 21:00:39 +00:00
|
|
|
%if %{ocaml_native_compiler}
|
2014-12-08 08:37:39 +00:00
|
|
|
./test_opt.exe <<EOF
|
|
|
|
<abc><123/></abc>
|
|
|
|
|
|
|
|
EOF
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
export DESTDIR=%{buildroot}
|
|
|
|
export OCAMLFIND_DESTDIR=%{buildroot}%{_libdir}/ocaml
|
|
|
|
mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
|
|
|
|
rm -f test.cmi
|
2014-12-09 20:48:00 +00:00
|
|
|
export OCAMLFILES="xml-light META *.mli *.cmi *.cma"
|
|
|
|
%if %{ocaml_native_compiler}
|
|
|
|
export OCAMLFILES="$OCAMLFILES *.a *.cmxa *.cmx"
|
|
|
|
%endif
|
|
|
|
ocamlfind install $OCAMLFILES
|
2014-12-08 08:37:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%doc README
|
|
|
|
%{_libdir}/ocaml/xml-light
|
2014-12-08 21:00:39 +00:00
|
|
|
%if %{ocaml_native_compiler}
|
2014-12-08 08:37:39 +00:00
|
|
|
%exclude %{_libdir}/ocaml/xml-light/*.a
|
|
|
|
%exclude %{_libdir}/ocaml/xml-light/*.cmxa
|
|
|
|
%exclude %{_libdir}/ocaml/xml-light/*.cmx
|
|
|
|
%endif
|
|
|
|
%exclude %{_libdir}/ocaml/xml-light/*.mli
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%doc README doc/*
|
2014-12-08 21:00:39 +00:00
|
|
|
%if %{ocaml_native_compiler}
|
2014-12-08 08:37:39 +00:00
|
|
|
%{_libdir}/ocaml/xml-light/*.a
|
|
|
|
%{_libdir}/ocaml/xml-light/*.cmxa
|
|
|
|
%{_libdir}/ocaml/xml-light/*.cmx
|
|
|
|
%endif
|
|
|
|
%{_libdir}/ocaml/xml-light/*.mli
|
|
|
|
|
|
|
|
%changelog
|