Accepting request 320342 from home:kstreitova:branches:devel:languages:ocaml

- use spec-cleaner

OBS-URL: https://build.opensuse.org/request/show/320342
OBS-URL: https://build.opensuse.org/package/show/devel:languages:ocaml/ocaml?expand=0&rev=70
This commit is contained in:
2015-09-02 07:33:29 +00:00
committed by Git OBS Bridge
parent 520c799b2e
commit bd63e0207d
2 changed files with 43 additions and 53 deletions
+5
View File
@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Aug 4 08:05:33 UTC 2015 - kstreitova@suse.com
- use spec-cleaner
-------------------------------------------------------------------
Tue Jun 23 08:50:31 UTC 2015 - ohering@suse.de
+38 -53
View File
@@ -18,12 +18,12 @@
#
Name: ocaml
Version: 4.02.2
Release: 0
%define doc_version 4.02
#
%define do_opt 0
# This ensures that the find_provides/find_requires calls ocamlobjinfo correctly.
%global __ocaml_requires_opts -c -f "%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo"
%global __ocaml_provides_opts -f "%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo"
# macros to be set in prjconf:
#Macros:
#_with_ocaml_force_enable_ocaml_opt 1
@@ -44,6 +44,13 @@ Release: 0
%if %{with ocaml_force_disable_ocaml_opt}
%define do_opt 0
%endif
Name: ocaml
Version: 4.02.2
Release: 0
Summary: The Objective Caml Compiler and Programming Environment
License: QPL-1.0 and SUSE-LGPL-2.0-with-linking-exception
Group: Development/Languages/Other
Url: http://caml.inria.fr/
#
# http://caml.inria.fr/pub/distrib/
Source0: http://caml.inria.fr/pub/distrib/ocaml-%{doc_version}/ocaml-%{version}.tar.xz
@@ -61,29 +68,21 @@ Patch7: ocaml-3.09-emacs_localcompile.patch
Patch9: ocaml-ppc64.patch
# FIX-UPSTREAM enable build on PowerPC 64bit LE platform.
Patch10: ocaml-ppc64le.patch
Url: http://caml.inria.fr/
Summary: The Objective Caml Compiler and Programming Environment
License: QPL-1.0 and SUSE-LGPL-2.0-with-linking-exception
Group: Development/Languages/Other
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %install_info_prereq
# This gets ocamlobjinfo to work with .cmxs files
BuildRequires: binutils-devel
BuildRequires: emacs-nox
BuildRequires: fdupes
BuildRequires: ncurses-devel
BuildRequires: pkgconfig(x11)
# This gets ocamlobjinfo to work with .cmxs files
BuildRequires: binutils-devel
Requires: ocaml-runtime = %{version}
# FIXME: use proper Requires(pre/post/preun/...)
PreReq: %{install_info_prereq}
Provides: ocaml(compiler) = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %{do_opt}
Requires: gcc
Provides: ocaml(ocaml.opt) = %{version}
%endif
Provides: ocaml(compiler) = %{version}
Requires: ocaml-runtime = %{version}
# This ensures that the find_provides/find_requires calls ocamlobjinfo correctly.
%global __ocaml_requires_opts -c -f "%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo"
%global __ocaml_provides_opts -f "%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo"
%description
Objective Caml is a high-level, strongly-typed, functional and
@@ -93,7 +92,6 @@ This package comprises two batch compilers (a fast bytecode compiler
and an optimizing native-code compiler), an interactive top level
system, Lex&Yacc tools, a replay debugger, and a comprehensive library.
%package rpm-macros
Summary: RPM macros for building OCaml source packages
License: QPL-1.0 and SUSE-LGPL-2.0-with-linking-exception
@@ -107,7 +105,7 @@ Summary: The Objective Caml Compiler and Programming Environment
License: QPL-1.0
Group: Development/Languages/Other
Provides: ocaml(runtime) = %{version}
%if %suse_version < 1210
%if 0%{?suse_version} < 1210
# Due to lack of generated requires in old rpm, force this
Requires: ocaml-compiler-libs = %{version}
%endif
@@ -119,7 +117,6 @@ object-oriented programming language from the ML family of languages.
This package contains the runtime environment needed to run Objective
Caml bytecode.
%package source
Summary: Source code for Objective Caml libraries
License: QPL-1.0 and SUSE-LGPL-2.0-with-linking-exception
@@ -129,7 +126,6 @@ Requires: ocaml = %{version}
%description source
Source code for Objective Caml libraries.
%package x11
Summary: X11 support for Objective Caml
License: SUSE-LGPL-2.0-with-linking-exception
@@ -139,9 +135,6 @@ Requires: ocaml-runtime = %{version}
%description x11
X11 support for Objective Caml.
%package ocamldoc
Summary: The Objective Caml Compiler and Programming Environment
License: QPL-1.0
@@ -154,8 +147,6 @@ object-oriented programming language from the ML family of languages.
This package contains a documentation generator for Objective Caml.
%package emacs
Summary: The Objective Caml Compiler and Programming Environment
License: GPL-2.0+
@@ -170,8 +161,6 @@ object-oriented programming language from the ML family of languages.
This package provides caml-mode for emacs
%package docs
Summary: The Objective Caml Compiler and Programming Environment
License: GPL-2.0+ and QPL-1.0
@@ -210,7 +199,6 @@ Requires: ocaml-compiler-libs = %{version}
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.
%prep
: do_opt %{do_opt}
%setup -q -a 1 -a 2 -a 3
@@ -237,7 +225,7 @@ ulimit -a
ulimit -Hs 65536
ulimit -Ss 65536
%endif
CFLAGS="$RPM_OPT_FLAGS -DUSE_INTERP_RESULT" \
CFLAGS="%{optflags} -DUSE_INTERP_RESULT" \
./configure -bindir %{_bindir} \
-libdir %{_libdir}/ocaml \
-mandir %{_mandir} \
@@ -254,41 +242,41 @@ make world \
%install
make install \
BINDIR="$RPM_BUILD_ROOT%{_bindir}" \
LIBDIR="$RPM_BUILD_ROOT%{_libdir}/ocaml" \
MANDIR="$RPM_BUILD_ROOT%{_mandir}"
sed -i -e "s|^$RPM_BUILD_ROOT||" $RPM_BUILD_ROOT%{_libdir}/ocaml/ld.conf
BINDIR="%{buildroot}%{_bindir}" \
LIBDIR="%{buildroot}%{_libdir}/ocaml" \
MANDIR="%{buildroot}%{_mandir}"
sed -i -e "s|^$RPM_BUILD_ROOT||" %{buildroot}%{_libdir}/ocaml/ld.conf
install -d $RPM_BUILD_ROOT%{_infodir} \
$RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
install -d %{buildroot}%{_infodir} \
%{buildroot}%{_datadir}/emacs/site-lisp
(
cd emacs
make install BINDIR=$RPM_BUILD_ROOT/%{_bindir} EMACSDIR=$RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
make install-ocamltags BINDIR=$RPM_BUILD_ROOT/%{_bindir}
make install BINDIR=%{buildroot}/%{_bindir} EMACSDIR=%{buildroot}%{_datadir}/emacs/site-lisp
make install-ocamltags BINDIR=%{buildroot}/%{_bindir}
)
(
cd infoman; cp -f ocaml* $RPM_BUILD_ROOT%{_infodir}
cd infoman; cp -f ocaml* %{buildroot}%{_infodir}
)
# fix bnc#411232
echo '(load "ocaml.el" nil t t)' >$RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/suse-start-ocaml.el
cat <<EOF >$RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/%{name}.el
echo '(load "ocaml.el" nil t t)' >%{buildroot}%{_datadir}/emacs/site-lisp/suse-start-ocaml.el
cat <<EOF >%{buildroot}%{_datadir}/emacs/site-lisp/%{name}.el
(autoload 'caml-mode "caml" "Caml editing mode" t)
(add-hook 'caml-mode-hook 'font-lock-mode)
(add-to-list 'auto-mode-alist '("\\\\.mli?$" . caml-mode))
EOF
sed -i '1s/^/#!\/usr\/bin\/ocaml\n/' $RPM_BUILD_ROOT/%{_bindir}/ocamltags
sed -i '1s/^/#!\/usr\/bin\/ocaml\n/' %{buildroot}/%{_bindir}/ocamltags
export EXCLUDE_FROM_STRIP="ocamldebug ocamlbrowser"
# Install the compiler libs
install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/compiler-libs
cp -a typing/ utils/ parsing/ $RPM_BUILD_ROOT%{_libdir}/ocaml/compiler-libs
%fdupes $RPM_BUILD_ROOT
install -d %{buildroot}%{_libdir}/ocaml/compiler-libs
cp -a typing/ utils/ parsing/ %{buildroot}%{_libdir}/ocaml/compiler-libs
%fdupes %{buildroot}
mkdir -vp $RPM_BUILD_ROOT%{_sysconfdir}/rpm
cat > $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.%{name} <<_EOF_
mkdir -vp %{buildroot}%{_sysconfdir}/rpm
cat > %{buildroot}%{_sysconfdir}/rpm/macros.%{name} <<_EOF_
# get rid of /usr/lib/rpm/find-debuginfo.sh
# strip kills the bytecode part of ELF binaries
%if %{do_opt}
@@ -303,7 +291,7 @@ cat > $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.%{name} <<_EOF_
%%ocaml_native_compiler 0
%endif
_EOF_
cat $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.%{name}
cat %{buildroot}%{_sysconfdir}/rpm/macros.%{name}
%post
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
@@ -311,9 +299,6 @@ cat $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.%{name}
%postun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc Changes LICENSE README
@@ -427,7 +412,7 @@ rm -rf $RPM_BUILD_ROOT
%if %{with ocaml_make_testsuite}
%check
make -C testsuite clean
make %{?_smp_mflags} -C testsuite clean
if make -C testsuite all
then
: passed