]> git.pld-linux.org Git - packages/llvm.git/blob - llvm.spec
57a76ac3d920b29391a53604fd3e77238681e7d6
[packages/llvm.git] / llvm.spec
1 # TODO:
2 # - move and package:
3 #       %{_datadir}/clang/clang-format-sublime.py - sublime plugin
4 #       %{_datadir}/clang/clang-format.el - emacs mode
5 #       %{_datadir}/clang/clang-format.py - vim plugin
6 # - no content in doc package (it used to contain parts of clang apidocs and some examples)
7 # - system isl in polly?
8 #
9 # Conditional build:
10 %bcond_without  lldb            # LLDB debugger
11 %bcond_without  polly           # Polly cache-locality optimization, auto-parallelism and vectorization
12 %bcond_without  rt              # compiler-rt libraries
13 %bcond_without  multilib        # compiler-rt multilib libraries
14 %bcond_without  ocaml           # OCaml binding
15 %bcond_without  doc             # HTML docs and man pages
16 %bcond_with     apidocs         # doxygen docs (HUGE, so they are not built by default)
17 %bcond_with     tests           # run tests
18
19 # No ocaml on other arches or no native ocaml (required for ocaml-ctypes)
20 %ifnarch %{ix86} %{x8664} arm aarch64 ppc sparc sparcv9
21 %undefine       with_ocaml
22 %endif
23
24 Summary:        The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
25 Summary(pl.UTF-8):      Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
26 Name:           llvm
27 Version:        3.9.1
28 Release:        3.2
29 License:        University of Illinois/NCSA Open Source License
30 Group:          Development/Languages
31 #Source0Download: http://llvm.org/releases/download.html
32 Source0:        http://llvm.org/releases/%{version}/%{name}-%{version}.src.tar.xz
33 # Source0-md5:  3259018a7437e157f3642df80f1983ea
34 Source1:        http://llvm.org/releases/%{version}/cfe-%{version}.src.tar.xz
35 # Source1-md5:  45713ec5c417ed9cad614cd283d786a1
36 Source2:        http://llvm.org/releases/%{version}/compiler-rt-%{version}.src.tar.xz
37 # Source2-md5:  aadc76e7e180fafb10fb729444e287a3
38 Source3:        http://llvm.org/releases/%{version}/lldb-%{version}.src.tar.xz
39 # Source3-md5:  91399402f287d3f637db1207113deecb
40 Source4:        http://llvm.org/releases/%{version}/polly-%{version}.src.tar.xz
41 # Source4-md5:  2cc7fe2bd9539775ba140abfd375bec6
42 Source5:        http://llvm.org/releases/%{version}/clang-tools-extra-%{version}.src.tar.xz
43 # Source5-md5:  1a01d545a064fcbc46a2f05f6880d3d7
44 Source6:        http://llvm.org/releases/%{version}/lld-%{version}.src.tar.xz
45 # Source6-md5:  6254dd138e23b098df4ef7840c11e2c8
46 Patch0:         %{name}-lld-link.patch
47 Patch1:         %{name}-pld.patch
48 Patch2:         libdir.patch
49 Patch3:         x32-gcc-toolchain.patch
50 Patch4:         cmake-buildtype.patch
51 Patch5:         %{name}-ocaml-shared.patch
52 URL:            http://llvm.org/
53 BuildRequires:  bash
54 BuildRequires:  bison
55 BuildRequires:  cmake >= 3.4.3
56 BuildRequires:  flex
57 BuildRequires:  gcc >= 5:3.4
58 # gcc4 might be installed, but not current __cc
59 %if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4"
60 BuildRequires:  __cc >= 3.4
61 %endif
62 %ifarch x32
63 BuildRequires:  glibc-devel(x86_64)
64 %endif
65 BuildRequires:  groff
66 BuildRequires:  libedit-devel
67 BuildRequires:  libltdl-devel
68 BuildRequires:  libstdc++-devel >= 5:3.4
69 BuildRequires:  ncurses-devel
70 %if %{with ocaml}
71 BuildRequires:  ocaml-ctypes-devel >= 0.4
72 BuildRequires:  ocaml-findlib
73 BuildRequires:  ocaml-ocamldoc
74 BuildRequires:  ocaml-ounit
75 %endif
76 BuildRequires:  perl-base >= 1:5.6
77 BuildRequires:  perl-tools-pod
78 BuildRequires:  python >= 1:2.7
79 BuildRequires:  rpm-pythonprov
80 %{?with_doc:BuildRequires:      sphinx-pdg}
81 BuildRequires:  tar >= 1:1.22
82 BuildRequires:  xz
83 BuildRequires:  zlib-devel
84 %if %{with apidocs}
85 BuildRequires:  doxygen
86 BuildRequires:  graphviz
87 %endif
88 %if %{with tests}
89 BuildRequires:  dejagnu
90 BuildRequires:  tcl-devel
91 %endif
92 %if %{with rt} && %{with multilib}
93 %ifarch %{x8664}
94 BuildRequires:  gcc-c++-multilib-32
95 BuildRequires:  libstdc++-multilib-32-devel
96 %endif
97 %ifarch x32
98 BuildRequires: gcc-c++-multilib-32
99 BuildRequires: libstdc++-multilib-32-devel
100 BuildRequires: gcc-c++-multilib-64
101 BuildRequires: libstdc++-multilib-64-devel
102 %endif
103 %endif
104 %if %{with lldb}
105 BuildRequires:  epydoc
106 %ifarch i386 i486
107 BuildRequires:  libatomic-devel
108 %endif
109 BuildRequires:  libxml2-devel >= 2
110 BuildRequires:  ncurses-ext-devel
111 BuildRequires:  python-devel >= 2
112 BuildRequires:  swig-python
113 %endif
114 %if %{with polly}
115 #BuildRequires: gmp-devel or imath-devel (private copy in polly/lib/External/isl/imath)
116 # private copy in polly/lib/External/isl
117 #BuildRequires: isl-devel >= 0.17.1
118 #TODO (bcond): cuda-devel (with POLLY_ENABLE_GPGPU_CODEGEN=ON)
119 %endif
120 %if %{with ocaml}
121 BuildConflicts: llvm-ocaml
122 %endif
123 Requires:       %{name}-libs = %{version}-%{release}
124 # LLVM is not supported on PPC64
125 # http://llvm.org/bugs/show_bug.cgi?id=3729
126 ExcludeArch:    ppc64
127 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
128
129 %define         abi     3.9
130 %define         _sysconfdir     /etc/%{name}
131
132 %define         specflags_ppc   -fno-var-tracking-assignments
133 # ix86 and x32 - the same issue as https://llvm.org/bugs/show_bug.cgi?id=27237
134 %define         specflags_ia32  -gsplit-dwarf
135 %define         specflags_x32   -gsplit-dwarf
136
137 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
138 %define         _noautostrip    .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
139
140 # clang doesn't know -fvar-tracking-assignments, and leaving it here would pollute llvm-config
141 # -Werror=format-security is for swig
142 # TODO: add - -Werror=format-security to tools/lldb/scripts/LLDBWrapPython.cpp
143 %define         filterout_c     -fvar-tracking-assignments
144 %define         filterout_cxx   -fvar-tracking-assignments -Werror=format-security
145 %define         filterout_ccpp  -fvar-tracking-assignments
146
147 # std::__once_call, std::__once_callable non-function symbols
148 %define         skip_post_check_so      liblldb.so.*
149
150 %description
151 LLVM is a compiler infrastructure designed for compile-time,
152 link-time, runtime, and idle-time optimization of programs from
153 arbitrary programming languages. LLVM is written in C++ and has been
154 developed since 2000 at the University of Illinois and Apple. It
155 currently supports compilation of C and C++ programs using clang
156 frontend.
157
158 %description -l pl.UTF-8
159 LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
160 czasu kompilowania, linkowania, działania i bezczynności programów w
161 dowolnych językach programowania. Jest napisana w C++, rozwijana od
162 roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
163 kompilację programów w C i C++ przy użyciu frontendu clang.
164
165 %package libs
166 Summary:        LLVM shared libraries
167 Summary(pl.UTF-8):      Biblioteki współdzielone LLVM-a
168 Group:          Libraries
169 Conflicts:      llvm < 3.2
170
171 %description libs
172 LLVM shared libraries.
173
174 %description libs -l pl.UTF-8
175 Biblioteki współdzielone LLVM-a.
176
177 %package devel
178 Summary:        Static libraries and header files for LLVM
179 Summary(pl.UTF-8):      Biblioteki statyczne i pliki nagłówkowe dla LLVM-a
180 Group:          Development/Languages
181 Requires:       %{name}-libs = %{version}-%{release}
182 Requires:       libstdc++-devel >= 6:3.4
183
184 %description devel
185 This package contains static libraries and header files needed to
186 develop new native programs that use the LLVM infrastructure.
187
188 %description devel -l pl.UTF-8
189 Ten pakiet zawiera biblioteki statyczne oraz pliki nagłówkowe
190 potrzebne do tworzenia nowych programów natywnych wykorzystujących
191 infrastrukturę LLVM.
192
193 %package doc
194 Summary:        Documentation for LLVM
195 Summary(pl.UTF-8):      Dokumentacja do LLVM-a
196 Group:          Documentation
197 # does not require base
198
199 %description doc
200 Documentation for the LLVM compiler infrastructure.
201
202 %description doc -l pl.UTF-8
203 Dokumentacja do infrastruktury kompilatorów LLVM.
204
205 %package apidocs
206 Summary:        API documentation for LLVM
207 Summary(pl.UTF-8):      Dokumentacja API LLVM-a
208 Group:          Development/Languages
209 Requires:       %{name}-doc = %{version}-%{release}
210
211 %description apidocs
212 API documentation for the LLVM compiler infrastructure.
213
214 %description apidocs -l pl.UTF-8
215 Dokumentacja API infrastruktury kompilatorów LLVM.
216
217 %package polly
218 Summary:        Polyhedral optimizations for LLVM
219 Summary(pl.UTF-8):      Optymalizacje wielościanowe dla LLVM-a
220 Group:          Development/Tools
221 URL:            http://polly.llvm.org/
222 Requires:       %{name} = %{version}-%{release}
223
224 %description polly
225 Polly is a high-level loop and data-locality optimizer and
226 optimization infrastructure for LLVM. It uses an abstract mathematical
227 representation based on integer polyhedra to analyze and optimize the
228 memory access pattern of a program.
229
230 %description polly -l pl.UTF-8
231 Polly to wysokopoziomowy optymalizator i infrastruktura LLVM-a do
232 optymalizacji pętli i położenia danych. Wykorzystuje abstrakcyjną
233 reprezentację matematyczną opartą na wielościanach całkowitoliczbowych
234 do analizy i optymalizacji wzorców dostępu do pamięci przez program.
235
236 %package polly-devel
237 Summary:        Header files for LLVM Polly optimization infrastructure
238 Summary(pl.UTF-8):      Pliki nagłówkowe infrastruktury optymalizacji LLVM-a Polly
239 Group:          Development/Libraries
240 URL:            http://polly.llvm.org/
241 Requires:       %{name}-devel = %{version}-%{release}
242 Requires:       %{name}-polly = %{version}-%{release}
243
244 %description polly-devel
245 Header files for LLVM Polly optimization infrastructure.
246
247 %description polly-devel -l pl.UTF-8
248 Pliki nagłówkowe infrastruktury optymalizacji LLVM-a Polly.
249
250 %package -n clang
251 Summary:        A C language family frontend for LLVM
252 Summary(pl.UTF-8):      Frontend LLVM-a do języków z rodziny C
253 License:        NCSA
254 Group:          Development/Languages
255 Requires:       %{name} = %{version}-%{release}
256 Requires:       clang-libs = %{version}-%{release}
257
258 %description -n clang
259 clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
260 of a crane or goose. 3. C-language family front-end toolkit.
261
262 The goal of the Clang project is to create a new C, C++, Objective C
263 and Objective C++ front-end for the LLVM compiler. Its tools are built
264 as libraries and designed to be loosely-coupled and extendable.
265
266 %description -n clang -l pl.UTF-8
267 clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
268 piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
269 z rodziny C.
270
271 Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
272 LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
273 budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
274 i rozszerzaniu.
275
276 %package -n clang-libs
277 Summary:        Clang shared libraries
278 Summary(pl.UTF-8):      Biblioteki współdzielone Clanga
279 Group:          Libraries
280
281 %description -n clang-libs
282 Clang shared libraries.
283
284 %description -n clang-libs -l pl.UTF-8
285 Biblioteki współdzielone Clanga.
286
287 %package -n clang-multilib
288 Summary:        A C language family frontend for LLVM - 32-bit support
289 Summary(pl.UTF-8):      Frontend LLVM-a do języków z rodziny C - obsługa binariów 32-bitowych
290 License:        NCSA
291 Group:          Development/Languages
292 Requires:       clang = %{version}-%{release}
293
294 %description -n clang-multilib
295 clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
296 of a crane or goose. 3. C-language family front-end toolkit.
297
298 The goal of the Clang project is to create a new C, C++, Objective C
299 and Objective C++ front-end for the LLVM compiler. Its tools are built
300 as libraries and designed to be loosely-coupled and extendable.
301
302 This package contains the C compiler support for producing 32-bit
303 programs on 64-bit host.
304
305 %description -n clang-multilib -l pl.UTF-8
306 clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
307 piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
308 z rodziny C.
309
310 Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
311 LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
312 budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
313 i rozszerzaniu.
314
315 Ten pakiet zawiera rozszerzenie kompilatora C o obsługę tworzenia
316 programów 32-bitowych na maszynie 64-bitowej.
317
318 %package -n clang-analyzer
319 Summary:        A source code analysis framework
320 Summary(pl.UTF-8):      Szkielet do analizy kodu źródłowego
321 License:        NCSA
322 Group:          Development/Languages
323 Requires:       clang = %{version}-%{release}
324 # not picked up automatically since files are currently not instaled
325 # in standard Python hierarchies yet
326 Requires:       python
327
328 %description -n clang-analyzer
329 The Clang Static Analyzer consists of both a source code analysis
330 framework and a standalone tool that finds bugs in C and Objective-C
331 programs. The standalone tool is invoked from the command-line, and is
332 intended to run in tandem with a build of a project or code base.
333
334 %description -n clang-analyzer -l pl.UTF-8
335 Clang Static Analyzer składa się ze szkieletu do analizy kodu
336 źródłowego oraz samodzielnego narzędzia znajdującego błędy w
337 programach w C i C++. Narzędzie jest wywoływane z linii poleceń, z
338 myślą o uruchamianiu wraz z kompilacją projektu lub kodu.
339
340 %package -n clang-devel
341 Summary:        Header files for Clang
342 Summary(pl.UTF-8):      Pliki nagłówkowe Clanga
343 Group:          Development/Languages
344 Requires:       %{name}-devel = %{version}-%{release}
345 Requires:       clang = %{version}-%{release}
346
347 %description -n clang-devel
348 This package contains header files for the Clang compiler.
349
350 %description -n clang-devel -l pl.UTF-8
351 Ten pakiet zawiera pliki nagłówkowe kompilatora Clang.
352
353 %package -n clang-doc
354 Summary:        Documentation for Clang
355 Summary(pl.UTF-8):      Dokumentacja do Clanga
356 Group:          Documentation
357 Requires:       %{name} = %{version}-%{release}
358
359 %description -n clang-doc
360 Documentation for the Clang compiler front-end.
361
362 %description -n clang-doc -l pl.UTF-8
363 Dokumentacja do frontendu kompilatora Clang.
364
365 %package -n clang-apidocs
366 Summary:        API documentation for Clang
367 Summary(pl.UTF-8):      Dokumentacja API Clanga
368 Group:          Development/Languages
369 Requires:       clang-doc = %{version}-%{release}
370
371 %description -n clang-apidocs
372 API documentation for the Clang compiler.
373
374 %description -n clang-apidocs -l pl.UTF-8
375 Dokumentacja API kompilatora Clang.
376
377 %package -n clang-tools-extra
378 Summary:        Extra tools for Clang
379 Summary(pl.UTF-8):      Dodatkowe narzędzia do kompilatora Clang
380 Group:          Development/Tools
381 URL:            http://clang.llvm.org/docs/ClangTools.html
382 Requires:       clang = %{version}-%{release}
383
384 %description -n clang-tools-extra
385 Extra tools for Clang.
386
387 %description -n clang-tools-extra -l pl.UTF-8
388 Dodatkowe narzędzia do kompilatora Clang.
389
390 %package -n lld
391 Summary:        The LLVM linker
392 Summary(pl.UTF-8):      Konsolidator z projektu LLVM
393 Group:          Development/Libraries
394 URL:            http://lld.llvm.org/
395 Requires:       %{name} = %{version}-%{release}
396
397 %description -n lld
398 lld is a new set of modular code for creating linker tools.
399
400 %description -n lld -l pl.UTF-8
401 lld to nowy zbiór modularnego kodu do tworzenia narzędzi
402 konsolidujących.
403
404 %package -n lld-devel
405 Summary:        Development files for LLD linker tools
406 Summary(pl.UTF-8):      Pliki programistyczne narzędzi konsolidujących LLD
407 Group:          Development/Tools
408 URL:            http://lld.llvm.org/
409 Requires:       %{name}-devel = %{version}-%{release}
410
411 %description -n lld-devel
412 Development files for LLD linker tools.
413
414 %description -n lld-devel -l pl.UTF-8
415 Pliki programistyczne narzędzi konsolidujących LLD.
416
417 %package -n lldb
418 Summary:        Next generation high-performance debugger
419 Summary(pl.UTF-8):      Wydajny debugger nowej generacji
420 Group:          Development/Debuggers
421 URL:            http://lldb.llvm.org/
422 Requires:       %{name} = %{version}-%{release}
423 Requires:       python-six
424
425 %description -n lldb
426 LLDB is a next generation, high-performance debugger. It is built as a
427 set of reusable components which highly leverage existing libraries in
428 the larger LLVM Project, such as the Clang expression parser and LLVM
429 disassembler.
430
431 %description -n lldb -l pl.UTF-8
432 LLDB to wydajny debugger nowej generacji. Jest zbudowany w oparciu o
433 komponenty wielokrotnego użytku, wykorzystujące istniejące biblioteki
434 w projekcie LLVM, takie jak analizator wyrażeń kompilatora Clang oraz
435 disasembler LLVM.
436
437 %package -n lldb-devel
438 Summary:        Development files for LLDB debugger
439 Summary(pl.UTF-8):      Pliki programistyczne debuggera LLDB
440 Group:          Development/Libraries
441 URL:            http://lldb.llvm.org/
442 Requires:       %{name}-devel = %{version}-%{release}
443 Requires:       clang-devel = %{version}-%{release}
444 Requires:       lldb = %{version}-%{release}
445
446 %description -n lldb-devel
447 Development files for LLDB debugger.
448
449 %description -n lldb-devel -l pl.UTF-8
450 Pliki programistyczne debuggera LLDB.
451
452 %package ocaml
453 Summary:        OCaml binding for LLVM
454 Summary(pl.UTF-8):      Wiązanie OCamla do LLVM-a
455 Group:          Libraries
456 Requires:       %{name} = %{version}-%{release}
457 %if %{with ocaml}
458 %requires_eq    ocaml-runtime
459 %endif
460
461 %description ocaml
462 OCaml binding for LLVM.
463
464 %description ocaml -l pl.UTF-8
465 Wiązanie OCamla do LLVM-a.
466
467 %package ocaml-devel
468 Summary:        Development files for LLVM OCaml binding
469 Summary(pl.UTF-8):      Pliki programistyczne wiązania OCamla do LLVM-a
470 Group:          Development/Libraries
471 Requires:       %{name}-devel = %{version}-%{release}
472 Requires:       %{name}-ocaml = %{version}-%{release}
473
474 %description ocaml-devel
475 The llvm-ocaml-devel package contains libraries and signature files
476 for developing applications that use llvm-ocaml binding.
477
478 %description ocaml-devel -l pl.UTF-8
479 Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji
480 wykorzystujących wiązanie llvm-ocaml.
481
482 %package ocaml-doc
483 Summary:        Documentation for LLVM's OCaml binding
484 Summary(pl.UTF-8):      Dokumentacja wiązania OCamla do LLVM-a
485 Group:          Documentation
486 Requires:       %{name}-ocaml = %{version}-%{release}
487
488 %description ocaml-doc
489 HTML documentation for LLVM's OCaml binding.
490
491 %description ocaml-doc -l pl.UTF-8
492 Dokumentacja HTML wiązania OCamla do LLVM-a.
493
494 %prep
495 %setup -q -n %{name}-%{version}.src -a1 %{?with_rt:-a2} %{?with_lldb:-a3} %{?with_polly:-a4} -a5 -a6
496 %{__mv} cfe-%{version}.src tools/clang
497 %{?with_rt:mv compiler-rt-%{version}.src projects/compiler-rt}
498 %{?with_lldb:mv lldb-%{version}.src tools/lldb}
499 %{?with_polly:mv polly-%{version}.src tools/polly}
500 %{__mv} clang-tools-extra-%{version}.src tools/clang/tools/extra
501 %{__mv} lld-%{version}.src tools/lld
502
503 %patch0 -p1
504 %patch1 -p1
505 %patch2 -p1
506 %patch3 -p1
507 %patch4 -p1
508 %patch5 -p1
509
510 grep -rl /usr/bin/env tools utils | xargs sed -i -e '1{
511         s,^#!.*bin/env python,#!%{__python},
512         s,^#!.*bin/env perl,#!%{__perl},
513 }'
514
515 %build
516 install -d build
517
518 # Disabling assertions now, rec. by pure and needed for OpenGTL
519 # TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
520 cd build
521 CPPFLAGS="%{rpmcppflags} -D_FILE_OFFSET_BITS=64"
522
523 %cmake \
524 %ifarch %{x8664}
525         -DLLVM_LIBDIR_SUFFIX:STRING=64 \
526 %endif
527 %ifarch x32
528         -DLLVM_LIBDIR_SUFFIX:STRING=x32 \
529 %endif
530 %if %{with apidocs}
531         -DLLVM_ENABLE_DOXYGEN:BOOL=ON \
532 %endif
533 %if %{with doc}
534         -DLLVM_ENABLE_SPHINX:BOOL=ON \
535         -DSPHINX_WARNINGS_AS_ERRORS=OFF \
536 %endif
537         -DLLVM_ENABLE_PIC:BOOL=ON \
538         -DLLVM_ENABLE_ASSERTIONS:BOOL=OFF \
539         -DLLVM_ENABLE_CXX1Y:BOOL=ON \
540         -DLLVM_BINDINGS_LIST:LIST="%{?with_ocaml:ocaml}" \
541         -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
542         -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
543         -DBUILD_SHARED_LIBS:BOOL=OFF \
544         -DENABLE_LINKER_BUILD_ID:BOOL=ON \
545         -DLLVM_BINUTILS_INCDIR:STRING=%{_includedir} \
546         ../
547
548 %{__make} \
549         VERBOSE=1 \
550         REQUIRES_RTTI=1 \
551         OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
552
553 %if %{with tests}
554 %{__make} check 2>&1 | tee llvm-testlog.txt
555 %{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt
556 %endif
557
558 %if %{with doc}
559 %{__make} -C docs docs-llvm-html
560 %{__make} -C docs docs-llvm-man
561 %if %{with ocaml}
562 %{__make} -C docs ocaml_doc
563 %endif
564 %{__make} -C tools/clang/docs docs-clang-html
565 %{__make} -C tools/clang/docs docs-clang-man
566 %{__make} -C tools/lld/docs docs-lld-html
567 %{__make} -C tools/lldb/docs lldb-python-doc
568 %{__make} -C tools/lldb/docs lldb-cpp-doc
569 %endif
570
571 %install
572 rm -rf $RPM_BUILD_ROOT
573 %{__make} -C build install \
574         DESTDIR=$RPM_BUILD_ROOT
575
576 # only some .pyc files are created by make install
577 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
578 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
579
580 # Adjust static analyzer installation
581 # http://clang-analyzer.llvm.org/installation#OtherPlatforms
582 install -d $RPM_BUILD_ROOT%{_libdir}/scan-build
583 %{__mv} $RPM_BUILD_ROOT%{_prefix}/libexec/c??-analyzer $RPM_BUILD_ROOT%{_libdir}/scan-build
584 %{__sed} -i -e 's,/\.\./libexec/,/../%{_lib}/scan-build/,' $RPM_BUILD_ROOT%{_bindir}/scan-build
585 %py_comp $RPM_BUILD_ROOT%{_datadir}/scan-view
586 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/scan-view
587 %py_postclean %{_datadir}/scan-view
588
589 # not installed by cmake buildsystem
590 install build/bin/pp-trace $RPM_BUILD_ROOT%{_bindir}
591
592 %if %{with doc}
593 cp -p build/docs/man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
594 # these tools are not installed
595 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{FileCheck,llvm-build}.1
596 # make links
597 echo '.so llvm-ar.1' > $RPM_BUILD_ROOT%{_mandir}/man1/llvm-ranlib.1
598 %endif
599
600 # Move documentation back to build directory
601 %if %{with ocaml}
602 rm -rf ocamldocs
603 %{__mv} $RPM_BUILD_ROOT%{_prefix}/docs/ocaml/html/html ocamldocs
604 %endif
605
606 # and separate the apidoc
607 %if %{with apidocs}
608 rm -rf clang-apidoc
609 cp -a build/tools/clang/docs/html clang-apidoc
610 %endif
611
612 # And prepare Clang documentation
613 rm -rf clang-docs
614 install -d clang-docs
615 for f in LICENSE.TXT NOTES.txt README.txt; do
616         ln tools/clang/$f clang-docs
617 done
618
619 # Get rid of erroneously installed example files.
620 %{__rm} $RPM_BUILD_ROOT%{_libdir}/LLVMHello.so
621 # test?
622 %{__rm} $RPM_BUILD_ROOT%{_bindir}/{c-index-test,llvm-c-test}
623 # not this OS
624 %{__rm} $RPM_BUILD_ROOT%{_datadir}/clang/clang-format-bbedit.applescript
625 # use system six
626 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/six.py*
627 # it seems it is used internally by an extra clang tool
628 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libfindAllSymbols.a
629
630 %clean
631 rm -rf $RPM_BUILD_ROOT
632
633 %post   libs -p /sbin/ldconfig
634 %postun libs -p /sbin/ldconfig
635
636 %post   -n clang -p /sbin/ldconfig
637 %postun -n clang -p /sbin/ldconfig
638
639 %post   -n lldb -p /sbin/ldconfig
640 %postun -n lldb -p /sbin/ldconfig
641
642 %files
643 %defattr(644,root,root,755)
644 %doc CREDITS.TXT LICENSE.TXT README.txt %{?with_tests:llvm-testlog.txt}
645 %attr(755,root,root) %{_bindir}/bugpoint
646 %attr(755,root,root) %{_bindir}/llc
647 %attr(755,root,root) %{_bindir}/lli
648 %attr(755,root,root) %{_bindir}/llvm-ar
649 %attr(755,root,root) %{_bindir}/llvm-as
650 %attr(755,root,root) %{_bindir}/llvm-bcanalyzer
651 %attr(755,root,root) %{_bindir}/llvm-cov
652 %attr(755,root,root) %{_bindir}/llvm-diff
653 %attr(755,root,root) %{_bindir}/llvm-dis
654 %attr(755,root,root) %{_bindir}/llvm-dsymutil
655 %attr(755,root,root) %{_bindir}/llvm-dwarfdump
656 %attr(755,root,root) %{_bindir}/llvm-dwp
657 %attr(755,root,root) %{_bindir}/llvm-extract
658 %attr(755,root,root) %{_bindir}/llvm-lib
659 %attr(755,root,root) %{_bindir}/llvm-link
660 %attr(755,root,root) %{_bindir}/llvm-lto
661 %attr(755,root,root) %{_bindir}/llvm-mc
662 %attr(755,root,root) %{_bindir}/llvm-mcmarkup
663 %attr(755,root,root) %{_bindir}/llvm-nm
664 %attr(755,root,root) %{_bindir}/llvm-objdump
665 %attr(755,root,root) %{_bindir}/llvm-profdata
666 %attr(755,root,root) %{_bindir}/llvm-ranlib
667 %attr(755,root,root) %{_bindir}/llvm-readobj
668 %attr(755,root,root) %{_bindir}/llvm-rtdyld
669 %attr(755,root,root) %{_bindir}/llvm-size
670 %attr(755,root,root) %{_bindir}/llvm-split
671 %attr(755,root,root) %{_bindir}/llvm-stress
672 %attr(755,root,root) %{_bindir}/llvm-symbolizer
673 %attr(755,root,root) %{_bindir}/llvm-tblgen
674 %attr(755,root,root) %{_bindir}/llvm-cxxdump
675 %attr(755,root,root) %{_bindir}/llvm-pdbdump
676 %attr(755,root,root) %{_bindir}/obj2yaml
677 %attr(755,root,root) %{_bindir}/opt
678 %attr(755,root,root) %{_bindir}/sancov
679 %attr(755,root,root) %{_bindir}/sanstats
680 %attr(755,root,root) %{_bindir}/verify-uselistorder
681 %attr(755,root,root) %{_bindir}/yaml2obj
682 %if %{with doc}
683 %{_mandir}/man1/bugpoint.1*
684 %{_mandir}/man1/lit.1*
685 %{_mandir}/man1/llc.1*
686 %{_mandir}/man1/lli.1*
687 %{_mandir}/man1/llvm-ar.1*
688 %{_mandir}/man1/llvm-as.1*
689 %{_mandir}/man1/llvm-bcanalyzer.1*
690 %{_mandir}/man1/llvm-cov.1*
691 %{_mandir}/man1/llvm-diff.1*
692 %{_mandir}/man1/llvm-dis.1*
693 %{_mandir}/man1/llvm-dwarfdump.1*
694 %{_mandir}/man1/llvm-extract.1*
695 %{_mandir}/man1/llvm-lib.1*
696 %{_mandir}/man1/llvm-link.1*
697 %{_mandir}/man1/llvm-nm.1*
698 %{_mandir}/man1/llvm-profdata.1*
699 %{_mandir}/man1/llvm-ranlib.1*
700 %{_mandir}/man1/llvm-readobj.1*
701 %{_mandir}/man1/llvm-stress.1*
702 %{_mandir}/man1/llvm-symbolizer.1*
703 %{_mandir}/man1/opt.1*
704 %{_mandir}/man1/tblgen.1*
705 %endif
706
707 %files libs
708 %defattr(644,root,root,755)
709 %attr(755,root,root) %{_libdir}/libLLVM-%{abi}.so
710 # non-soname symlink
711 %attr(755,root,root) %{_libdir}/libLLVM-%{version}.so
712 %attr(755,root,root) %{_libdir}/libLTO.so
713 %attr(755,root,root) %{_libdir}/LLVMgold.so
714
715 %files devel
716 %defattr(644,root,root,755)
717 %attr(755,root,root) %{_bindir}/llvm-config
718 %attr(755,root,root) %{_libdir}/libLLVM.so
719 %attr(755,root,root) %{_libdir}/BugpointPasses.so
720 %{_libdir}/libLLVM*.a
721 %{_includedir}/llvm
722 %{_includedir}/llvm-c
723 %{_libdir}/cmake/llvm
724 %if %{with doc}
725 %{_mandir}/man1/llvm-config.1*
726 %endif
727
728 #%files doc
729 #%defattr(644,root,root,755)
730
731 %if %{with apidocs}
732 %files apidocs
733 %defattr(644,root,root,755)
734 %doc apidoc/*
735 %endif
736
737 %if %{with polly}
738 %files polly
739 %defattr(644,root,root,755)
740 %doc tools/polly/{CREDITS.txt,LICENSE.txt,README} tools/polly/www/{bugs,changelog,contributors}.html
741 %attr(755,root,root) %{_libdir}/LLVMPolly.so
742
743 %files polly-devel
744 %defattr(644,root,root,755)
745 %{_libdir}/libPolly.a
746 %{_libdir}/libPollyISL.a
747 %{_libdir}/libPollyPPCG.a
748 %{_includedir}/polly
749 %endif
750
751 %files -n clang
752 %defattr(644,root,root,755)
753 %doc clang-docs/{LICENSE.TXT,NOTES.txt,README.txt} %{?with_tests:clang-testlog.txt}
754 %attr(755,root,root) %{_bindir}/clang
755 %attr(755,root,root) %{_bindir}/clang++
756 %attr(755,root,root) %{_bindir}/clang-%{abi}
757 %attr(755,root,root) %{_bindir}/clang-check
758 %attr(755,root,root) %{_bindir}/clang-cl
759 %attr(755,root,root) %{_bindir}/clang-format
760 %attr(755,root,root) %{_bindir}/git-clang-format
761 %dir %{_libdir}/clang
762 %dir %{_libdir}/clang/%{version}
763 %{_libdir}/clang/%{version}/include
764 %if %{with rt}
765 %ifarch %{ix86} %{x8664} x32
766 %dir %{_libdir}/clang/%{version}/lib
767 %dir %{_libdir}/clang/%{version}/lib/linux
768 %endif
769 %ifarch %{ix86}
770 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i*86.a
771 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i*86.so
772 %endif
773 %ifarch %{x8664}
774 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a
775 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.so
776 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a.syms
777 %endif
778 %ifarch %{ix86} %{x8664} x32 %{arm} aarch64 mips mips64 ppc64
779 %{_libdir}/clang/%{version}/asan_blacklist.txt
780 %endif
781 %ifarch %{ix86} %{x8664} x32 mips64
782 %{_libdir}/clang/%{version}/cfi_blacklist.txt
783 %endif
784 %ifarch %{x8664} x32 aarch64 mips64
785 %{_libdir}/clang/%{version}/dfsan_abilist.txt
786 %{_libdir}/clang/%{version}/msan_blacklist.txt
787 %endif
788 %endif
789 %dir %{_datadir}/clang
790 %{_datadir}/clang/clang-format-diff.py
791
792 %files -n clang-libs
793 %defattr(644,root,root,755)
794 %attr(755,root,root) %{_libdir}/libclang.so.%{abi}
795
796 %if %{with rt} && %{with multilib}
797 %ifarch %{x8664} x32
798 %files -n clang-multilib
799 %defattr(644,root,root,755)
800 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i386.a
801 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i386.so
802 %endif
803 %ifarch x32
804 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a
805 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.so
806 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a.syms
807 %endif
808 %endif
809
810 %files -n clang-analyzer
811 %defattr(644,root,root,755)
812 %attr(755,root,root) %{_bindir}/scan-build
813 %attr(755,root,root) %{_bindir}/scan-view
814 %{_datadir}/scan-build
815 %{_datadir}/scan-view
816 %{_mandir}/man1/scan-build.1*
817 %dir %{_libdir}/scan-build
818 %attr(755,root,root) %{_libdir}/scan-build/c++-analyzer
819 %attr(755,root,root) %{_libdir}/scan-build/ccc-analyzer
820
821 %files -n clang-devel
822 %defattr(644,root,root,755)
823 %attr(755,root,root) %{_libdir}/libclang.so
824 %{_libdir}/libclang*.a
825 %{_includedir}/clang
826 %{_includedir}/clang-c
827 %{_libdir}/cmake/clang
828
829 %files -n clang-doc
830 %defattr(644,root,root,755)
831 %doc tools/clang/docs/*.{html,png,txt}
832
833 %if %{with apidocs}
834 %files -n clang-apidocs
835 %defattr(644,root,root,755)
836 %doc clang-apidoc/*
837 %endif
838
839 %files -n clang-tools-extra
840 %defattr(644,root,root,755)
841 %doc tools/clang/tools/extra/{CODE_OWNERS.TXT,README.txt}
842 %attr(755,root,root) %{_bindir}/clang-apply-replacements
843 %attr(755,root,root) %{_bindir}/clang-include-fixer
844 %attr(755,root,root) %{_bindir}/clang-query
845 %attr(755,root,root) %{_bindir}/clang-rename
846 %attr(755,root,root) %{_bindir}/clang-tidy
847 %attr(755,root,root) %{_bindir}/find-all-symbols
848 %attr(755,root,root) %{_bindir}/modularize
849 %attr(755,root,root) %{_bindir}/pp-trace
850 %{_datadir}/clang/clang-include-fixer.py
851 %{_datadir}/clang/clang-tidy-diff.py
852 %{_datadir}/clang/run-clang-tidy.py
853 %{_datadir}/clang/run-find-all-symbols.py
854
855 %files -n lld
856 %defattr(644,root,root,755)
857 %doc tools/lld/{LICENSE.TXT,README.md}
858 %attr(755,root,root) %{_bindir}/ld.lld
859 %attr(755,root,root) %{_bindir}/lld
860 %attr(755,root,root) %{_bindir}/lld-link
861
862 %files -n lld-devel
863 %defattr(644,root,root,755)
864 %{_libdir}/liblld[ACDEHMRXY]*.a
865 %{_includedir}/lld
866
867 %if %{with lldb}
868 %files -n lldb
869 %defattr(644,root,root,755)
870 %attr(755,root,root) %{_bindir}/lldb
871 %attr(755,root,root) %{_bindir}/lldb-%{version}
872 %attr(755,root,root) %{_bindir}/lldb-argdumper
873 %attr(755,root,root) %{_bindir}/lldb-mi
874 %attr(755,root,root) %{_bindir}/lldb-mi-%{version}
875 %attr(755,root,root) %{_bindir}/lldb-server
876 %attr(755,root,root) %{_bindir}/lldb-server-%{version}
877 %attr(755,root,root) %{_libdir}/liblldb.so.%{version}
878 %dir %{py_sitedir}/lldb
879 %attr(755,root,root) %{py_sitedir}/lldb/lldb-argdumper
880 %{py_sitedir}/lldb/formatters
881 %{py_sitedir}/lldb/runtime
882 %{py_sitedir}/lldb/utils
883 %{py_sitedir}/lldb/__init__.py[co]
884 %{py_sitedir}/lldb/embedded_interpreter.py[co]
885 %attr(755,root,root) %{py_sitedir}/lldb/_lldb.so
886 %attr(755,root,root) %{py_sitedir}/readline.so
887
888 %files -n lldb-devel
889 %defattr(644,root,root,755)
890 %attr(755,root,root) %{_libdir}/liblldb.so
891 %{_libdir}/liblldb*.a
892 %{_includedir}/lldb
893 %endif
894
895 %if %{with ocaml}
896 %files ocaml
897 %defattr(644,root,root,755)
898 %{_libdir}/ocaml/META.llvm*
899 %attr(755,root,root) %{_libdir}/ocaml/dllllvm*.so
900 %{_libdir}/ocaml/llvm*.cma
901 %{_libdir}/ocaml/llvm*.cmi
902
903 %files ocaml-devel
904 %defattr(644,root,root,755)
905 %{_libdir}/ocaml/libllvm*.a
906 %{_libdir}/ocaml/llvm*.a
907 %{_libdir}/ocaml/llvm*.cmx*
908
909 %files ocaml-doc
910 %defattr(644,root,root,755)
911 %doc ocamldocs/*
912 %endif
This page took 0.079871 seconds and 2 git commands to generate.