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