Hello community,

here is the log from the commit of package ocaml for openSUSE:Factory checked 
in at 2015-11-24 22:30:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ocaml (Old)
 and      /work/SRC/openSUSE:Factory/.ocaml.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ocaml"

Changes:
--------
--- /work/SRC/openSUSE:Factory/ocaml/ocaml.changes      2015-10-01 
12:21:37.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ocaml.new/ocaml.changes 2015-11-24 
22:30:15.000000000 +0100
@@ -1,0 +2,11 @@
+Wed Nov 11 09:58:32 UTC 2015 - [email protected]
+
+- Increase rlimit stack size on ppc64
+  ocaml-arch-rlimit-stacksize.patch
+
+-------------------------------------------------------------------
+Tue Nov 10 10:18:47 UTC 2015 - [email protected]
+
+- Add hardcoded Provides for pre 12.1 repos
+
+-------------------------------------------------------------------

New:
----
  ocaml-arch-rlimit-stacksize.patch
  update_ocaml_deps.sh

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ocaml.spec ++++++
--- /var/tmp/diff_new_pack.UZAcay/_old  2015-11-24 22:30:16.000000000 +0100
+++ /var/tmp/diff_new_pack.UZAcay/_new  2015-11-24 22:30:16.000000000 +0100
@@ -58,6 +58,7 @@
 Source2:        ocaml-%{doc_version}-refman-html-1.tar.xz
 Source3:        ocaml-%{doc_version}-refman.info.tar.xz
 Source4:        rpmlintrc
+Source99:       update_ocaml_deps.sh
 Patch0:         ocaml-3.00-camldebug_el.patch
 Patch2:         ocaml-3.04-ocamltags--no-site-start.patch
 # FIX-UPSTREAM pass RPM_OPT_FLAGS to build
@@ -68,17 +69,23 @@
 Patch9:         ocaml-ppc64.patch
 # FIX-UPSTREAM enable build on PowerPC 64bit LE platform.
 Patch10:        ocaml-ppc64le.patch
+Patch64:        ocaml-arch-rlimit-stacksize.patch
 # This gets ocamlobjinfo to work with .cmxs files
 BuildRequires:  binutils-devel
 BuildRequires:  emacs-nox
 BuildRequires:  fdupes
 BuildRequires:  ncurses-devel
 BuildRequires:  pkgconfig(x11)
-Requires:       ocaml-runtime = %{version}
 Requires(pre):  %{install_info_prereq}
 Requires(post): %{install_info_prereq}
 Provides:       ocaml(compiler) = %{version}
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+# ocaml autodep start for pkg: ocaml
+# 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
 %if %{do_opt}
 Requires:       gcc
 Provides:       ocaml(ocaml.opt) = %{version}
@@ -101,14 +108,16 @@
 A set of helper macros to unify common code used in ocaml spec files.
 
 %package runtime
+# ocaml autodep start for pkg: ocaml-runtime
+# hardcoded rpm dependency for pre 12.1 to compensate for lack of ocaml() 
provides/requires
+%if 0%{?suse_version} < 1210
+Requires:       ocaml-compiler-libs
+%endif
+# ocaml autodep end for pkg: ocaml-runtime
 Summary:        The Objective Caml Compiler and Programming Environment
 License:        QPL-1.0
 Group:          Development/Languages/Other
 Provides:       ocaml(runtime) = %{version}
-%if 0%{?suse_version} < 1210
-# Due to lack of generated requires in old rpm, force this
-Requires:       ocaml-compiler-libs = %{version}
-%endif
 
 %description runtime
 Objective Caml is a high-level, strongly-typed, functional and
@@ -121,21 +130,32 @@
 Summary:        Source code for Objective Caml libraries
 License:        QPL-1.0 and SUSE-LGPL-2.0-with-linking-exception
 Group:          Development/Languages/Other
-Requires:       ocaml = %{version}
 
 %description source
 Source code for Objective Caml libraries.
 
 %package x11
+# ocaml autodep start for pkg: ocaml-x11
+# 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-x11
 Summary:        X11 support for Objective Caml
 License:        SUSE-LGPL-2.0-with-linking-exception
 Group:          System/Libraries
-Requires:       ocaml-runtime = %{version}
 
 %description x11
 X11 support for Objective Caml.
 
 %package ocamldoc
+# ocaml autodep start for pkg: ocaml-ocamldoc
+# hardcoded rpm dependency for pre 12.1 to compensate for lack of ocaml() 
provides/requires
+%if 0%{?suse_version} < 1210
+Requires:       ocaml-compiler-libs
+Requires:       ocaml-runtime
+%endif
+# ocaml autodep end for pkg: ocaml-ocamldoc
 Summary:        The Objective Caml Compiler and Programming Environment
 License:        QPL-1.0
 Group:          Development/Languages/Other
@@ -176,10 +196,15 @@
 system, Lex&Yacc tools, a replay debugger, and a comprehensive library.
 
 %package compiler-libs
+# ocaml autodep start for pkg: ocaml-compiler-libs
+# 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-compiler-libs
 Summary:        Libraries used internal to the OCaml Compiler
 License:        QPL-1.0
 Group:          Development/Libraries/Other
-Requires:       ocaml = %{version}
 
 %description compiler-libs
 Objective Caml is a high-level, strongly-typed, functional and
@@ -190,6 +215,12 @@
 be helpful in the development of certain applications.
 
 %package compiler-libs-devel
+# ocaml autodep start for pkg: ocaml-compiler-libs
+# 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-compiler-libs
 Summary:        Libraries used internal to the OCaml Compiler
 License:        QPL-1.0
 Group:          Development/Libraries/Other
@@ -209,6 +240,7 @@
 %patch7
 %patch9 -p1
 %patch10 -p1
+%patch64 -p1
 
 %build
 %ifarch %ix86
@@ -217,14 +249,6 @@
 export RPM_OPT_FLAGS="${RPM_OPT_FLAGS/-fomit-frame-pointer/}"
 %endif
 
-# For ppc64 we need a larger stack than default to compile some files
-# because the stages in the OCaml compiler are not mutually tail
-# recursive.
-%ifarch ppc64 ppc64le
-ulimit -a
-ulimit -Hs 65536
-ulimit -Ss 65536
-%endif
 CFLAGS="%{optflags} -DUSE_INTERP_RESULT" \
 ./configure -bindir %{_bindir} \
             -libdir %{_libdir}/ocaml \

++++++ ocaml-arch-rlimit-stacksize.patch ++++++
---
 asmrun/stack.h   |    2 ++
 asmrun/startup.c |   39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+)

--- ocaml-4.02.3.orig/asmrun/stack.h
+++ ocaml-4.02.3/asmrun/stack.h
@@ -53,6 +53,7 @@
 #define Mask_already_scanned(retaddr) ((retaddr) & ~1)
 #define Trap_frame_size 0x150
 #define Callback_link(sp) ((struct caml_context *)((sp) + Trap_frame_size))
+#define CAML_SUSE_ARCH_RLIMIT_STACK (1024 * 1024 * 32)
 #endif
 
 #ifdef TARGET_power64le
@@ -62,6 +63,7 @@
 #define Mask_already_scanned(retaddr) ((retaddr) & ~1)
 #define Trap_frame_size 0x150
 #define Callback_link(sp) ((struct caml_context *)((sp) + Trap_frame_size))
+#define CAML_SUSE_ARCH_RLIMIT_STACK (1024 * 1024 * 32)
 #endif
 
 #ifdef TARGET_arm
--- ocaml-4.02.3.orig/asmrun/startup.c
+++ ocaml-4.02.3/asmrun/startup.c
@@ -34,6 +34,10 @@
 #ifdef HAS_UI
 #include "caml/ui.h"
 #endif
+#ifdef CAML_SUSE_ARCH_RLIMIT_STACK
+#include <sys/time.h>
+#include <sys/resource.h>
+#endif
 
 extern int caml_parser_trace;
 CAMLexport header_t caml_atom_table[256];
@@ -154,6 +158,40 @@ extern void caml_install_invalid_paramet
 
 #endif
 
+static void caml_suse_rlimit_stack(void)
+{
+#ifdef CAML_SUSE_ARCH_RLIMIT_STACK
+  /*
+   * For ppc64 we need a larger stack than default to compile some
+   * files because the stages in the OCaml compiler are not
+   * mutually tail recursive.
+   */
+  struct rlimit rlimit = {};
+  rlim_t stack = CAML_SUSE_ARCH_RLIMIT_STACK;
+  int ret;
+
+  ret = getrlimit(RLIMIT_STACK, &rlimit);
+  if (ret)
+    return;
+  if (rlimit.rlim_max != RLIM_INFINITY && rlimit.rlim_max < stack)
+  {
+    rlimit.rlim_max = stack;
+    ret |= 1;
+  }
+  if (rlimit.rlim_cur != RLIM_INFINITY && rlimit.rlim_cur < stack)
+  {
+    rlimit.rlim_cur = stack;
+    ret |= 1;
+  }
+  if (rlimit.rlim_cur > rlimit.rlim_max)
+  {
+    rlimit.rlim_max = rlimit.rlim_cur;
+    ret |= 1;
+  }
+  if (ret)
+    setrlimit(RLIMIT_STACK, &rlimit);
+#endif
+}
 
 void caml_main(char **argv)
 {
@@ -162,6 +200,7 @@ void caml_main(char **argv)
   value res;
   char tos;
 
+  caml_suse_rlimit_stack();
   caml_init_ieee_floats();
 #ifdef _MSC_VER
   caml_install_invalid_parameter_handler();
++++++ update_ocaml_deps.sh ++++++
#!/bin/bash
unset LANG
unset ${!LC_*}
#et -x
#
do_download=false
until test "$#" -eq 0
do
        case "$1" in
                -d) do_download=true ;;
                *) ;;
        esac
        shift
done

td=`mktemp -d --tmpdir=/dev/shm`
test -z "${td}" && exit 1
_x() {
        rm -rf "${td}"
}
trap _x EXIT
#
deps="${td}/deps.txt"
plain_deps="${td}/plain_deps.txt"
srcrpm_dir="${td}/srcrpm"
prov_dir="${td}/prov"
req_dir="${td}/req"
dep_list="${td}/dep_list"
t="${td}/t"
mkdir "${srcrpm_dir}" "${prov_dir}" "${req_dir}"
#
obs='/usr/bin/osc -A https://api.opensuse.org'
projects="
devel:languages:ocaml
Virtualization
"
projects="devel:languages:ocaml"
repo="openSUSE_Factory"
arch="x86_64"
binary_dir="binary_for_deps"


for prj in $projects
do
        if pushd "${prj}" > /dev/null
        then
                for pkg in `$obs ls $prj`
                do
                        if pushd $pkg > /dev/null
                        then
                                if ${do_download}
                                then
                                        rm -rf "${binary_dir}"
                                        $obs getbinaries 
--destdir="${binary_dir}" "${prj}" "${pkg}" "${repo}" "${arch}"
                                fi
                                popd > /dev/null
                        fi
                done
                #
                for rpm in */${binary_dir}/*.rpm
                do
                        name=`rpm -qp --nosignature --qf '%{NAME}' "${rpm}"`
                        rpm -qp --nosignature --qf '%{SOURCERPM}' "${rpm}" | 
sed 's@-[^-]\+-[^-]\+\.[^\.]\+\.rpm$@@' > "${srcrpm_dir}/${name}" &
                        rpm -qp --nosignature --provides "${rpm}" | sed -n 
"/^ocaml(/{s@[()[:blank:]]\+@§@g;p}" > "${prov_dir}/${name}" &
                        rpm -qp --nosignature --requires "${rpm}" | sed -n 
"/^ocaml(/{s@[()[:blank:]]\+@§@g;p}" > "${req_dir}/${name}" &
                        wait
                done
                #
                for rpm in ${req_dir}/*
                do
                        if test -s "${rpm}"
                        then
                                req_rpm="${rpm##*/}"
                                for dep in `cat "${rpm}"`
                                do
                                        provs=(` grep -rl "${dep}" ${prov_dir} 
`)
                                        if test ${#provs[@]} -eq 0
                                        then
                                                echo "Nothing provides ${dep} 
required by ${req_rpm}" >&2
                                                continue
                                        fi
                                        i=0
                                        while test $i -lt ${#provs[@]}
                                        do
                                                provs[$i]=${provs[$i]##*/}
                                                : $(( i++ ))
                                        done
                                        if test ${#provs[@]} -gt 1
                                        then
                                                echo "Multiple providers of 
${dep} required by ${req_rpm} (${#provs[@]}): ${provs[@]}" >&2
                                        fi
                                        # ocamlfuse > ocaml-runtime
                                        wrong_lib=false
                                        i=0
                                        while test $i -lt ${#provs[@]}
                                        do
                                                if test "${provs[$i]}" = 
"ocaml-runtime"
                                                then
                                                        wrong_lib=true
                                                        break
                                                fi
                                                : $(( i++ ))
                                        done
                                        if test "${wrong_lib}" = "true"
                                        then
                                                i=0
                                                while test $i -lt ${#provs[@]}
                                                do
                                                        if test "${provs[$i]}" 
= "ocamlfuse"
                                                        then
                                                                
provs[$i]="ocaml-runtime"
                                                        fi
                                                        : $(( i++ ))
                                                done
                                        fi
                                        # ocaml-runtime > ocaml-compiler-libs
                                        wrong_lib=false
                                        i=0
                                        while test $i -lt ${#provs[@]}
                                        do
                                                if test "${provs[$i]}" = 
"ocaml-compiler-libs"
                                                then
                                                        wrong_lib=true
                                                        break
                                                fi
                                                : $(( i++ ))
                                        done
                                        if test "${wrong_lib}" = "true"
                                        then
                                                i=0
                                                while test $i -lt ${#provs[@]}
                                                do
                                                        if test "${provs[$i]}" 
= "ocaml-runtime"
                                                        then
                                                                
provs[$i]="ocaml-compiler-libs"
                                                        fi
                                                        : $(( i++ ))
                                                done
                                        fi
                                        #
                                        for prov in ${provs[@]}
                                        do
                                                prov_rpm="${prov##*/}"
                                                if test "${req_rpm}" != 
"${prov_rpm}"
                                                then
                                                        echo "${prov_rpm}"
                                                fi
                                        done
                                done > "${t}"
                                echo "`cat ${srcrpm_dir}/${req_rpm}` ${req_rpm} 
`sort -u < \"${t}\"|xargs`"
                        fi
                done | sort -u > "${dep_list}"
                #
                #cat "${dep_list}"
                while read src_rpm req_rpm prov_rpm
                do
                        echo "${src_rpm} ${req_rpm} ${prov_rpm}"
                        case "${src_rpm}" in
                                ocamlfuse) spec_dir=ocaml-fuse ;;
                                *) spec_dir="${src_rpm}" ;;
                        esac
                        spec="${spec_dir}/${src_rpm}.spec"
                        auto_start="# ocaml autodep start for pkg:"
                        auto_end="# ocaml autodep end for pkg:"
                        auto_hint="# hardcoded rpm dependency for pre 12.1 to 
compensate for lack of ocaml() provides/requires"
                        if test -f "${spec}"
                        then
                                sed -i "/${auto_start} ${req_rpm}/,/${auto_end} 
${req_rpm}/d" "${spec}"
                                if test "${src_rpm}" = "${req_rpm}"
                                then
                                        : main
                                        sed -i "
                                        /^BuildRoot:/{ a \\
${auto_start} ${req_rpm}\\
${auto_hint}\\
%if 0%{?suse_version} < 1210\\
Requires:       ${prov_rpm}\\
%endif\\
${auto_end} ${req_rpm}
                                        }
                                        " "${spec}"
                                else
                                        : sub package
                                        sed -i "
                                        /^%package ${req_rpm#${src_rpm}-}/{ a \\
${auto_start} ${req_rpm}\\
${auto_hint}\\
%if 0%{?suse_version} < 1210\\
Requires:       ${prov_rpm}\\
%endif\\
${auto_end} ${req_rpm}
                                        }
                                        " "${spec}"
                                fi
                        else
                                echo "Missing rpm specfile: ${spec}" >&2
                        fi
                done < "${dep_list}"
                #
                popd > /dev/null
        fi
done

Reply via email to