From 74ee1641f8b76a63003934f68f2c0ce62641e9e3 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Tue, 28 Jan 2014 23:29:17 +0700 Subject: [PATCH] Initial import --- .gitignore | 1 + ocaml-cppo.spec | 74 +++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 76 insertions(+) create mode 100644 ocaml-cppo.spec diff --git a/.gitignore b/.gitignore index e69de29..a85a0f7 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/cppo-0.9.3.tar.gz diff --git a/ocaml-cppo.spec b/ocaml-cppo.spec new file mode 100644 index 0000000..8087520 --- /dev/null +++ b/ocaml-cppo.spec @@ -0,0 +1,74 @@ +%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) +%if !%{opt} +%global debug_package %{nil} +%endif + +Name: ocaml-cppo +Version: 0.9.3 +Release: 2%{?dist} +Summary: Equivalent of the C preprocessor for OCaml programs + +License: BSD +URL: http://mjambon.com/cppo.html +Source0: http://mjambon.com/releases/cppo/cppo-%{version}.tar.gz + +ExclusiveArch: %{ocaml_arches} + +BuildRequires: ocaml >= 3.10.0 +BuildRequires: ocaml-findlib +%if !%{opt} +Requires: ocaml >= 3.10.0 +%endif + +%define libname %(sed -e 's/^ocaml-//' <<< %{name}) + +%description +Cppo is an equivalent of the C preprocessor targeted at the OCaml +language and its variants. + +The main purpose of cppo is to provide a lightweight tool for simple +macro substitution (#define) and file inclusion (#include) for the +occasional case when this is useful in OCaml. Processing specific +sections of files by calling external programs is also possible via +#ext directives. + +The implementation of cppo relies on the standard library of OCaml and +on the standard parsing tools Ocamllex and Ocamlyacc, which contribute +to the robustness of cppo across OCaml versions. + + +%prep +%setup -q -n %{libname}-%{version} +sed -i.add-debuginfo \ + 's/ocamlopt/ocamlopt -g/;s/ocamlc \(-[co]\)/ocamlc -g \1/' \ + Makefile + + +%build +%if %opt +make %{?_smp_mflags} opt +%else +make %{?_smp_mflags} all +%endif + + +%install +%{__install} -d $RPM_BUILD_ROOT%{_bindir} +%{__install} -p cppo $RPM_BUILD_ROOT%{_bindir}/ + + +%check +make test + + +%files +%doc LICENSE README Changes +%{_bindir}/cppo + + +%changelog +* Mon Jan 27 2014 Michel Salim - 0.9.3-2 +- Incorporate review feedback + +* Mon Jan 20 2014 Michel Salim - 0.9.3-1 +- Initial package diff --git a/sources b/sources index e69de29..181da08 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +cfea4211ab9a7c1276537ce4fc3669b5 cppo-0.9.3.tar.gz