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