diff --git a/.gitignore b/.gitignore index 93512e2..bf027b4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,3 @@ /v1.5.0.tar.gz /v1.6.4.tar.gz /v1.6.5.tar.gz -/v1.6.6.tar.gz -/cppo-1.6.8.tar.gz -/cppo-1.8.0.tar.gz diff --git a/cppo-1.6.5-string-capitalize.patch b/cppo-1.6.5-string-capitalize.patch new file mode 100644 index 0000000..7a4fe1d --- /dev/null +++ b/cppo-1.6.5-string-capitalize.patch @@ -0,0 +1,11 @@ +--- ./cppo-1.6.5/src/cppo_eval.ml.old 2019-04-29 18:27:54.177974043 +0100 ++++ ./cppo-1.6.5/src/cppo_eval.ml 2019-04-29 18:28:01.770989363 +0100 +@@ -85,7 +85,7 @@ + let trim_compact_and_capitalize_string s = + let buf = Buffer.create (String.length s) in + trim_and_compact buf s; +- String.capitalize (Buffer.contents buf) ++ String.capitalize_ascii (Buffer.contents buf) + + let is_ident s = + let len = String.length s in diff --git a/gating.yaml b/gating.yaml deleted file mode 100755 index 2c7ed80..0000000 --- a/gating.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- !Policy -product_versions: - - rhel-* -decision_context: osci_compose_gate -rules: - - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/ocaml-cppo.spec b/ocaml-cppo.spec index 03decee..2dc286f 100644 --- a/ocaml-cppo.spec +++ b/ocaml-cppo.spec @@ -1,22 +1,29 @@ -# OCaml packages not built on i686 since OCaml 5 / Fedora 39. -ExcludeArch: %{ix86} - -%global giturl https://github.com/ocaml-community/cppo +%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) +%if !%{opt} +%global debug_package %{nil} +%endif Name: ocaml-cppo -Version: 1.8.0 -Release: 5%{?dist} +Version: 1.6.5 +Release: 4%{?dist} Summary: Equivalent of the C preprocessor for OCaml programs -License: BSD-3-Clause -URL: https://ocaml-community.github.io/cppo/ -VCS: git:%{giturl}.git -Source0: %{giturl}/archive/v%{version}/cppo-%{version}.tar.gz +License: BSD +URL: http://mjambon.com/cppo.html +Source0: https://github.com/mjambon/cppo/archive/v%{version}.tar.gz -BuildRequires: ocaml >= 4.02.3 -BuildRequires: ocaml-dune +# Replace deprecated function String.capitalize. +Patch1: cppo-1.6.5-string-capitalize.patch + +BuildRequires: ocaml >= 3.10.0 BuildRequires: ocaml-findlib -BuildRequires: ocaml-ocamlbuild +%if !%{opt} +Requires: ocaml >= 3.10.0 +%endif +BuildRequires: ocaml-ocamlbuild-devel +BuildRequires: ocaml-dune + +%define libname %(sed -e 's/^ocaml-//' <<< %{name}) %description Cppo is an equivalent of the C preprocessor targeted at the OCaml @@ -33,174 +40,38 @@ on the standard parsing tools Ocamllex and Ocamlyacc, which contribute to the robustness of cppo across OCaml versions. -%package ocamlbuild -Summary: Preprocessing plugin for ocamlbuild -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: ocaml-ocamlbuild%{?_isa} -# There is no devel subpackage because this package IS for development purposes - - -%description ocamlbuild -This package contains a plugin for ocamlbuild that enables calling cppo -at build time. To use it, call ocamlbuild with the argument -`-plugin-tag package(cppo_ocamlbuild)`. - - %prep -%autosetup -n cppo-%{version} +%setup -q -n %{libname}-%{version} +%patch1 -p2 +sed -i.add-debuginfo \ + 's/ocamlopt/ocamlopt -g/;s/ocamlc \(-[co]\)/ocamlc -g \1/' \ + Makefile %build -%dune_build +make %{?_smp_mflags} all %install -%dune_install +%{__install} -d $RPM_BUILD_ROOT%{_bindir} +%{__install} -p _build/install/default/bin/cppo $RPM_BUILD_ROOT%{_bindir}/ %check -%dune_check +%ifnarch %{arm} %{power64} +# Fails on armv7hl and ppc64le with: +# Error: math error +make test +%endif %files %license LICENSE.md -%doc Changes.md README.md +%doc Changes README.md %{_bindir}/cppo -%{_libdir}/ocaml/cppo - - -%files ocamlbuild -%{_libdir}/ocaml/cppo_ocamlbuild/ %changelog -* Mon Oct 13 2025 Richard W.M. Jones - 1.8.0-5 -- OCaml 5.4.0 rebuild - -* Thu Jul 24 2025 Fedora Release Engineering - 1.8.0-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Fri Jul 11 2025 Jerry James - 1.8.0-3 -- Rebuild to fix OCaml dependencies - -* Fri Jan 17 2025 Fedora Release Engineering - 1.8.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Thu Jan 9 2025 Jerry James - 1.8.0-1 -- OCaml 5.3.0 rebuild for Fedora 42 -- Version 1.8.0 - -* Thu Jul 18 2024 Fedora Release Engineering - 1.6.9-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Wed Jun 19 2024 Richard W.M. Jones - 1.6.9-10 -- OCaml 5.2.0 ppc64le fix - -* Wed May 29 2024 Richard W.M. Jones - 1.6.9-9 -- OCaml 5.2.0 for Fedora 41 - -* Thu Jan 25 2024 Fedora Release Engineering - 1.6.9-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Sun Jan 21 2024 Fedora Release Engineering - 1.6.9-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Mon Dec 18 2023 Richard W.M. Jones - 1.6.9-6 -- OCaml 5.1.1 + s390x code gen fix for Fedora 40 - -* Tue Dec 12 2023 Richard W.M. Jones - 1.6.9-5 -- OCaml 5.1.1 rebuild for Fedora 40 - -* Thu Oct 05 2023 Richard W.M. Jones - 1.6.9-4 -- OCaml 5.1 rebuild for Fedora 40 - -* Thu Jul 20 2023 Fedora Release Engineering - 1.6.9-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Tue Jul 11 2023 Richard W.M. Jones - 1.6.9-2 -- OCaml 5.0 rebuild for Fedora 39 - -* Mon Jul 10 2023 Jerry James - 1.6.9-1 -- Version 1.6.9 -- Convert License tag to SPDX -- Use new dune macros - -* Tue Jan 24 2023 Richard W.M. Jones - 1.6.8-7 -- Rebuild OCaml packages for F38 - -* Thu Jan 19 2023 Fedora Release Engineering - 1.6.8-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Fri Jul 22 2022 Fedora Release Engineering - 1.6.8-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Sat Jun 18 2022 Richard W.M. Jones - 1.6.8-4 -- OCaml 4.14.0 rebuild - -* Fri Feb 04 2022 Richard W.M. Jones - 1.6.8-3 -- OCaml 4.13.1 rebuild to remove package notes - -* Thu Jan 20 2022 Fedora Release Engineering - 1.6.8-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Tue Dec 14 2021 Jerry James - 1.6.8-1 -- Version 1.6.8 -- New URLs -- Add ocamlbuild subpackage for the plugin -- Build, install, and test with dune - -* Mon Oct 04 2021 Richard W.M. Jones - 1.6.6-14 -- OCaml 4.13.1 build - -* Thu Jul 22 2021 Fedora Release Engineering - 1.6.6-13 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Mon Mar 1 11:02:42 GMT 2021 Richard W.M. Jones - 1.6.6-12 -- OCaml 4.12.0 build - -* Tue Jan 26 2021 Fedora Release Engineering - 1.6.6-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Tue Sep 01 2020 Richard W.M. Jones - 1.6.6-10 -- OCaml 4.11.1 rebuild - -* Fri Aug 21 2020 Richard W.M. Jones - 1.6.6-9 -- OCaml 4.11.0 rebuild - -* Sat Aug 01 2020 Fedora Release Engineering - 1.6.6-8 -- Second attempt - Rebuilt for - https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Tue Jul 28 2020 Fedora Release Engineering - 1.6.6-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Mon May 04 2020 Richard W.M. Jones - 1.6.6-6 -- OCaml 4.11.0+dev2-2020-04-22 rebuild - -* Tue Apr 21 2020 Richard W.M. Jones - 1.6.6-5 -- OCaml 4.11.0 pre-release attempt 2 - -* Fri Apr 03 2020 Richard W.M. Jones - 1.6.6-4 -- Update all OCaml dependencies for RPM 4.16. - -* Wed Feb 26 2020 Richard W.M. Jones - 1.6.6-3 -- OCaml 4.10.0 final. - -* Wed Jan 29 2020 Fedora Release Engineering - 1.6.6-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Sun Jan 19 2020 Richard W.M. Jones - 1.6.6-1 -- New upstream version 1.6.6. -- Change build system from jbuilder to dune. -- Remove patch for fix which is now upstream. -- OCaml 4.10.0+beta1 rebuild. - -* Fri Dec 06 2019 Richard W.M. Jones - 1.6.5-6 -- OCaml 4.09.0 (final) rebuild. - -* Fri Aug 16 2019 Richard W.M. Jones - 1.6.5-5 -- OCaml 4.08.1 (final) rebuild. - * Wed Jul 31 2019 Richard W.M. Jones - 1.6.5-4 - OCaml 4.08.1 (rc2) rebuild. diff --git a/sources b/sources index d65b626..86239cb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (cppo-1.8.0.tar.gz) = 3840725b767a0300bdc48f11d26d798bdcae0a764ed6798df3a08dfc8cc76fe124b14a19d47c9b5ea8e229d68b0311510afce77c0e4d9131fbda5116dc2689a2 +SHA512 (v1.6.5.tar.gz) = e7955d578c4d3d9b2a2c40691b39912ecaffe5173b90394552978836da79ae963ae202899525e366a599a35913373fd7ab584748d1fcbdc4e53a442b42603061 diff --git a/tests/basic-test.sh b/tests/basic-test.sh deleted file mode 100755 index dd895c1..0000000 --- a/tests/basic-test.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -e -set -x - -# XXX How to test? -# At the moment this is just an installation test. diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100755 index 5cc05e9..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,12 +0,0 @@ -- hosts: localhost - roles: - - role: standard-test-basic - tags: - - classic - required_packages: - - ocaml - - ocaml-cppo - tests: - - simple: - dir: . - run: ./basic-test.sh