- Remove ocaml-find-{requires,provides}.sh from this package. These are now

in upstream RPM 4.8 (RHBZ#545116).
- define -> global in a few places.
This commit is contained in:
Richard W.M. Jones 2009-12-16 15:25:40 +00:00
parent a82aaa421f
commit be42b9abf4
3 changed files with 10 additions and 150 deletions

View File

@ -1,64 +0,0 @@
#!/bin/sh -
# OCaml-specific "find-provides" for RPM.
# By Richard W.M. Jones <rjones@redhat.com>
# $Id: ocaml-find-provides.sh,v 1.1 2007/07/02 15:13:39 gemi Exp $
#set -x
# Usage:
# (1) Add the following to the spec file:
# %define _use_internal_dependency_generator 0
# %define __find_requires /usr/lib/rpm/ocaml-find-requires.sh
# %define __find_provides /usr/lib/rpm/ocaml-find-provides.sh
#
# (2) If you don't want the module to depend on the exact compiler
# version then use ocaml-find-requires.sh -c, but this is not something
# you should do normally.
#
# (3) For any modules which you want to ignore, use '-i Modulename'.
OCAMLOBJINFO=ocamlobjinfo
TEMP=`getopt -o i:f: -n ocaml-find-provides.sh -- "$@"`
if [ $? != 0 ]; then echo "ocaml-find-provides.sh: failed" >&2; exit 1; fi
eval set -- "$TEMP"
ignore_modules=nOTREAL
while true; do
case "$1" in
-i) ignore_modules="$2 $ignore_modules"; shift 2;;
-f) OCAMLOBJINFO="$2"; shift 2;;
--) shift; break;;
*) echo "ocaml-find-provides.sh: option error at $1"; exit 1;;
esac
done
# Get the list of files.
files=`sed "s/['\"]/\\\&/g"`
# Use ordinary find-provides first.
echo $files | tr [:blank:] '\n' | /usr/lib/rpm/find-provides
# Get list of .cmi, .cmo and .cma files.
files=`echo $files | tr [:blank:] '\n' | grep '\.cm[ioa]$'`
if [ -z "$files" ]; then exit 0; fi
# Get the list of modules exported by the files.
modules=`$OCAMLOBJINFO $files |
grep -E '(Unit|Module) name: ' |
awk '{print $3}'`
# Turn list of modules into a regexp that matches the module names.
modules_re=`echo $modules | sed 's/ /|/g'`
ignore_modules_re=`echo $ignore_modules | sed 's/ /|/g'`
# Get a list of the modules these file(s) provide.
$OCAMLOBJINFO $files |
grep -Eo '[0-9a-f]{32}[[:space:]]+[A-Za-z0-9_]+' |
grep -E '[0-9a-f]{32}[[:space:]]+'"($modules_re)\$" |
while read md5sum module; do
echo "ocaml($module) = $md5sum"
done |
grep -Ev "$ignore_modules_re" |
sort -u

View File

@ -1,73 +0,0 @@
#!/bin/sh -
# OCaml-specific "find-requires" for RPM.
# By Richard W.M. Jones <rjones@redhat.com>
# $Id: ocaml-find-requires.sh,v 1.4 2008/11/20 15:30:55 rjones Exp $
#set -x
# Usage:
# (1) Add the following to the spec file:
# %define _use_internal_dependency_generator 0
# %define __find_requires /usr/lib/rpm/ocaml-find-requires.sh
# %define __find_provides /usr/lib/rpm/ocaml-find-provides.sh
#
# (2) If you don't want the module to depend on the exact compiler
# version then use ocaml-find-requires.sh -c, but this is not something
# you should do normally.
#
# (3) For any modules which you want to ignore, use '-i Modulename'.
OCAMLOBJINFO=ocamlobjinfo
TEMP=`getopt -o ci:f: -n ocaml-find-requires.sh -- "$@"`
if [ $? != 0 ]; then echo "ocaml-find-requires.sh: failed" >&2; exit 1; fi
eval set -- "$TEMP"
emit_compiler_version=yes
ignore_modules=nOTREAL
while true; do
case "$1" in
-c) emit_compiler_version=; shift;;
-i) ignore_modules="$2 $ignore_modules"; shift 2;;
-f) OCAMLOBJINFO="$2"; shift 2;;
--) shift; break;;
*) echo "ocaml-find-requires.sh: option error at $1"; exit 1;;
esac
done
# Get the list of files.
files=`sed "s/['\"]/\\\&/g"`
# Use ordinary find-requires first.
echo $files | tr [:blank:] '\n' | /usr/lib/rpm/find-requires
# Get list of .cmi, .cmo and .cma files.
files=`echo $files | tr [:blank:] '\n' | grep '\.cm[ioa]$'`
if [ -z "$files" ]; then exit 0; fi
# Get the list of modules exported by the file(s).
modules=`$OCAMLOBJINFO $files |
grep -E '(Unit|Module) name: ' |
awk '{print $3}'`
# Turn list of modules into a regexp that matches the module names.
modules_re=`echo $modules | sed 's/ /|/g'`
ignore_modules_re=`echo $ignore_modules | sed 's/ /|/g'`
# Get a list of the modules these file(s) depend on.
$OCAMLOBJINFO $files |
grep -Eo '[0-9a-f]{32}[[:space:]]+[A-Za-z0-9_]+' |
grep -Ev '[0-9a-f]{32}[[:space:]]+'"($modules_re)\$" |
while read md5sum module; do
echo "ocaml($module) = $md5sum"
done |
grep -Ev "$ignore_modules_re" |
grep -Ev "^ocaml\((Annot|Asttypes|Outcometree|Cmo_format|Parsetree)\) =" |
sort -u
if [ -n "$emit_compiler_version" ]; then
# Every OCaml program depends on the version of the
# runtime which was used to compile it.
echo "ocaml(runtime) = `ocamlrun -version | awk '{print $NF}' | sed 's/\+.*//'`"
fi

View File

@ -1,8 +1,8 @@
%define _default_patch_fuzz 2 %global _default_patch_fuzz 2
Name: ocaml Name: ocaml
Version: 3.11.1 Version: 3.11.1
Release: 6%{?dist} Release: 7%{?dist}
Summary: Objective Caml compiler and programming environment Summary: Objective Caml compiler and programming environment
@ -15,8 +15,6 @@ Source0: http://caml.inria.fr/distrib/ocaml-3.11/ocaml-%{version}.tar.bz2
Source1: http://caml.inria.fr/distrib/ocaml-3.11/ocaml-3.11-refman.html.tar.gz Source1: http://caml.inria.fr/distrib/ocaml-3.11/ocaml-3.11-refman.html.tar.gz
Source2: http://caml.inria.fr/distrib/ocaml-3.11/ocaml-3.11-refman.pdf Source2: http://caml.inria.fr/distrib/ocaml-3.11/ocaml-3.11-refman.pdf
Source3: http://caml.inria.fr/distrib/ocaml-3.11/ocaml-3.11-refman.info.tar.gz Source3: http://caml.inria.fr/distrib/ocaml-3.11/ocaml-3.11-refman.info.tar.gz
Source4: ocaml-find-requires.sh
Source5: ocaml-find-provides.sh
# Useful utilities from Debian, and sent upstream. # Useful utilities from Debian, and sent upstream.
# http://git.debian.org/?p=pkg-ocaml-maint/packages/ocaml.git;a=tree;f=debian/ocamlbyteinfo;hb=HEAD # http://git.debian.org/?p=pkg-ocaml-maint/packages/ocaml.git;a=tree;f=debian/ocamlbyteinfo;hb=HEAD
@ -54,12 +52,12 @@ BuildRequires: chrpath
Requires: gcc Requires: gcc
Requires: ncurses-devel Requires: ncurses-devel
Requires: gdbm-devel Requires: gdbm-devel
Requires: rpm-build >= 4.8.0
Provides: ocaml(compiler) = %{version} Provides: ocaml(compiler) = %{version}
ExclusiveArch: alpha armv4l %{ix86} ia64 x86_64 ppc sparc sparcv9 ppc64 ExclusiveArch: alpha armv4l %{ix86} ia64 x86_64 ppc sparc sparcv9 ppc64
%define _use_internal_dependency_generator 0 %global __ocaml_requires %{_rpmconfigdir}/ocaml-find-requires.sh -c -f %{buildroot}%{_bindir}/ocamlobjinfo
%define __find_requires %{SOURCE4} -c -f %{buildroot}%{_bindir}/ocamlobjinfo %global __ocaml_provides %{_rpmconfigdir}/ocaml-find-provides.sh -f %{buildroot}%{_bindir}/ocamlobjinfo
%define __find_provides %{SOURCE5} -f %{buildroot}%{_bindir}/ocamlobjinfo
%description %description
@ -251,11 +249,6 @@ perl -pi -e "s|^$RPM_BUILD_ROOT||" $RPM_BUILD_ROOT%{_libdir}/ocaml/ld.conf
cp tools/objinfo $RPM_BUILD_ROOT%{_bindir}/ocamlobjinfo cp tools/objinfo $RPM_BUILD_ROOT%{_bindir}/ocamlobjinfo
# install rpmbuild helper files
mkdir -p $RPM_BUILD_ROOT/usr/lib/rpm/
install -m 0755 %{SOURCE4} $RPM_BUILD_ROOT/usr/lib/rpm/
install -m 0755 %{SOURCE5} $RPM_BUILD_ROOT/usr/lib/rpm/
echo %{version} > $RPM_BUILD_ROOT%{_libdir}/ocaml/fedora-ocaml-release echo %{version} > $RPM_BUILD_ROOT%{_libdir}/ocaml/fedora-ocaml-release
# Remove rpaths from stublibs .so files. # Remove rpaths from stublibs .so files.
@ -346,7 +339,6 @@ fi
%{_libdir}/ocaml/threads/*.cmi %{_libdir}/ocaml/threads/*.cmi
%{_libdir}/ocaml/threads/*.cma %{_libdir}/ocaml/threads/*.cma
%{_libdir}/ocaml/fedora-ocaml-release %{_libdir}/ocaml/fedora-ocaml-release
%attr(755,root,root) %{_prefix}/lib/rpm/*
%exclude %{_libdir}/ocaml/graphicsX11.cmi %exclude %{_libdir}/ocaml/graphicsX11.cmi
%exclude %{_libdir}/ocaml/stublibs/dlllabltk.so %exclude %{_libdir}/ocaml/stublibs/dlllabltk.so
%exclude %{_libdir}/ocaml/stublibs/dlltkanim.so %exclude %{_libdir}/ocaml/stublibs/dlltkanim.so
@ -451,6 +443,11 @@ fi
%changelog %changelog
* Wed Dec 16 2009 Richard W.M. Jones <rjones@redhat.com> - 3.11.1-7
- Remove ocaml-find-{requires,provides}.sh from this package. These are
now in upstream RPM 4.8 (RHBZ#545116).
- define -> global in a few places.
* Thu Nov 05 2009 Dennis Gilmore <dennis@ausil.us> - 3.11.1-6 * Thu Nov 05 2009 Dennis Gilmore <dennis@ausil.us> - 3.11.1-6
- include sparcv9 in the arch list - include sparcv9 in the arch list