]>
Commit | Line | Data |
---|---|---|
bfe7d50f JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built) | |
4 | ||
5 | # not yet available on x32 (ocaml 4.02.1), update when upstream will support it | |
995febc4 | 6 | %ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9 |
bfe7d50f JB |
7 | %undefine with_ocaml_opt |
8 | %endif | |
9 | ||
66fe221c JR |
10 | %if %{without ocaml_opt} |
11 | %define _enable_debug_packages 0 | |
12 | %endif | |
1ecd5f61 | 13 | %define _debugsource_packages 0 |
66fe221c | 14 | |
170a6c18 JR |
15 | Summary: Objective Caml Preprocessor |
16 | Summary(pl.UTF-8): Preprocesor OCamla | |
17 | Name: camlp5 | |
d4aacc8e | 18 | Version: 8.00.02 |
6930534c | 19 | Release: 2 |
170a6c18 JR |
20 | License: distributable |
21 | Group: Development/Languages | |
d4aacc8e | 22 | #Source0Download: https://github.com/camlp5/camlp5/releases |
7a1551a7 | 23 | Source0: https://github.com/camlp5/camlp5/archive/rel%{version}/%{name}-%{version}.tar.gz |
d4aacc8e | 24 | # Source0-md5: 096076be4b26034643508511e834ccc2 |
7a1551a7 | 25 | Patch0: no-warn-error.patch |
1ecd5f61 | 26 | Patch1: %{name}-flags.patch |
7a1551a7 | 27 | URL: https://camlp5.github.io/ |
170a6c18 | 28 | BuildRequires: db-devel >= 4.1 |
f95747ae | 29 | BuildRequires: ocaml |
77729407 | 30 | BuildRequires: ocaml-ocamlbuild |
62e5c235 | 31 | %requires_eq ocaml-runtime |
170a6c18 JR |
32 | Requires: %{name} = %{epoch}:%{version}-%{release} |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
1aebc93e | 36 | Camlp5 is a Pre-Processor-Pretty-Printer for Objective Caml. It offers |
170a6c18 JR |
37 | tools for syntax (grammars) and the ability to modify the concrete |
38 | syntax of the language (quotations, syntax extensions). | |
39 | ||
1aebc93e | 40 | Camlp5 can parse normal Ocaml concrete syntax or any other |
170a6c18 JR |
41 | user-definable syntax. As an example, an alternative syntax is |
42 | provided, named revised, because it tries to fix some small problems | |
43 | of the normal syntax. | |
44 | ||
1aebc93e | 45 | Camlp5 can pretty print the normal Ocaml concrete syntax or the |
170a6c18 JR |
46 | revised one. It is therefore always possible to have a version of your |
47 | sources compilable by the Objective Caml compiler without | |
48 | preprocessing. | |
49 | ||
50 | %description -l pl.UTF-8 | |
1aebc93e | 51 | Camlp5 jest preprocesorem OCamla. Oferuje narzędzia do manipulowania |
170a6c18 JR |
52 | składnią (gramatyki) oraz możliwość modyfikowania oryginalnej składni |
53 | języka (cytowania, rozszerzenia). | |
54 | ||
1aebc93e | 55 | Camlp5 może sparsować oryginalną składnię Ocamla lub dowolną inną |
170a6c18 JR |
56 | definiowalną przez użytkownika. Jako przykład podana jest alternatywna |
57 | składnia (revised syntax), która próbuje poprawić drobne problemy | |
58 | występujące w składni oryginalnej. | |
59 | ||
1aebc93e | 60 | Camlp5 umie ładnie formatować źródła zarówno w oryginalnej jak i |
170a6c18 JR |
61 | poprawionej składni OCamla. Potrafi także tłumaczyć programy z jednej |
62 | składni na drugą. | |
63 | ||
64 | %package doc-html | |
995febc4 JB |
65 | Summary: Objective Caml Preprocessor - HTML documentation |
66 | Summary(pl.UTF-8): Preprocesor OCamla - dokumentacja HTML | |
170a6c18 JR |
67 | Group: Development/Languages |
68 | ||
69 | %description doc-html | |
70 | Objective Caml Preprocessor - HTML documentation. | |
71 | ||
72 | %description doc-html -l pl.UTF-8 | |
73 | Preprocesor OCamla - dokumentacja HTML. | |
74 | ||
995febc4 JB |
75 | %package doc-pdf |
76 | Summary: Objective Caml Preprocessor - PDF documentation | |
77 | Summary(pl.UTF-8): Preprocesor OCamla - dokumentacja w formacie PDF | |
78 | Group: Development/Languages | |
79 | ||
80 | %description doc-pdf | |
81 | Objective Caml Preprocessor - PDF documentation. | |
82 | ||
83 | %description doc-pdf -l pl.UTF-8 | |
84 | Preprocesor OCamla - dokumentacja w formacie PDF. | |
85 | ||
170a6c18 | 86 | %prep |
7a1551a7 JR |
87 | %setup -q -n %{name}-rel%{version} |
88 | %patch0 -p1 | |
1ecd5f61 | 89 | %patch1 -p1 |
1aebc93e | 90 | |
7a1551a7 JR |
91 | %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+perl(\s|$),#!%{__perl}\1,' \ |
92 | etc/mkcamlp5.pl | |
170a6c18 | 93 | |
1ecd5f61 JB |
94 | %{__sed} -i -e 's/DEBUG=/&-ccopt "%{rpmcflags}" -cclib "%{rpmldflags}"/' config/Makefile.tpl |
95 | ||
995febc4 | 96 | %build |
170a6c18 | 97 | ./configure \ |
7a1551a7 | 98 | -prefix %{_prefix} \ |
170a6c18 | 99 | -bindir %{_bindir} \ |
6b574e5a | 100 | -libdir %{_libdir}/ocaml \ |
7a1551a7 | 101 | -mandir %{_mandir}/man1 |
170a6c18 | 102 | |
bfe7d50f | 103 | %{__make} -j1 world%{?with_ocaml_opt:.opt} |
1ecd5f61 | 104 | |
7a1551a7 | 105 | %{__make} -j1 -C doc/htmlp pdf |
170a6c18 JR |
106 | |
107 | %install | |
108 | rm -rf $RPM_BUILD_ROOT | |
170a6c18 JR |
109 | |
110 | %{__make} install \ | |
111 | BINDIR=$RPM_BUILD_ROOT%{_bindir} \ | |
6b574e5a | 112 | LIBDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml \ |
170a6c18 JR |
113 | MANDIR=$RPM_BUILD_ROOT%{_mandir} |
114 | ||
170a6c18 | 115 | # broken build system |
bfe7d50f JB |
116 | for f in mkcamlp5.1 ocpp5.1 camlp5o.1 camlp5r.1 camlp5sch.1 \ |
117 | %{?with_ocaml_opt:camlp5o.opt.1 camlp5r.opt.1 mkcamlp5.opt.1} ; do | |
118 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/$f | |
6b574e5a | 119 | echo '.so camlp5.1' >$RPM_BUILD_ROOT%{_mandir}/man1/$f |
170a6c18 JR |
120 | done |
121 | ||
122 | %clean | |
123 | rm -rf $RPM_BUILD_ROOT | |
124 | ||
125 | %files | |
126 | %defattr(644,root,root,755) | |
7a1551a7 | 127 | %doc CHANGES DEVEL ICHANGES MODE README.md UPGRADING |
1aebc93e JB |
128 | %attr(755,root,root) %{_bindir}/camlp5* |
129 | %attr(755,root,root) %{_bindir}/mkcamlp5* | |
130 | %attr(755,root,root) %{_bindir}/ocpp5 | |
6b574e5a | 131 | %{_libdir}/ocaml/%{name} |
1aebc93e JB |
132 | %{_mandir}/man1/camlp5*.1* |
133 | %{_mandir}/man1/mkcamlp5*.1* | |
134 | %{_mandir}/man1/ocpp5.1* | |
170a6c18 JR |
135 | |
136 | %files doc-html | |
137 | %defattr(644,root,root,755) | |
6b574e5a | 138 | %doc doc/html/* |
995febc4 JB |
139 | |
140 | %files doc-pdf | |
141 | %defattr(644,root,root,755) | |
7a1551a7 | 142 | %doc doc/htmlp/camlp5.pdf |