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