Blob Blame History Raw
%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)

%global ocaml_major 4.02
%global ocaml_minor 2

# Disabled for 3.11.2+rc1, 3.12.0, 3.12.1, 4.00, 4.01, 4.02.
%global with_ocamlduce 0

%if %{with_ocamlduce}
%global ocamlduce_version %{ocaml_major}.%{ocaml_minor}.0
%endif

Name:           cduce
Version:        0.6.0
Release:        14%{?dist}
Summary:        Modern XML-oriented functional language
License:        BSD

URL:            http://www.cduce.org/

Source0:        http://www.cduce.org/download/%{name}-%{version}.tar.gz
%if %{with_ocamlduce}
Source1:        http://caml.inria.fr/distrib/ocaml-%{ocaml_major}/ocaml-%{ocaml_major}/ocaml-%{ocaml_major}.%{ocaml_minor}.tar.gz
#Source2:        http://forge.ocamlcore.org/frs/download.php/225/ocamlduce-%{ocamlduce_version}.tar.gz
Source2:         http://debian.glondu.net/debian/ocaml-3.12.0/pool/ocamlduce/ocamlduce_3.12.0.0.orig.tar.gz
%endif

# Build fixes for OCaml 4.02.
# All upstream on the '0.6.1-rc1' branch.
Patch0001:      0001-Change-the-default-inlining-from-10000-to-100-OCaml-.patch
Patch0002:      0002-Do-not-rely-on-a-load-directive-at-the-top-of-parser.patch
Patch0003:      0003-Fix-the-compilation-of-ocaml-bindings.patch
Patch0004:      0004-Detect-OCaml-version-used-for-the-ocaml-bridge-in-th.patch
Patch0005:      0005-Make-it-possible-compile-the-ocaml-cduce-interface-a.patch
Patch0006:      0006-Make-sure-that-the-g-flag-is-correctly-propagated-to.patch
Patch0007:      0007-Prevent-the-compiler-from-statically-allocating-an-p.patch
Patch0008:      0008-Don-t-trigger-an-assertion-failure-when-loading-the-.patch
Patch0009:      0009-Re-enable-parallel-build-of-the-project-make-j-works.patch
Patch0010:      0010-Edit-CHANGES-and-VERSION-files.patch
Patch0011:      0011-Sync-with-ocaml-4.02-trunk-changes-in-parser-locatio.patch

ExcludeArch:    ppc64 s390 s390x sparc64

%if %{with_ocamlduce}
BuildRequires:  ocaml = %{ocaml_major}.%{ocaml_minor}
%else
BuildRequires:  ocaml
%endif
BuildRequires:  ocaml-ocamldoc
BuildRequires:  ocaml-camlp4-devel
BuildRequires:  ocaml-findlib-devel
BuildRequires:  ocaml-ocamlnet-devel >= 3.4
BuildRequires:  ocaml-pcre-devel
BuildRequires:  ocaml-pxp-devel >= 1.2.2
BuildRequires:  ocaml-expat-devel
BuildRequires:  ocaml-curl-devel
BuildRequires:  ocaml-ulex-devel
BuildRequires:  pcre-devel
BuildRequires:  bzip2
BuildRequires:  chrpath
BuildRequires:  rpm >= 4.4.2.3-2

%global __ocaml_requires_opts -i Asttypes -i Outcometree -i Parsetree


%description
CDuce is a modern XML-oriented functional language with innovative
features. A compiler is available under the terms of an open-source
license. CDuce is type-safe, efficient, and offers powerful
constructions to work with XML documents.

For ocamlduce (the modified OCaml language which incorporates CDuce
extensions), please install the cduce-ocamlduce package.


%package        devel
Summary:        Development files for %{name}
Requires:       %{name} = %{version}-%{release}


%description    devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.


%if %{with_ocamlduce}
%package        ocamlduce
Summary:        Development files for %{name}
Requires:       %{name} = %{version}-%{release}


%description    ocamlduce
This package contains a modified version of the OCaml language which
incorporates CDuce extensions for working with XML documents.
%endif


%prep
%setup -q -n %{name}-%{version}
%if %{with_ocamlduce}
%setup -q -n %{name}-%{version} -T -D -a 2
%endif

%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
%patch0004 -p1
%patch0005 -p1
%patch0006 -p1
%patch0007 -p1
%patch0008 -p1
%patch0009 -p1
%patch0010 -p1
%patch0011 -p1

./configure --prefix=%{_prefix} \
  --bindir=%{_bindir} \
  --mandir=%{_mandir} \
  --docdir=%{_docdir} \
  --mliface=ocaml-%{ocaml_major}.%{ocaml_minor}


%build
# Parallel builds break things:
unset MAKEFLAGS

make all doc VERBOSE=true
chrpath --delete cduce

%if %{with_ocamlduce}
# Building ocamlduce is a bit more involved ...
pushd ocamlduce-%{ocamlduce_version}
make prepare \
  OCAML_VERSION=%{ocaml_major}.%{ocaml_minor} \
  OCAML_SOURCE=%{SOURCE1} \
  OCAML_SRCDIR=ocaml-%{ocaml_major}.%{ocaml_minor}
cd ocaml-%{ocaml_major}.%{ocaml_minor}
  # Configure must match the one from base ocaml.spec
CFLAGS="$RPM_OPT_FLAGS" ./configure \
    -bindir %{_bindir} \
    -libdir %{_libdir}/ocaml \
    -x11lib %{_libdir} \
    -x11include %{_includedir} \
    -mandir %{_mandir}/man1
make -f Makefile.ocamlduce world world.opt
popd
%endif


%install
export DESTDIR=$RPM_BUILD_ROOT
export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
mkdir -p $OCAMLFIND_DESTDIR
make install \
  BINDIR=$RPM_BUILD_ROOT%{_bindir} \
  MANDIR=$RPM_BUILD_ROOT%{_mandir} \
  DOCDIR=$RPM_BUILD_ROOT%{_docdir}/%{name}-devel

%if %{with_ocamlduce}
# Install ocamlduce.
pushd ocamlduce-%{ocamlduce_version}
mkdir -p $RPM_BUILD_ROOT%{_libdir}/ocaml/ocamlduce
cd ocaml-%{ocaml_major}.%{ocaml_minor}
make -f Makefile.ocamlduce installbyte installopt \
  DUCE_LIBDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml/ocamlduce \
  BINDIR=$RPM_BUILD_ROOT%{_bindir}
popd
%endif


%files
%doc AUTHORS CHANGES README LICENSE VERSION
%{_libdir}/ocaml/cduce
%if %opt
%exclude %{_libdir}/ocaml/cduce/*.a
%exclude %{_libdir}/ocaml/cduce/*.cmxa
%endif
%{_bindir}/cduce


%files devel
%{_libdir}/ocaml/cduce/*.a
%{_libdir}/ocaml/cduce/*.cmxa
%{_mandir}/man1/*.1.gz
%{_docdir}/%{name}-devel/


%if %{with_ocamlduce}
%files ocamlduce
%{_bindir}/ocamlduce*
%{_libdir}/ocaml/ocamlduce/
%endif


%changelog
* Fri Jul 24 2015 Richard W.M. Jones <rjones@redhat.com> - 0.6.0-14
- Bump and rebuild for ocamlnet.

* Wed Jun 24 2015 Richard W.M. Jones <rjones@redhat.com> - 0.6.0-13
- ocaml-4.02.2 final rebuild.

* Wed Jun 17 2015 Richard W.M. Jones <rjones@redhat.com> - 0.6.0-12
- ocaml-4.02.2 rebuild.

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Tue Feb 17 2015 Richard W.M. Jones <rjones@redhat.com> - 0.6.0-10
- ocaml-4.02.1 rebuild.
- Fix dependency on OCaml compiler version.

* Sun Aug 31 2014 Richard W.M. Jones <rjones@redhat.com> - 0.6.0-9
- Bump release and rebuild.

* Sun Aug 31 2014 Richard W.M. Jones <rjones@redhat.com> - 0.6.0-8
- ocaml-4.02.0 final rebuild.

* Sun Aug 24 2014 Richard W.M. Jones <rjones@redhat.com> - 0.6.0-7
- ocaml-4.02.0+rc1 rebuild.

* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Aug 09 2014 Richard W.M. Jones <rjones@redhat.com> - 0.6.0-5
- Import more upstream patches which might fix build on OCaml 4.02.

* Sun Aug 03 2014 Richard W.M. Jones <rjones@redhat.com> - 0.6.0-4
- Import upstream patches which might fix build on OCaml 4.02.

* Sat Aug 02 2014 Richard W.M. Jones <rjones@redhat.com> - 0.6.0-3
- ocaml-4.02.0-0.8.git10e45753.fc22 rebuild.

* Fri Aug 01 2014 Richard W.M. Jones <rjones@redhat.com> - 0.6.0-2
- Add potential build fix for OCaml 4.02.

* Wed Jul 23 2014 Richard W.M. Jones <rjones@redhat.com> - 0.6.0-1
- New upstream version 0.6.0.
- Rebuild for OCaml 4.02.0 beta.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.5-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Thu Sep 19 2013 Richard W.M. Jones <rjones@redhat.com> - 0.5.5-7
- OCaml 4.01.0 rebuild.
- Modernize the spec file.
- Enable debuginfo.

* Tue Aug  6 2013 Richard W.M. Jones <rjones@redhat.com> - 0.5.5-6
- Do not use versioned docdir in Fedora 20 (RHBZ#993691).

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sun Dec 02 2012 Bruno Wolff III <bruno@wolff.to> - 0.5.5-3
- Rebuild for ocaml 4.0.1.

* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Tue Jul  3 2012 Richard W.M. Jones <rjones@redhat.com> - 0.5.5-1
- New upstream version 0.5.5.
- Remove OCaml sources.  Required for cduce_mktop, but some upstream
  work is needed to make this work with OCaml 4.00.0.

* Mon Jun 11 2012 Richard W.M. Jones <rjones@redhat.com> - 0.5.4-5
- Rebuild for OCaml 4.00.0.

* Fri Feb 10 2012 Petr Pisar <ppisar@redhat.com> - 0.5.4-4
- Rebuild against PCRE 8.30

* Sun Jan 08 2012 Richard W.M. Jones <rjones@redhat.com> - 0.5.4-3
- Rebuild for OCaml 3.12.1.

* Wed Sep 21 2011 Richard W.M. Jones <rjones@redhat.com> - 0.5.4-1
- New upstream version 0.5.4.
- Program dtd2cduce is no longer built.

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Fri Jan 22 2010 Richard W.M. Jones <rjones@redhat.com> - 0.5.3-7
- Recompile for OCaml 3.12.0.
- Include ocamlduce from Stephane Glondu's version, but leave it
  disabled since I still cannot get it to compile.

* Thu Jan 14 2010 Richard W.M. Jones <rjones@redhat.com> - 0.5.3-6
- Temporarily disable ocamlduce until we work out the build problem.
- Recheck package with rpmlint.

* Tue Jan  5 2010 Richard W.M. Jones <rjones@redhat.com> - 0.5.3-5
- ocamlduce: Upstream fix for OCaml 3.11.2+rc1.
- Use upstream RPM 4.8 OCaml dependency generator.
- Replace %%define with %%global.

* Wed Dec 30 2009 Richard W.M. Jones <rjones@redhat.com> - 0.5.3-4
- Rebuild for OCaml 3.11.2.

* Wed Sep 30 2009 Richard W.M. Jones <rjones@redhat.com> - 0.5.3-3
- Rebuild for OCaml 3.11.1.
- Reenable ocamlduce 3.11.1.0.

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Tue May 26 2009 Richard W.M. Jones <rjones@redhat.com> - 0.5.3-1
- New upstream release 0.5.3.
- Patch for compatibility with OCaml 3.11 now upstream.
- Rebuild for OCaml 3.11.1+rc0.
- Disable ocamlduce - waiting for upstream to release a compatible version.

* Thu Apr 16 2009 S390x secondary arch maintainer <fedora-s390x@lists.fedoraproject.org>
- ExcludeArch sparc64, s390, s390x as we don't have OCaml on those archs
  (added sparc64 per request from the sparc maintainer)

* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.2.1-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sat Jan 17 2009 Richard W.M. Jones <rjones@redhat.com> - 0.5.2.1-13
- Add ocamlduce subpackage.
- Capitalize the summary line as per packaging guidelines.

* Wed Jan 14 2009 Richard W.M. Jones <rjones@redhat.com> - 0.5.2.1-12
- Improve the OCaml 3.11.0 patch (suggested by Kim Nguyen).

* Fri Dec  5 2008 Richard W.M. Jones <rjones@redhat.com> - 0.5.2.1-11
- Attempt to rebuild against OCaml 3.11.0.

* Sat Nov 22 2008 Richard W.M. Jones <rjones@redhat.com> - 0.5.2.1-10
- Don't include the name in the summary line.

* Thu Apr 24 2008 Richard W.M. Jones <rjones@redhat.com> - 0.5.2.1-9
- Problem with the previous import to Koji - reimport.

* Wed Apr 23 2008 Richard W.M. Jones <rjones@redhat.com> - 0.5.2.1-8
- Forgot to change the OCaml version number in the header.

* Wed Apr 23 2008 Richard W.M. Jones <rjones@redhat.com> - 0.5.2.1-7
- Rebuild for OCaml 3.10.2

* Fri Apr 18 2008 Richard W.M. Jones <rjones@redhat.com> - 0.5.2.1-6
- Rebuild against updated RPM (see bug 443118).

* Fri Apr  4 2008 Richard W.M. Jones <rjones@redhat.com> - 0.5.2.1-5
- Upstream renamed the tarball from 0.5.2-1 to 0.5.2.1.

* Tue Mar 25 2008 Richard W.M. Jones <rjones@redhat.com> - 0.5.2.1-4
- ExcludeArch ppc64 again (see bug 438843).

* Tue Mar 25 2008 Richard W.M. Jones <rjones@redhat.com> - 0.5.2.1-3
- Added BR pcre-devel.
- Test build in Koji.

* Wed Mar  5 2008 Richard W.M. Jones <rjones@redhat.com> - 0.5.2.1-2
- Remove ExcludeArch ppc64.

* Tue Feb 26 2008 Richard W.M. Jones <rjones@redhat.com> - 0.5.2.1-1
- New upstream release 0.5.2-1.

* Tue Feb 26 2008 Richard W.M. Jones <rjones@redhat.com> - 0.5.2-1
- New upstream release 0.5.2.
- Removed netcgi patch.
- AUTHORS file is now UTF-8 so remove that change.

* Fri Feb 15 2008 Richard W.M. Jones <rjones@redhat.com> - 0.5.1-1
- New upstream release 0.5.1.
- New OCaml 3.10.1.

* Thu Sep 13 2007 Richard W.M. Jones <rjones@redhat.com> - 0.5.0-1
- Upstream version 0.5.0
- Remove RPATH in cduce binary.
- ExcludeArch ppc64.
- Build without ocamlopt.
- Convert AUTHORS file to UTF-8.
- Ignore Parsetree module.

* Sat May 26 2007 Richard W.M. Jones <rjones@redhat.com> - 0.4.2-1
- Initial RPM release.