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