| |
@@ -1,8 +1,10 @@
|
| |
%global srcname mlgmpidl
|
| |
+ %global ocaml_lib_dir %{_libdir}/ocaml
|
| |
+ %global my_ocaml_lib_dir %{ocaml_lib_dir}/gmp
|
| |
|
| |
Name: ocaml-%{srcname}
|
| |
- Version: 1.2.12
|
| |
- Release: 14%{?dist}
|
| |
+ Version: 1.2.14
|
| |
+ Release: 1%{?dist}
|
| |
Summary: OCaml interface to GMP and MPFR libraries
|
| |
# The license includes a linking exception
|
| |
License: LGPLv2 with exceptions
|
| |
@@ -12,17 +14,14 @@
|
| |
Source1: mlgmpidl_test.ml
|
| |
Source2: mlgmpidl_test_result
|
| |
|
| |
- # Adapt to mpfr 4
|
| |
- Patch0: %{name}-mpfr4.patch
|
| |
-
|
| |
# We cannot use LDFLAGS to pass RPM_LD_FLAGS into the Makefile, because it
|
| |
# passes them unmodified to both ocamlopt and ocamlmklib. The latter needs
|
| |
# to have them guarded with -ldopt. Therefore, we splice the flags into the
|
| |
# Makefile at strategic locations.
|
| |
- Patch1: %{name}-ldflags.patch
|
| |
+ Patch0: %{name}-ldflags.patch
|
| |
|
| |
- BuildRequires: make
|
| |
BuildRequires: gcc
|
| |
+ BuildRequires: make
|
| |
BuildRequires: ocaml
|
| |
BuildRequires: ocaml-ocamldoc
|
| |
BuildRequires: ocaml-findlib
|
| |
@@ -74,60 +73,35 @@
|
| |
# Insert our linker flags; see patch1 above
|
| |
sed -i "s|@LDFLAGS@|$RPM_LD_FLAGS|" Makefile
|
| |
|
| |
+ # Build with debug information
|
| |
+ sed -i 's/^OCAMLOPTFLAGS = -annot/& -g/' Makefile.config.in
|
| |
|
| |
- %build
|
| |
- mv Makefile.config.model Makefile.config
|
| |
+ # Do not force -O3
|
| |
+ sed -i 's/ -O3//' configure
|
| |
|
| |
- # Look for ocaml tools in the right place and build with debug information
|
| |
- sed -e 's,\$(CAML_PREFIX)/bin,%{_bindir},' \
|
| |
- -e 's/^OCAMLOPTFLAGS = -annot/& -g/' \
|
| |
- -i Makefile.config
|
| |
|
| |
- %ifarch %{ocaml_native_compiler}
|
| |
- # Build a cmxs
|
| |
- sed -i '/HAS_SHARED=1/a\\nHAS_NATIVE_PLUGINS=1' Makefile.config
|
| |
+ %build
|
| |
+ %set_build_flags
|
| |
+ # This is not an autoconf-generated script. Do NOT use %%configure.
|
| |
+ ./configure \
|
| |
+ %ifnarch %{ocaml_native_compiler}
|
| |
+ -no-native-plugins \
|
| |
%endif
|
| |
-
|
| |
- %ifarch %{ocaml_native_profiling}
|
| |
- echo 'ENABLE_PROF = 1' >> Makefile.config
|
| |
- %else
|
| |
- echo 'ENABLE_PROF = 0' >> Makefile.config
|
| |
+ %ifnarch %{ocaml_native_profiling}
|
| |
+ -disable-profiling \
|
| |
%endif
|
| |
-
|
| |
- %global ocaml_lib_dir %{_libdir}/ocaml
|
| |
- %global my_ocaml_lib_dir %{ocaml_lib_dir}/gmp
|
| |
+ -gmp-prefix %{_prefix} \
|
| |
+ -mpfr-prefix %{_prefix} \
|
| |
+ -prefix %{ocaml_lib_dir}
|
| |
|
| |
# Upstream Makefile is NOT safe to be called in parallel.
|
| |
- unset MAKEFLAGS
|
| |
-
|
| |
- %global make1 \\\
|
| |
- make MLGMPIDL_PREFIX=%{_prefix} GMP_PREFIX=%{_prefix} \\\
|
| |
- MFPR_PREFIX=%{_prefix} CAML_PREFIX=%{ocaml_lib_dir} \\\
|
| |
- CAMLIDL_PREFIX=%{ocaml_lib_dir}
|
| |
%ifarch %{ocaml_native_compiler}
|
| |
- %global make \\\
|
| |
- %make1 \\\
|
| |
- OCAMLC=ocamlc.opt OCAMLOPT=ocamlopt.opt \\\
|
| |
- OCAMLLEX=ocamllex.opt OCAMLDOC=ocamldoc.opt \\\
|
| |
- CFLAGS="%{optflags} -fPIC -DNDEBUG" \\\
|
| |
- CFLAGS_DEBUG="%{optflags} -fPIC -UNDEBUG" \\\
|
| |
- CFLAGS_PROF="%{optflags} -fPIC -DNDEBUG -pg"
|
| |
+ make all
|
| |
%else
|
| |
- %global make \\\
|
| |
- %make1 \\\
|
| |
- OCAMLC=ocamlc HAS_OCAMLOPT= \\\
|
| |
- OCAMLLEX=ocamllex OCAMLDOC=ocamldoc \\\
|
| |
- CFLAGS="%{optflags} -DNDEBUG" \\\
|
| |
- CFLAGS_DEBUG="%{optflags} -UNDEBUG" \\\
|
| |
- CFLAGS_PROF="%{optflags} -DNDEBUG -pg"
|
| |
+ make byte
|
| |
%endif
|
| |
- %ifarch %{ocaml_native_compiler}
|
| |
- %make all
|
| |
- %else
|
| |
- %make byte
|
| |
- %endif
|
| |
- %make mlgmpidl.pdf
|
| |
- %make html
|
| |
+ make mlgmpidl.pdf
|
| |
+ make html
|
| |
|
| |
|
| |
%check
|
| |
@@ -144,7 +118,7 @@
|
| |
# so that it works.
|
| |
export MLGMPIDL_PREFIX=$RPM_BUILD_ROOT%{_prefix}
|
| |
export DESTDIR=$RPM_BUILD_ROOT
|
| |
- export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
|
| |
+ export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{ocaml_lib_dir}
|
| |
mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
|
| |
|
| |
%ifarch %{ocaml_native_compiler}
|
| |
@@ -189,6 +163,11 @@
|
| |
|
| |
|
| |
%changelog
|
| |
+ * Mon Dec 26 2021 Jerry James <loganjerry@gmail.com> - 1.2.14-1
|
| |
+ - New upstream version 1.2.14
|
| |
+ - Drop upstreamed mpfr4 patch
|
| |
+ - Invoke the configure script and simplify the spec file accordingly
|
| |
+
|
| |
* Mon Oct 04 2021 Richard W.M. Jones <rjones@redhat.com> - 1.2.12-14
|
| |
- OCaml 4.13.1 build
|
| |
|
| |
Also:
- Drop upstreamed mpfr4 patch
- Invoke the configure script and simplify the spec file accordingly
As noted on the OCaml mailing list recently, I would like to update some OCaml packages, including this one. If this pull request looks good to you, go ahead and merge it, but please do not start a build at this time. I will build all of the listed packages in a side tag to avoid Rawhide breakage. The affected packages can all be seen in a COPR repository.
Let me know if you want any changes to this pull request.