]> git.pld-linux.org Git - packages/llvm.git/blame - llvm.spec
- updated to 3.0.
[packages/llvm.git] / llvm.spec
CommitLineData
bc88141a 1#
9556f4c9
ER
2# Conditional build:
3%bcond_without ocaml # ocaml binding
8132e62b
JB
4%bcond_with apidocs # The doxygen docs are HUGE, so they are not built by default.
5%bcond_with tests # run tests
9556f4c9
ER
6
7%ifarch s390 s390x sparc64
8# No ocaml on these arches
9%undefine with_ocaml
10%endif
11
aa11c230 12Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
2326a99f 13Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
aa11c230 14Name: llvm
a7973f21 15Version: 2.9
fa8d0ee8 16Release: 3
aa11c230 17License: University of Illinois/NCSA Open Source License
18Group: Development/Languages
7e30fbbc 19Source0: http://llvm.org/releases/%{version}/%{name}-%{version}.tgz
a7973f21 20# Source0-md5: 793138412d2af2c7c7f54615f8943771
9556f4c9 21Source1: http://llvm.org/releases/%{version}/clang-%{version}.tgz
a7973f21 22# Source1-md5: 634de18d04b7a4ded19ec4c17d23cfca
d997b14b
AM
23# Data files should be installed with timestamps preserved
24Patch3: %{name}-2.6-timestamp.patch
ce9cc204 25Patch4: %{name}-pld.patch
2326a99f 26URL: http://llvm.org/
bc88141a 27BuildRequires: bash
d997b14b 28BuildRequires: bison
d997b14b 29BuildRequires: flex
9556f4c9
ER
30%if %{with apidocs}
31BuildRequires: doxygen
d997b14b 32BuildRequires: graphviz
9556f4c9
ER
33%endif
34%if %{with tests}
35BuildRequires: dejagnu
36BuildRequires: python
37BuildRequires: tcl-devel
38%endif
d997b14b 39BuildRequires: groff
bc88141a 40BuildRequires: libltdl-devel
d997b14b
AM
41BuildRequires: libstdc++-devel >= 5:3.4
42BuildRequires: ocaml-ocamldoc
8132e62b 43BuildRequires: perl-base >= 1:5.6
8c156e7d 44BuildRequires: perl-tools-pod
45BuildRequires: rpm-pythonprov
356a0bbd
ER
46# gcc4 might be installed, but not current __cc
47%if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4"
48BuildRequires: __cc >= 3.4
49%endif
9556f4c9
ER
50# LLVM is not supported on PPC64
51# http://llvm.org/bugs/show_bug.cgi?id=3729
52ExcludeArch: ppc64
aa11c230 53BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54
356a0bbd 55%define _sysconfdir /etc/%{name}
021b3c3d 56
9556f4c9
ER
57%define specflags_ppc -fno-var-tracking-assignments
58
6832a5c5
ER
59# strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
60%define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
61
aa11c230 62%description
63LLVM is a compiler infrastructure designed for compile-time,
64link-time, runtime, and idle-time optimization of programs from
65arbitrary programming languages. LLVM is written in C++ and has been
66developed since 2000 at the University of Illinois and Apple. It
621ec11f
JB
67currently supports compilation of C and C++ programs using clang
68frontend.
aa11c230 69
2326a99f
JB
70%description -l pl.UTF-8
71LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
72czasu kompilowania, linkowania, działania i bezczynności programów w
73dowolnych językach programowania. Jest napisana w C++, rozwijana od
74roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
621ec11f 75kompilację programów w C i C++ przy użyciu frontendu clang.
2326a99f 76
bc88141a 77%package devel
621ec11f
JB
78Summary: Static libraries and header files for LLVM
79Summary(pl.UTF-8): Biblioteki statyczne i pliki nagłówkowe dla LLVM-a
bc88141a
ER
80Group: Development/Languages
81Requires: %{name} = %{version}-%{release}
82Requires: libstdc++-devel >= 6:3.4
83
84%description devel
621ec11f
JB
85This package contains static libraries and header files needed to
86develop new native programs that use the LLVM infrastructure.
87
88%description devel -l pl.UTF-8
89Ten pakiet zawiera biblioteki statyczne oraz pliki nagłówkowe
90potrzebne do tworzenia nowych programów natywnych wykorzystujących
91infrastrukturę LLVM.
bc88141a 92
9556f4c9
ER
93%package doc
94Summary: Documentation for LLVM
621ec11f 95Summary(pl.UTF-8): Dokumentacja do LLVM-a
9556f4c9
ER
96Group: Documentation
97# does not require base
bc88141a 98
9556f4c9
ER
99%description doc
100Documentation for the LLVM compiler infrastructure.
bc88141a 101
621ec11f
JB
102%description doc -l pl.UTF-8
103Dokumentacja do infrastruktury kompilatorów LLVM.
104
9556f4c9
ER
105%package apidocs
106Summary: API documentation for LLVM
621ec11f 107Summary(pl.UTF-8): Dokumentacja API LLVM-a
9556f4c9
ER
108Group: Development/Languages
109Requires: %{name}-doc = %{version}-%{release}
bc88141a 110
9556f4c9
ER
111%description apidocs
112API documentation for the LLVM compiler infrastructure.
bc88141a 113
621ec11f
JB
114%description apidocs -l pl.UTF-8
115Dokumentacja API infrastruktury kompilatorów LLVM.
116
d997b14b
AM
117%package -n clang
118Summary: A C language family frontend for LLVM
621ec11f 119Summary(pl.UTF-8): Frontend LLVM-a do języków z rodziny C
d997b14b
AM
120License: NCSA
121Group: Development/Languages
122
123%description -n clang
124clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
125of a crane or goose. 3. C-language family front-end toolkit.
126
127The goal of the Clang project is to create a new C, C++, Objective C
128and Objective C++ front-end for the LLVM compiler. Its tools are built
129as libraries and designed to be loosely-coupled and extendable.
130
621ec11f
JB
131%description -n clang -l pl.UTF-8
132clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
133piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
134z rodziny C.
135
136Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
137LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
138budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
139i rozszerzaniu.
140
d997b14b
AM
141%package -n clang-analyzer
142Summary: A source code analysis framework
621ec11f 143Summary(pl.UTF-8): Szkielet do analizy kodu źródłowego
d997b14b
AM
144License: NCSA
145Group: Development/Languages
146Requires: clang = %{version}-%{release}
147# not picked up automatically since files are currently not instaled
148# in standard Python hierarchies yet
149Requires: python
150
151%description -n clang-analyzer
152The Clang Static Analyzer consists of both a source code analysis
153framework and a standalone tool that finds bugs in C and Objective-C
154programs. The standalone tool is invoked from the command-line, and is
155intended to run in tandem with a build of a project or code base.
156
621ec11f
JB
157%description -n clang-analyzer -l pl.UTF-8
158Clang Static Analyzer składa się ze szkieletu do analizy kodu
159źródłowego oraz samodzielnego narzędzia znajdującego błędy w
160programach w C i C++. Narzędzie jest wywoływane z linii poleceń, z
161myślą o uruchamianiu wraz z kompilacją projektu lub kodu.
162
9556f4c9 163%package -n clang-devel
621ec11f
JB
164Summary: Header files for Clang
165Summary(pl.UTF-8): Pliki nagłówkowe Clanga
9556f4c9
ER
166Group: Development/Languages
167Requires: clang = %{version}-%{release}
168
169%description -n clang-devel
170This package contains header files for the Clang compiler.
171
621ec11f
JB
172%description -n clang-devel -l pl.UTF-8
173Ten pakiet zawiera pliki nagłówkowe kompilatora Clang.
174
9556f4c9
ER
175%package -n clang-doc
176Summary: Documentation for Clang
621ec11f 177Summary(pl.UTF-8): Dokumentacja do Clanga
9556f4c9
ER
178Group: Documentation
179Requires: %{name} = %{version}-%{release}
180
181%description -n clang-doc
182Documentation for the Clang compiler front-end.
183
621ec11f
JB
184%description -n clang-doc -l pl.UTF-8
185Dokumentacja do frontendu kompilatora Clang.
186
9556f4c9
ER
187%package -n clang-apidocs
188Summary: API documentation for Clang
621ec11f 189Summary(pl.UTF-8): Dokumentacja API Clanga
9556f4c9
ER
190Group: Development/Languages
191Requires: clang-doc = %{version}-%{release}
192
193%description -n clang-apidocs
194API documentation for the Clang compiler.
195
621ec11f
JB
196%description -n clang-apidocs -l pl.UTF-8
197Dokumentacja API kompilatora Clang.
198
9556f4c9
ER
199%package ocaml
200Summary: OCaml binding for LLVM
621ec11f
JB
201Summary(pl.UTF-8): Wiązanie OCamla do LLVM-a
202Group: Libraries
9556f4c9
ER
203Requires: %{name} = %{version}-%{release}
204%requires_eq ocaml-runtime
205
621ec11f 206%description ocaml
9556f4c9
ER
207OCaml binding for LLVM.
208
621ec11f
JB
209%description ocaml -l pl.UTF-8
210Wiązanie OCamla do LLVM-a.
211
9556f4c9 212%package ocaml-devel
621ec11f
JB
213Summary: Development files for LLVM OCaml binding
214Summary(pl.UTF-8): Pliki programistyczne wiązania OCamla do LLVM-a
9556f4c9
ER
215Group: Development/Libraries
216Requires: %{name}-devel = %{version}-%{release}
217Requires: %{name}-ocaml = %{version}-%{release}
218
219%description ocaml-devel
220The llvm-ocaml-devel package contains libraries and signature files
621ec11f
JB
221for developing applications that use llvm-ocaml binding.
222
223%description ocaml-devel -l pl.UTF-8
224Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji
225wykorzystujących wiązanie llvm-ocaml.
226
9556f4c9
ER
227
228%package ocaml-doc
229Summary: Documentation for LLVM's OCaml binding
621ec11f 230Summary(pl.UTF-8): Dokumentacja wiązania OCamla do LLVM-a
9556f4c9
ER
231Group: Documentation
232Requires: %{name}-ocaml = %{version}-%{release}
233
234%description ocaml-doc
235HTML documentation for LLVM's OCaml binding.
236
621ec11f
JB
237%description ocaml-doc -l pl.UTF-8
238Dokumentacja HTML wiązania OCamla do LLVM-a.
239
aa11c230 240%prep
d997b14b
AM
241%setup -q -a1
242mv clang-*.* tools/clang
9556f4c9 243%patch3 -p1
ce9cc204 244%patch4 -p1
245
246sed -i 's|triplet-plox-here|%{_host}|' tools/clang/lib/Driver/ToolChains.cpp
9556f4c9 247
19f21eee
PS
248# configure does not properly specify libdir
249sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}|g' Makefile.config.in
250
bacc8b96
ER
251grep -rl /usr/bin/env tools utils | xargs sed -i -e '1{
252 s,^#!.*bin/env python,#!%{__python},
253 s,^#!.*bin/env perl,#!%{__perl},
254}'
255
9556f4c9 256install -d obj
aa11c230 257
258%build
d997b14b 259# Disabling assertions now, rec. by pure and needed for OpenGTL
9556f4c9 260# TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
d997b14b 261#
bc88141a 262# bash specific 'test a < b'
9556f4c9 263cd obj
d997b14b 264bash ../%configure \
bc88141a
ER
265 --libdir=%{_libdir}/%{name} \
266 --datadir=%{_datadir}/%{name}-%{version} \
d997b14b
AM
267%ifarch %{ix86}
268 --enable-pic=no \
9556f4c9
ER
269%endif
270%if %{with apidocs}
271 --enable-doxygen \
d997b14b 272%endif
bc88141a 273 --disable-static \
d997b14b 274 --disable-assertions \
bc88141a
ER
275 --enable-debug-runtime \
276 --enable-jit \
aa11c230 277 --enable-optimized \
bc88141a
ER
278 --enable-shared \
279 --with-pic
280
d997b14b 281%{__make} \
0a0b7076 282 REQUIRES_RTTI=1 \
d997b14b 283 OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
aa11c230 284
9556f4c9
ER
285%if %{with test}
286%{__make} check 2>&1 | tee llvm-testlog.txt
287%{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt
288%endif
289
aa11c230 290%install
291rm -rf $RPM_BUILD_ROOT
9556f4c9 292%{__make} -C obj -j1 install \
d997b14b 293 PROJ_docsdir=/moredocs \
aa11c230 294 DESTDIR=$RPM_BUILD_ROOT
295
d997b14b 296# Static analyzer not installed by default:
9556f4c9
ER
297# http://clang-analyzer.llvm.org/installation#OtherPlatforms
298install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
d997b14b
AM
299# create launchers
300for f in scan-{build,view}; do
9556f4c9
ER
301 ln -s %{_libdir}/clang-analyzer/$f/$f $RPM_BUILD_ROOT%{_bindir}/$f
302 cp -pr tools/clang/tools/$f $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
d997b14b 303done
8132e62b
JB
304%py_comp $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-view
305%py_ocomp $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-view
306%py_postclean %{_libdir}/clang-analyzer/scan-view
d997b14b 307
d997b14b 308# Move documentation back to build directory
d997b14b
AM
309rm -rf moredocs
310mv $RPM_BUILD_ROOT/moredocs .
9556f4c9
ER
311rm -fv moredocs/*.tar.gz
312rm -fv moredocs/ocamldoc/html/*.tar.gz
313
314# and separate the apidoc
315%if %{with apidocs}
316rm -rf apidoc clang-apidoc
317mv moredocs/html/doxygen apidoc
318cp -a tools/clang/docs/doxygen/html clang-apidoc
319%endif
d997b14b
AM
320
321# And prepare Clang documentation
d997b14b 322rm -rf clang-docs
9556f4c9 323install -d clang-docs
d997b14b 324for f in LICENSE.TXT NOTES.txt README.txt TODO.txt; do
9556f4c9 325 ln tools/clang/$f clang-docs
d997b14b 326done
021b3c3d 327
6832a5c5 328# Get rid of erroneously installed example files.
19f21eee 329rm -v $RPM_BUILD_ROOT%{_libdir}/*LLVMHello.*
6832a5c5 330
d997b14b 331# FIXME file this bug
19f21eee 332sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}",' \
d997b14b 333 $RPM_BUILD_ROOT%{_bindir}/llvm-config
6832a5c5 334
d997b14b
AM
335# remove documentation makefiles:
336# they require the build directory to work
9556f4c9
ER
337rm -rf moredocs/examples
338cp -a examples moredocs/examples
339find moredocs/examples -name Makefile | xargs -0r rm -f
6832a5c5 340
aa11c230 341%clean
342rm -rf $RPM_BUILD_ROOT
343
2326a99f
JB
344%post -p /sbin/ldconfig
345%postun -p /sbin/ldconfig
aa11c230 346
347%files
348%defattr(644,root,root,755)
8132e62b 349%doc CREDITS.TXT LICENSE.TXT README.txt %{?with_tests:llvm-testlog.txt}
a9beeab5 350%attr(755,root,root) %{_bindir}/bugpoint
a9beeab5
JB
351%attr(755,root,root) %{_bindir}/llc
352%attr(755,root,root) %{_bindir}/lli
a8575aac 353%attr(755,root,root) %{_bindir}/llvmc
8132e62b
JB
354%attr(755,root,root) %{_bindir}/llvm-ar
355%attr(755,root,root) %{_bindir}/llvm-as
356%attr(755,root,root) %{_bindir}/llvm-bcanalyzer
357%attr(755,root,root) %{_bindir}/llvm-diff
358%attr(755,root,root) %{_bindir}/llvm-dis
359%attr(755,root,root) %{_bindir}/llvm-extract
360%attr(755,root,root) %{_bindir}/llvm-ld
361%attr(755,root,root) %{_bindir}/llvm-link
362%attr(755,root,root) %{_bindir}/llvm-mc
363%attr(755,root,root) %{_bindir}/llvm-nm
364%attr(755,root,root) %{_bindir}/llvm-objdump
365%attr(755,root,root) %{_bindir}/llvm-prof
366%attr(755,root,root) %{_bindir}/llvm-ranlib
367%attr(755,root,root) %{_bindir}/llvm-stub
a7973f21 368%attr(755,root,root) %{_bindir}/macho-dump
8132e62b
JB
369%attr(755,root,root) %{_bindir}/opt
370%attr(755,root,root) %{_libdir}/libLLVM-%{version}.so
a9beeab5 371%{_mandir}/man1/bugpoint.1*
a7973f21 372%{_mandir}/man1/lit.1*
a9beeab5
JB
373%{_mandir}/man1/llc.1*
374%{_mandir}/man1/lli.1*
8132e62b
JB
375%{_mandir}/man1/llvm-ar.1*
376%{_mandir}/man1/llvm-as.1*
377%{_mandir}/man1/llvm-bcanalyzer.1*
378%{_mandir}/man1/llvm-diff.1*
379%{_mandir}/man1/llvm-dis.1*
380%{_mandir}/man1/llvm-extract.1*
381%{_mandir}/man1/llvm-ld.1*
382%{_mandir}/man1/llvm-link.1*
383%{_mandir}/man1/llvm-nm.1*
384%{_mandir}/man1/llvm-prof.1*
385%{_mandir}/man1/llvm-ranlib.1*
a7973f21 386%{_mandir}/man1/llvmc.1*
a9beeab5
JB
387%{_mandir}/man1/llvmgcc.1*
388%{_mandir}/man1/llvmgxx.1*
389%{_mandir}/man1/opt.1*
bc88141a 390
bc88141a
ER
391%files devel
392%defattr(644,root,root,755)
393%attr(755,root,root) %{_bindir}/llvm-config
8132e62b
JB
394%attr(755,root,root) %{_libdir}/profile_rt.so
395%{_libdir}/libCompilerDriver.a
396%{_libdir}/libLLVM*.a
397%{_libdir}/libllvm*.a
1655c8b5 398%ifarch %{x8664}
0a8510f2 399%attr(755,root,root) %{_libdir}/BugpointPasses.so
19f21eee 400%attr(755,root,root) %{_libdir}/libEnhancedDisassembly.so
19f21eee 401%attr(755,root,root) %{_libdir}/libLTO.so
8132e62b
JB
402%{_libdir}/libEnhancedDisassembly.a
403%{_libdir}/libLTO.a
1655c8b5 404%endif
8132e62b
JB
405%{_includedir}/llvm
406%{_includedir}/llvm-c
407%{_mandir}/man1/llvm-config.1*
bc88141a 408
9556f4c9
ER
409%files doc
410%defattr(644,root,root,755)
411%doc moredocs/examples moredocs/html
412
413%if %{with apidocs}
414%files apidocs
415%defattr(644,root,root,755)
416%doc apidoc/*
417%endif
418
d997b14b 419%files -n clang
bc88141a 420%defattr(644,root,root,755)
8132e62b
JB
421%doc clang-docs/{LICENSE.TXT,NOTES.txt,README.txt,TODO.txt} %{?with_tests:clang-testlog.txt}
422%attr(755,root,root) %{_bindir}/clang
423%attr(755,root,root) %{_bindir}/clang++
d997b14b 424%attr(755,root,root) %{_bindir}/tblgen
b3a27ca2 425%attr(755,root,root) %{_libdir}/libclang.so
d997b14b 426%{_prefix}/lib/clang
8132e62b 427%{_mandir}/man1/clang.1*
b3a27ca2 428%{_mandir}/man1/tblgen.1*
d997b14b
AM
429
430%files -n clang-analyzer
bc88141a 431%defattr(644,root,root,755)
d997b14b
AM
432%attr(755,root,root) %{_bindir}/scan-build
433%attr(755,root,root) %{_bindir}/scan-view
ae49e501 434%dir %{_libdir}/clang-analyzer
d997b14b 435
9556f4c9
ER
436%dir %{_libdir}/clang-analyzer/scan-build
437%{_libdir}/clang-analyzer/scan-build/*.css
438%{_libdir}/clang-analyzer/scan-build/*.js
439%attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/scan-build
440%attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/*-analyzer
441
8132e62b
JB
442%dir %{_libdir}/clang-analyzer/scan-view
443%attr(755,root,root) %{_libdir}/clang-analyzer/scan-view/scan-view
444%{_libdir}/clang-analyzer/scan-view/Resources
445%{_libdir}/clang-analyzer/scan-view/*.py[co]
446
9556f4c9
ER
447%files -n clang-devel
448%defattr(644,root,root,755)
8132e62b 449%{_libdir}/libclang*.a
9556f4c9
ER
450%{_includedir}/clang
451%{_includedir}/clang-c
452
453%files -n clang-doc
454%defattr(644,root,root,755)
8132e62b 455%doc tools/clang/docs/*.{css,html,png,txt}
9556f4c9
ER
456
457%if %{with apidocs}
458%files -n clang-apidocs
459%defattr(644,root,root,755)
460%doc clang-apidoc/*
461%endif
462
463%if %{with ocaml}
d997b14b
AM
464%files ocaml
465%defattr(644,root,root,755)
8132e62b
JB
466%{_libdir}/ocaml/llvm*.cma
467%{_libdir}/ocaml/llvm*.cmi
d997b14b
AM
468
469%files ocaml-devel
470%defattr(644,root,root,755)
8132e62b
JB
471%{_libdir}/ocaml/libLLVM*.a
472%{_libdir}/ocaml/libllvm*.a
473%{_libdir}/ocaml/llvm*.a
474%{_libdir}/ocaml/llvm*.cmx*
475%{_libdir}/ocaml/llvm*.mli
9556f4c9
ER
476
477%files ocaml-doc
478%defattr(644,root,root,755)
479%doc moredocs/ocamldoc/html/*
480%endif
This page took 0.138361 seconds and 4 git commands to generate.