ocaml-menhir/ocaml-menhir.spec

112 lines
2.8 KiB
RPMSpec

#
# spec file for package ocaml-menhir
#
# Copyright (c) 2016 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/
#
Name: ocaml-menhir
Version: 20160504
%{ocaml_preserve_bytecode}
Release: 0
License: LGPL-2.0
Summary: LR(1) parser generator for the OCaml programming language
Url: http://gallium.inria.fr/~fpottier/menhir/
Group: Development/Libraries/Other
Source: http://gallium.inria.fr/~fpottier/menhir/menhir-20160504.tar.gz
BuildRequires: ocaml
BuildRequires: ocaml-ocamlbuild
BuildRequires: ocaml-ocamldoc
BuildRequires: ocaml-findlib
BuildRequires: ocaml-rpm-macros >= 4.02.1
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# ocaml autodep start for pkg: ocaml-menhir
# 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-menhir
%description
LR(1) parser generator
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/Other
Requires: %{name} = %{version}
%description devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.
%prep
%setup -q -n menhir-%{version}
%build
o=
make \
%if %{ocaml_native_compiler}
TARGET=native \
%else
TARGET=byte \
%endif
PREFIX=${o}%{_prefix} \
%{?_smp_mflags} \
-j 1
%install
o=%{buildroot}
OCAMLFIND_DESTDIR=%{buildroot}`ocamlc -where`
mkdir -vp ${OCAMLFIND_DESTDIR}
make \
install \
%if %{ocaml_native_compiler}
TARGET=native \
%else
TARGET=byte \
%endif
PREFIX=${o}%{_prefix} \
OCAMLFIND_DESTDIR=${OCAMLFIND_DESTDIR} \
%{?_smp_mflags} \
-j 1
rm -rfv %{buildroot}/usr/share/doc
%files
%defattr(-,root,root)
%doc CHANGES LICENSE manual.pdf
%{_bindir}/*
%{_datadir}/menhir
%dir %{_libdir}/ocaml
%dir %{_libdir}/ocaml/*
%{_libdir}/ocaml/*/META
%if %{ocaml_native_compiler}
%{_libdir}/ocaml/*/*.o
%endif
%{_libdir}/ocaml/*/*.cmi
%{_libdir}/ocaml/*/*.cmo
%files devel
%defattr(-,root,root,-)
%doc LICENSE
%{_mandir}/*/*
%dir %{_libdir}/ocaml
%dir %{_libdir}/ocaml/*
%if %{ocaml_native_compiler}
%{_libdir}/ocaml/*/*.cmx
%endif
%{_libdir}/ocaml/*/*.mli
%{_libdir}/ocaml/*/*.ml