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