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