3
0
Files
ocaml-xml-light/ocaml-xml-light.spec

135 lines
3.9 KiB
RPMSpec
Raw Normal View History

#
# 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
%{ocaml_preserve_bytecode}
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
BuildRequires: ocaml-rpm-macros >= 4.02.1
BuildRequires: ocaml-findlib-devel >= 1.3.3-3
BuildRequires: ocaml-ocamldoc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# 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
%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
%if %{ocaml_native_compiler}
make %{?_smp_mflags} opt
%endif
sed -e 's/@VERSION@/%{VERSION}/' < META.in > META
%check
./test.exe <<EOF
<abc><123/></abc>
EOF
%if %{ocaml_native_compiler}
./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
export OCAMLFILES="xml-light META *.mli *.cmi *.cma"
%if %{ocaml_native_compiler}
export OCAMLFILES="$OCAMLFILES *.a *.cmxa *.cmx"
%endif
ocamlfind install $OCAMLFILES
%files
%defattr(-,root,root,-)
%doc README
%{_libdir}/ocaml/xml-light
%if %{ocaml_native_compiler}
%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/*
%if %{ocaml_native_compiler}
%{_libdir}/ocaml/xml-light/*.a
%{_libdir}/ocaml/xml-light/*.cmxa
%{_libdir}/ocaml/xml-light/*.cmx
%endif
%{_libdir}/ocaml/xml-light/*.mli
%changelog