3 # make *** No rule to make target (...)/rpm/BUILD/llvm-3.0.src/obj/bindings/ocaml/llvm/Release/META.llvm, needed by install-meta.
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
10 %ifarch s390 s390x sparc64
11 # No ocaml on these arches
15 Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
16 Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
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
34 BuildRequires: doxygen
35 BuildRequires: graphviz
38 BuildRequires: dejagnu
40 BuildRequires: tcl-devel
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
53 # LLVM is not supported on PPC64
54 # http://llvm.org/bugs/show_bug.cgi?id=3729
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58 %define _sysconfdir /etc/%{name}
60 %define specflags_ppc -fno-var-tracking-assignments
62 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
63 %define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
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
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.
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
88 This package contains static libraries and header files needed to
89 develop new native programs that use the LLVM infrastructure.
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
97 Summary: Documentation for LLVM
98 Summary(pl.UTF-8): Dokumentacja do LLVM-a
100 # does not require base
103 Documentation for the LLVM compiler infrastructure.
105 %description doc -l pl.UTF-8
106 Dokumentacja do infrastruktury kompilatorów LLVM.
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}
115 API documentation for the LLVM compiler infrastructure.
117 %description apidocs -l pl.UTF-8
118 Dokumentacja API infrastruktury kompilatorów LLVM.
121 Summary: A C language family frontend for LLVM
122 Summary(pl.UTF-8): Frontend LLVM-a do języków z rodziny C
124 Group: Development/Languages
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.
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.
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
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
144 %package -n clang-analyzer
145 Summary: A source code analysis framework
146 Summary(pl.UTF-8): Szkielet do analizy kodu źródłowego
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
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.
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.
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}
172 %description -n clang-devel
173 This package contains header files for the Clang compiler.
175 %description -n clang-devel -l pl.UTF-8
176 Ten pakiet zawiera pliki nagłówkowe kompilatora Clang.
178 %package -n clang-doc
179 Summary: Documentation for Clang
180 Summary(pl.UTF-8): Dokumentacja do Clanga
182 Requires: %{name} = %{version}-%{release}
184 %description -n clang-doc
185 Documentation for the Clang compiler front-end.
187 %description -n clang-doc -l pl.UTF-8
188 Dokumentacja do frontendu kompilatora Clang.
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}
196 %description -n clang-apidocs
197 API documentation for the Clang compiler.
199 %description -n clang-apidocs -l pl.UTF-8
200 Dokumentacja API kompilatora Clang.
203 Summary: OCaml binding for LLVM
204 Summary(pl.UTF-8): Wiązanie OCamla do LLVM-a
206 Requires: %{name} = %{version}-%{release}
207 %requires_eq ocaml-runtime
210 OCaml binding for LLVM.
212 %description ocaml -l pl.UTF-8
213 Wiązanie OCamla do LLVM-a.
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}
222 %description ocaml-devel
223 The llvm-ocaml-devel package contains libraries and signature files
224 for developing applications that use llvm-ocaml binding.
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.
232 Summary: Documentation for LLVM's OCaml binding
233 Summary(pl.UTF-8): Dokumentacja wiązania OCamla do LLVM-a
235 Requires: %{name}-ocaml = %{version}-%{release}
237 %description ocaml-doc
238 HTML documentation for LLVM's OCaml binding.
240 %description ocaml-doc -l pl.UTF-8
241 Dokumentacja HTML wiązania OCamla do LLVM-a.
244 %setup -q -a1 -n %{name}-%{version}.src
245 mv clang-*.* tools/clang
249 # configure does not properly specify libdir
250 sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}|g' Makefile.config.in
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},
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
263 # bash specific 'test a < b'
266 --libdir=%{_libdir}/%{name} \
267 --datadir=%{_datadir}/%{name}-%{version} \
274 --enable-bindings=%{?with_ocaml:ocaml}%{!?with_ocaml:none} \
276 --disable-assertions \
277 --enable-debug-runtime \
285 OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
288 %{__make} check 2>&1 | tee llvm-testlog.txt
289 %{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt
293 rm -rf $RPM_BUILD_ROOT
294 %{__make} -C obj -j1 install \
295 PROJ_docsdir=/moredocs \
296 DESTDIR=$RPM_BUILD_ROOT
298 # Static analyzer not installed by default:
299 # http://clang-analyzer.llvm.org/installation#OtherPlatforms
300 install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
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
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
310 # Move documentation back to build directory
312 mv $RPM_BUILD_ROOT/moredocs .
313 rm -fv moredocs/*.tar.gz
314 rm -fv moredocs/ocamldoc/html/*.tar.gz
316 # and separate the apidoc
318 rm -rf apidoc clang-apidoc
319 mv moredocs/html/doxygen apidoc
320 cp -a tools/clang/docs/doxygen/html clang-apidoc
323 # And prepare Clang documentation
325 install -d clang-docs
326 for f in LICENSE.TXT NOTES.txt README.txt; do
327 ln tools/clang/$f clang-docs
330 # Get rid of erroneously installed example files.
331 rm -v $RPM_BUILD_ROOT%{_libdir}/*LLVMHello.*
333 # FIXME file this bug
334 sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}",' \
335 $RPM_BUILD_ROOT%{_bindir}/llvm-config
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
344 rm -rf $RPM_BUILD_ROOT
346 %post -p /sbin/ldconfig
347 %postun -p /sbin/ldconfig
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*
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
401 %attr(755,root,root) %{_libdir}/BugpointPasses.so
402 %attr(755,root,root) %{_libdir}/libLTO.so
403 %{_libdir}/libEnhancedDisassembly.a
407 %{_includedir}/llvm-c
408 %{_mandir}/man1/llvm-config.1*
411 %defattr(644,root,root,755)
412 %doc moredocs/examples moredocs/html
416 %defattr(644,root,root,755)
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
428 %{_mandir}/man1/clang.1*
429 %{_mandir}/man1/tblgen.1*
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
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
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]
448 %files -n clang-devel
449 %defattr(644,root,root,755)
450 %{_libdir}/libclang*.a
452 %{_includedir}/clang-c
455 %defattr(644,root,root,755)
456 %doc tools/clang/docs/*.{css,html,png,txt}
459 %files -n clang-apidocs
460 %defattr(644,root,root,755)
466 %defattr(644,root,root,755)
467 %{_libdir}/ocaml/llvm*.cma
468 %{_libdir}/ocaml/llvm*.cmi
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
479 %defattr(644,root,root,755)
480 %doc moredocs/ocamldoc/html/*