]> git.pld-linux.org Git - packages/ocaml-csexp.git/blame - ocaml-csexp.spec
- updated to 1.5.1
[packages/ocaml-csexp.git] / ocaml-csexp.spec
CommitLineData
ba0f37a9
JR
1#
2# Conditional build:
668d7683 3%bcond_without ocaml_opt # native optimized binaries (bytecode is always built)
ba0f37a9
JR
4%bcond_with dune # build with dune, this is off due to circular deps
5
6# not yet available on x32 (ocaml 4.02.1), update when upstream will support it
7%ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9
8%undefine with_ocaml_opt
9%endif
10
11%if %{without ocaml_opt}
12%define _enable_debug_packages 0
13%endif
14
15%define module csexp
16Summary: Parsing and printing of S-expressions in canonical form
668d7683 17Summary(pl.UTF-8): Analiza i wypisywanie S-wyrażeń w postaci kanonicznej
ba0f37a9 18Name: ocaml-%{module}
668d7683 19Version: 1.5.1
ba0f37a9
JR
20Release: 1
21License: MIT
668d7683
JB
22Group: Libraries
23#Source0Download: https://github.com/ocaml-dune/csexp/releases
ba0f37a9 24Source0: https://github.com/ocaml-dune/csexp/releases/download/%{version}/%{module}-%{version}.tbz
668d7683 25# Source0-md5: 11cf8377dc963ecaf2226df117911676
ba0f37a9 26URL: https://github.com/ocaml-dune/csexp
668d7683 27BuildRequires: ocaml >= 1:4.03.0
ba0f37a9
JR
28%if %{with dune}
29BuildRequires: ocaml-dune >= 1.11
30BuildRequires: ocaml-odoc
ba0f37a9
JR
31%endif
32BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34%description
35This project provides minimal support for parsing and printing
36S-expressions in canonical form, which is a very simple and canonical
37binary encoding of S-expressions.
38
668d7683
JB
39%description -l pl.UTF-8
40Ten projekt zapewnia minimalną obsługę analizy i wypisywania S-wyrażeń
41w postaci kanonicznej, będącej bardzo prostym i kanonicznym kodowaniem
42binarnym S-wyrażeń.
43
ba0f37a9 44%package devel
668d7683
JB
45Summary: Development files for csexp library
46Summary(pl.UTF-8): Pliki programistyczne biblioteki csexp
47Group: Development/Libraries
ba0f37a9 48Requires: %{name} = %{version}-%{release}
ba0f37a9
JR
49
50%description devel
668d7683
JB
51This package contains libraries and signature files for developing
52applications that use OCaml csexp library.
53
54%description devel -l pl.UTF-8
55Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji
56wykorzystujących bibliotekę OCamla csexp.
ba0f37a9
JR
57
58%prep
59%setup -q -n %{module}-%{version}
ba0f37a9
JR
60
61%build
62%if %{with dune}
63dune build %{?_smp_mflags} --display=verbose @install
64dune build %{?_smp_mflags} @doc
65%else
66OFLAGS="-strict-sequence -strict-formats -short-paths -keep-locs -g -opaque"
67OCFLAGS="$OFLAGS -bin-annot"
68cd src
69ocamlc $OCFLAGS -output-obj csexp.mli
70ocamlc $OCFLAGS -a -o csexp.cma csexp.ml
71%if %{with ocaml_opt}
72ocamlopt $OFLAGS -ccopt "%{rpmcflags}" -cclib "%{rpmldflags}" -a \
73 -o csexp.cmxa csexp.ml
74ocamlopt $OFLAGS -ccopt "%{rpmcflags}" -cclib "%{rpmldflags}" -shared \
75 -o csexp.cmxs csexp.ml
76%endif
77%endif
78
79%install
80rm -rf $RPM_BUILD_ROOT
81%if %{with dune}
82dune install --destdir=$RPM_BUILD_ROOT
83
84# We do not want the dune markers
85find _build/default/_doc/_html -name .dune-keep -delete
86
87# We do not want the ml files
88find $RPM_BUILD_ROOT%{_libdir}/ocaml -name \*.ml -delete
89
90# We install the documentation with the doc macro
91rm -fr $RPM_BUILD_ROOT%{_prefix}/doc
92%else
93# Install without dune. See comment at the top.
94install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/%{module}
95cp -p src/csexp.{cma,cmi,cmt,cmti,mli} $RPM_BUILD_ROOT%{_libdir}/ocaml/%{module}
96%if %{with ocaml_opt}
97cp -p src/csexp.{a,cmx,cmxa,cmxs} $RPM_BUILD_ROOT%{_libdir}/ocaml/%{module}
98%endif
99
100cp -p csexp.opam $RPM_BUILD_ROOT%{_libdir}/ocaml/%{module}/opam
101
102cat >> $RPM_BUILD_ROOT%{_libdir}/ocaml/%{module}/META << EOF
103version = "%{version}"
104description = "Parsing and printing of S-expressions in canonical form"
105archive(byte) = "csexp.cma"
106%ifarch %{ocaml_native_compiler}
107archive(native) = "csexp.cmxa"
108%endif
109plugin(byte) = "csexp.cma"
110%ifarch %{ocaml_native_compiler}
111plugin(native) = "csexp.cmxs"
112%endif
113EOF
114
115cat >> $RPM_BUILD_ROOT%{_libdir}/ocaml/%{module}/dune-package << EOF
116(lang dune 2.8)
117(name csexp)
118(version %{version})
119(library
120 (name csexp)
121 (kind normal)
122%if %{with ocaml_opt}
123 (archives (byte csexp.cma) (native csexp.cmxa))
124 (plugins (byte csexp.cma) (native csexp.cmxs))
125 (native_archives csexp.a)
126%else
127 (archives (byte csexp.cma))
128 (plugins (byte csexp.cma))
129%endif
130 (main_module_name Csexp)
131%if %{with ocaml_opt}
132 (modes byte native)
133%else
134 (modes byte)
135%endif
136 (modules
137 (singleton (name Csexp) (obj_name csexp) (visibility public) (impl) (intf))))
138EOF
139%endif
140
141%clean
142rm -rf $RPM_BUILD_ROOT
143
144%files
145%defattr(644,root,root,755)
668d7683
JB
146%doc LICENSE.md README.md
147%dir %{_libdir}/ocaml/%{module}
ba0f37a9
JR
148%{_libdir}/ocaml/%{module}/META
149%{_libdir}/ocaml/%{module}/*.cma
150%{_libdir}/ocaml/%{module}/*.cmi
151%if %{with ocaml_opt}
152%{_libdir}/ocaml/%{module}/*.cmxs
153%endif
154
155%files devel
156%defattr(644,root,root,755)
157%{_libdir}/ocaml/%{module}/dune-package
158%{_libdir}/ocaml/%{module}/opam
159%if %{with ocaml_opt}
160%{_libdir}/ocaml/%{module}/*.a
161%{_libdir}/ocaml/%{module}/*.cmx
162%{_libdir}/ocaml/%{module}/*.cmxa
163%endif
164%{_libdir}/ocaml/%{module}/*.cmt
165%{_libdir}/ocaml/%{module}/*.cmti
166%{_libdir}/ocaml/%{module}/*.mli
This page took 0.095091 seconds and 4 git commands to generate.