+
+# conditional build:
+# --without emacs
+
+%{!?_without_emacs:%define emacs 1}
+%{?_without_emacs:%define emacs 0}
+
Summary: The Objective Caml compiler and programming environment
Summary(pl): Kompilator Objektowego Caml oraz ¶rodowisko programistyczne
Name: ocaml
-Version: 3.01
-Release: 1
-License: Distributable
+Version: 3.02
+Release: 3
+License: distributable
Vendor: Group of implementors <caml-light@inria.fr>
Group: Development/Languages
Group(de): Entwicklung/Sprachen
Group(pl): Programowanie/Jêzyki
Source0: ftp://ftp.inria.fr/lang/caml-light/%{name}-%{version}.tar.gz
Source1: ftp://ftp.inria.fr/lang/caml-light/%{name}-%{version}-refman.info.tar.gz
-URL: http://pauillac.inria.fr/caml/
+Source2: ftp://ftp.inria.fr/lang/caml-light/%{name}-%{version}-refman.html.tar.gz
+Source3: ftp://ftp.inria.fr/lang/caml-light/%{name}-%{version}-refman.ps.gz
+URL: http://caml.inria.fr/caml/
BuildRequires: tcl-devel
BuildRequires: tk-devel
-BuildRequires: xemacs
+%{!?_without_emacs:BuildRequires: xemacs-common}
+%{!?_without_emacs:BuildRequires: xemacs-fsf-compat-pkg}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+%define no_install_post_strip 1
+
%description
Objective Caml is a high-level, strongly-typed, functional and
object-oriented programming language from the ML family of languages.
zoptymalizowany natywny kompilator), interaktywny g³ówny system,
narzêdzia Lex&Yacc, odpluskwiacz i biblioteki.
+%package doc-ps
+Summary: PostScript documentation for OCaml
+Summary(pl): Dokumentacja dla OCaml-a w formacie PostSript
+Group: Development/Tools
+Requires: %{name} = %{version}
+
+%description doc-ps
+PostScript documentation for OCaml
+
+%description doc-ps -l pl
+Dokumentacja dla OCaml-a w formacie PostSript
+
+%package doc-html
+Summary: HTML documentation for OCaml
+Summary(pl): Dokumentacja dla OCaml-a w formacie HTML
+Group: Development/Tools
+Requires: %{name} = %{version}
+
+%description doc-html
+HTML documentation for OCaml
+
+%description doc-html -l pl
+Dokumentacja dla OCaml-a w formacie HTML
+
+%if %emacs
%package emacs
Summary: Emacs mode for OCaml
Summary(pl): Tryb Emacsa dla OCaml
%description -l pl emacs
Pliki trybu Emacsa dla jêzyka Objektowego Caml
+%endif
%prep
%setup -q -T -b 0
%setup -q -T -D -a 1
+%setup -q -T -D -a 2
+cp %{SOURCE3} .
%build
./configure \
-bindir %{_bindir} \
-libdir %{_libdir}/%{name} \
-mandir %{_mandir}/man1 \
- -host %{_host_alias} \
+ -host %{_host} \
-with-pthread
%{__make} world bootstrap opt ocamlc.opt ocamlopt.opt \
echo MANDIR=$RPM_BUILD_ROOT%{_mandir}/man1 >> config/Makefile
make install
+
+%if %emacs
%{__make} -C emacs install \
EMACS="`if [ -x %{_bindir}/emacs ]; then echo emacs; \
else echo xemacs; fi`" \
EMACSDIR="$RPM_BUILD_ROOT%{_libdir}/emacs/site-lisp"
+
cp -p {parsing/{location,longident,parsetree},typing/typecore}.{cm,ml}i \
$RPM_BUILD_ROOT%{_libdir}/%{name}
-
+%endif
+
mv -f $RPM_BUILD_ROOT%{_bindir}/ocamlc $RPM_BUILD_ROOT%{_bindir}/ocamlc.byte
-mv -f $RPM_BUILD_ROOT%{_bindir}/ocamlc.opt $RPM_BUILD_ROOT%{_bindir}/ocamlc
+ln -sf %{_bindir}/ocamlc.opt $RPM_BUILD_ROOT%{_bindir}/ocamlc
mv -f $RPM_BUILD_ROOT%{_bindir}/ocamlopt $RPM_BUILD_ROOT%{_bindir}/ocamlopt.byte
-mv -f $RPM_BUILD_ROOT%{_bindir}/ocamlopt.opt $RPM_BUILD_ROOT%{_bindir}/ocamlopt
+ln -sf %{_bindir}/ocamlopt.opt $RPM_BUILD_ROOT%{_bindir}/ocamlopt
rm -f $RPM_BUILD_ROOT%{_libdir}/%{_name}/*.ml
install -d $RPM_BUILD_ROOT%{_infodir}
rm -rf $RPM_BUILD_ROOT
%post
-%fix_info_dir
+[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
%postun
-%fix_info_dir
+[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
%files
%defattr(644,root,root,755)
-%doc *.gz
+%doc LICENSE.gz Changes.gz README.gz
%attr(755, root, root) %{_bindir}/*
-%{_libdir}/%{name}
+%{_libdir}/%{name}/caml
+%{_libdir}/%{name}/labltk
+%{_libdir}/%{name}/threads
+%{_libdir}/%{name}/*.*
+%attr(755,root,root) %{_libdir}/%{name}/expunge
+%attr(755,root,root) %{_libdir}/%{name}/extract_crc
+%attr(755,root,root) %{_libdir}/%{name}/camlheader
+%attr(755,root,root) %{_libdir}/%{name}/camlheader_ur
%{_mandir}/man*/*
%{_infodir}/*
+%if %emacs
%files emacs
%defattr(644,root,root,755)
%{_libdir}/emacs/site-lisp/*.el
+%endif
+
+%files doc-ps
+%doc *.ps.gz
+
+%files doc-html
+%doc htmlman