]>
Commit | Line | Data |
---|---|---|
bc88141a | 1 | # TODO |
9556f4c9 ER |
2 | #warning: Installed (but unpackaged) file(s) found: |
3 | # /usr/share/man/man1/lit.1.gz | |
bc88141a | 4 | # |
9556f4c9 ER |
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 | ||
aa11c230 | 15 | Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure) |
2326a99f | 16 | Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego) |
aa11c230 | 17 | Name: llvm |
9556f4c9 | 18 | Version: 2.8 |
334bd653 | 19 | Release: 3 |
aa11c230 | 20 | License: University of Illinois/NCSA Open Source License |
21 | Group: Development/Languages | |
7e30fbbc | 22 | Source0: http://llvm.org/releases/%{version}/%{name}-%{version}.tgz |
9556f4c9 ER |
23 | # Source0-md5: 220d361b4d17051ff4bb21c64abe05ba |
24 | Source1: http://llvm.org/releases/%{version}/clang-%{version}.tgz | |
25 | # Source1-md5: 10e14c901fc3728eecbd5b829e011b59 | |
d997b14b AM |
26 | # Data files should be installed with timestamps preserved |
27 | Patch3: %{name}-2.6-timestamp.patch | |
2326a99f | 28 | URL: http://llvm.org/ |
bc88141a | 29 | BuildRequires: bash |
d997b14b | 30 | BuildRequires: bison |
d997b14b | 31 | BuildRequires: flex |
9556f4c9 ER |
32 | %if %{with apidocs} |
33 | BuildRequires: doxygen | |
d997b14b | 34 | BuildRequires: graphviz |
9556f4c9 ER |
35 | %endif |
36 | %if %{with tests} | |
37 | BuildRequires: dejagnu | |
38 | BuildRequires: python | |
39 | BuildRequires: tcl-devel | |
40 | %endif | |
d997b14b | 41 | BuildRequires: groff |
bc88141a | 42 | BuildRequires: libltdl-devel |
d997b14b AM |
43 | BuildRequires: libstdc++-devel >= 5:3.4 |
44 | BuildRequires: ocaml-ocamldoc | |
8c156e7d | 45 | BuildRequires: perl-tools-pod |
46 | BuildRequires: rpm-pythonprov | |
356a0bbd ER |
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 | |
9556f4c9 ER |
51 | # LLVM is not supported on PPC64 |
52 | # http://llvm.org/bugs/show_bug.cgi?id=3729 | |
53 | ExcludeArch: ppc64 | |
aa11c230 | 54 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
55 | ||
356a0bbd | 56 | %define _sysconfdir /etc/%{name} |
021b3c3d | 57 | |
9556f4c9 ER |
58 | %define specflags_ppc -fno-var-tracking-assignments |
59 | ||
6832a5c5 ER |
60 | # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ... |
61 | %define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\) | |
62 | ||
aa11c230 | 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 front-ends | |
69 | derived from GCC 4.0.1. A new front-end for the C family of languages | |
70 | is in development. The compiler infrastructure includes mirror sets of | |
71 | programming tools as well as libraries with equivalent functionality. | |
72 | ||
2326a99f JB |
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 frontendów wywodzących się | |
79 | z GCC 4.0.1. W trakcie tworzenia jest nowy frontend do języków z | |
80 | rodziny C. Infrastruktura kompilatora zawiera lustrzane zestawy | |
81 | narzędzi programistycznych oraz biblioteki z odpowiadającą narzędziom | |
82 | funkcjonalnością. | |
83 | ||
bc88141a ER |
84 | %package devel |
85 | Summary: Libraries and header files for LLVM | |
86 | Group: Development/Languages | |
87 | Requires: %{name} = %{version}-%{release} | |
88 | Requires: libstdc++-devel >= 6:3.4 | |
89 | ||
90 | %description devel | |
91 | This package contains library and header files needed to develop new | |
92 | native programs that use the LLVM infrastructure. | |
93 | ||
9556f4c9 ER |
94 | %package doc |
95 | Summary: Documentation for LLVM | |
96 | Group: Documentation | |
97 | # does not require base | |
bc88141a | 98 | |
9556f4c9 ER |
99 | %description doc |
100 | Documentation for the LLVM compiler infrastructure. | |
bc88141a | 101 | |
9556f4c9 ER |
102 | %package apidocs |
103 | Summary: API documentation for LLVM | |
104 | Group: Development/Languages | |
105 | Requires: %{name}-doc = %{version}-%{release} | |
bc88141a | 106 | |
9556f4c9 ER |
107 | %description apidocs |
108 | API documentation for the LLVM compiler infrastructure. | |
bc88141a | 109 | |
d997b14b AM |
110 | %package -n clang |
111 | Summary: A C language family frontend for LLVM | |
112 | License: NCSA | |
113 | Group: Development/Languages | |
114 | ||
115 | %description -n clang | |
116 | clang: noun 1. A loud, resonant, metallic sound. 2. The strident call | |
117 | of a crane or goose. 3. C-language family front-end toolkit. | |
118 | ||
119 | The goal of the Clang project is to create a new C, C++, Objective C | |
120 | and Objective C++ front-end for the LLVM compiler. Its tools are built | |
121 | as libraries and designed to be loosely-coupled and extendable. | |
122 | ||
123 | %package -n clang-analyzer | |
124 | Summary: A source code analysis framework | |
125 | License: NCSA | |
126 | Group: Development/Languages | |
127 | Requires: clang = %{version}-%{release} | |
128 | # not picked up automatically since files are currently not instaled | |
129 | # in standard Python hierarchies yet | |
130 | Requires: python | |
131 | ||
132 | %description -n clang-analyzer | |
133 | The Clang Static Analyzer consists of both a source code analysis | |
134 | framework and a standalone tool that finds bugs in C and Objective-C | |
135 | programs. The standalone tool is invoked from the command-line, and is | |
136 | intended to run in tandem with a build of a project or code base. | |
137 | ||
9556f4c9 ER |
138 | %package -n clang-devel |
139 | Summary: Header files for clang | |
140 | Group: Development/Languages | |
141 | Requires: clang = %{version}-%{release} | |
142 | ||
143 | %description -n clang-devel | |
144 | This package contains header files for the Clang compiler. | |
145 | ||
146 | %package -n clang-doc | |
147 | Summary: Documentation for Clang | |
148 | Group: Documentation | |
149 | Requires: %{name} = %{version}-%{release} | |
150 | ||
151 | %description -n clang-doc | |
152 | Documentation for the Clang compiler front-end. | |
153 | ||
154 | %package -n clang-apidocs | |
155 | Summary: API documentation for Clang | |
156 | Group: Development/Languages | |
157 | Requires: clang-doc = %{version}-%{release} | |
158 | ||
159 | %description -n clang-apidocs | |
160 | API documentation for the Clang compiler. | |
161 | ||
162 | %package ocaml | |
163 | Summary: OCaml binding for LLVM | |
164 | Group: Development/Libraries | |
165 | Requires: %{name} = %{version}-%{release} | |
166 | %requires_eq ocaml-runtime | |
167 | ||
168 | %description ocaml | |
169 | OCaml binding for LLVM. | |
170 | ||
171 | %package ocaml-devel | |
172 | Summary: Development files for %{name}-ocaml | |
173 | Group: Development/Libraries | |
174 | Requires: %{name}-devel = %{version}-%{release} | |
175 | Requires: %{name}-ocaml = %{version}-%{release} | |
176 | ||
177 | %description ocaml-devel | |
178 | The llvm-ocaml-devel package contains libraries and signature files | |
179 | for developing applications that use llvm-ocaml. | |
180 | ||
181 | %package ocaml-doc | |
182 | Summary: Documentation for LLVM's OCaml binding | |
183 | Group: Documentation | |
184 | Requires: %{name}-ocaml = %{version}-%{release} | |
185 | ||
186 | %description ocaml-doc | |
187 | HTML documentation for LLVM's OCaml binding. | |
188 | ||
aa11c230 | 189 | %prep |
d997b14b AM |
190 | %setup -q -a1 |
191 | mv clang-*.* tools/clang | |
9556f4c9 ER |
192 | %patch3 -p1 |
193 | ||
19f21eee PS |
194 | # configure does not properly specify libdir |
195 | sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}|g' Makefile.config.in | |
196 | ||
bacc8b96 ER |
197 | grep -rl /usr/bin/env tools utils | xargs sed -i -e '1{ |
198 | s,^#!.*bin/env python,#!%{__python}, | |
199 | s,^#!.*bin/env perl,#!%{__perl}, | |
200 | }' | |
201 | ||
9556f4c9 | 202 | install -d obj |
aa11c230 | 203 | |
204 | %build | |
d997b14b | 205 | # Disabling assertions now, rec. by pure and needed for OpenGTL |
9556f4c9 | 206 | # TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801 |
d997b14b | 207 | # |
bc88141a | 208 | # bash specific 'test a < b' |
9556f4c9 | 209 | cd obj |
d997b14b | 210 | bash ../%configure \ |
bc88141a ER |
211 | --libdir=%{_libdir}/%{name} \ |
212 | --datadir=%{_datadir}/%{name}-%{version} \ | |
d997b14b AM |
213 | %ifarch %{ix86} |
214 | --enable-pic=no \ | |
9556f4c9 ER |
215 | %endif |
216 | %if %{with apidocs} | |
217 | --enable-doxygen \ | |
d997b14b | 218 | %endif |
bc88141a | 219 | --disable-static \ |
d997b14b | 220 | --disable-assertions \ |
bc88141a ER |
221 | --enable-debug-runtime \ |
222 | --enable-jit \ | |
aa11c230 | 223 | --enable-optimized \ |
bc88141a ER |
224 | --enable-shared \ |
225 | --with-pic | |
226 | ||
d997b14b AM |
227 | %{__make} \ |
228 | OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}" | |
aa11c230 | 229 | |
9556f4c9 ER |
230 | %if %{with test} |
231 | %{__make} check 2>&1 | tee llvm-testlog.txt | |
232 | %{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt | |
233 | %endif | |
234 | ||
aa11c230 | 235 | %install |
236 | rm -rf $RPM_BUILD_ROOT | |
9556f4c9 | 237 | %{__make} -C obj -j1 install \ |
d997b14b | 238 | PROJ_docsdir=/moredocs \ |
aa11c230 | 239 | DESTDIR=$RPM_BUILD_ROOT |
240 | ||
d997b14b | 241 | # Static analyzer not installed by default: |
9556f4c9 ER |
242 | # http://clang-analyzer.llvm.org/installation#OtherPlatforms |
243 | install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer | |
d997b14b AM |
244 | # create launchers |
245 | for f in scan-{build,view}; do | |
9556f4c9 ER |
246 | ln -s %{_libdir}/clang-analyzer/$f/$f $RPM_BUILD_ROOT%{_bindir}/$f |
247 | cp -pr tools/clang/tools/$f $RPM_BUILD_ROOT%{_libdir}/clang-analyzer | |
d997b14b AM |
248 | done |
249 | ||
d997b14b | 250 | # Move documentation back to build directory |
d997b14b AM |
251 | rm -rf moredocs |
252 | mv $RPM_BUILD_ROOT/moredocs . | |
9556f4c9 ER |
253 | rm -fv moredocs/*.tar.gz |
254 | rm -fv moredocs/ocamldoc/html/*.tar.gz | |
255 | ||
256 | # and separate the apidoc | |
257 | %if %{with apidocs} | |
258 | rm -rf apidoc clang-apidoc | |
259 | mv moredocs/html/doxygen apidoc | |
260 | cp -a tools/clang/docs/doxygen/html clang-apidoc | |
261 | %endif | |
d997b14b AM |
262 | |
263 | # And prepare Clang documentation | |
d997b14b | 264 | rm -rf clang-docs |
9556f4c9 | 265 | install -d clang-docs |
d997b14b | 266 | for f in LICENSE.TXT NOTES.txt README.txt TODO.txt; do |
9556f4c9 | 267 | ln tools/clang/$f clang-docs |
d997b14b | 268 | done |
021b3c3d | 269 | |
6832a5c5 | 270 | # Get rid of erroneously installed example files. |
19f21eee | 271 | rm -v $RPM_BUILD_ROOT%{_libdir}/*LLVMHello.* |
6832a5c5 | 272 | |
d997b14b | 273 | # FIXME file this bug |
19f21eee | 274 | sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}",' \ |
d997b14b | 275 | $RPM_BUILD_ROOT%{_bindir}/llvm-config |
6832a5c5 | 276 | |
d997b14b AM |
277 | # remove documentation makefiles: |
278 | # they require the build directory to work | |
9556f4c9 ER |
279 | rm -rf moredocs/examples |
280 | cp -a examples moredocs/examples | |
281 | find moredocs/examples -name Makefile | xargs -0r rm -f | |
6832a5c5 | 282 | |
aa11c230 | 283 | %clean |
284 | rm -rf $RPM_BUILD_ROOT | |
285 | ||
2326a99f JB |
286 | %post -p /sbin/ldconfig |
287 | %postun -p /sbin/ldconfig | |
aa11c230 | 288 | |
289 | %files | |
290 | %defattr(644,root,root,755) | |
bc88141a | 291 | %doc CREDITS.TXT LICENSE.TXT README.txt |
9556f4c9 | 292 | %{?with_tests:%doc llvm-testlog.txt} |
a9beeab5 | 293 | %attr(755,root,root) %{_bindir}/bugpoint |
a9beeab5 JB |
294 | %attr(755,root,root) %{_bindir}/llc |
295 | %attr(755,root,root) %{_bindir}/lli | |
a9beeab5 | 296 | %attr(755,root,root) %{_bindir}/opt |
a8575aac | 297 | %attr(755,root,root) %{_bindir}/llvmc |
bc88141a ER |
298 | %attr(755,root,root) %{_bindir}/llvm-* |
299 | %exclude %attr(755,root,root) %{_bindir}/llvm-config | |
b3a27ca2 | 300 | %attr(755,root,root) %{_libdir}/libLLVM-*.*.so |
a9beeab5 JB |
301 | %{_mandir}/man1/bugpoint.1* |
302 | %{_mandir}/man1/llc.1* | |
303 | %{_mandir}/man1/lli.1* | |
d997b14b | 304 | %{_mandir}/man1/llvmc.1* |
a9beeab5 | 305 | %{_mandir}/man1/llvm-*.1* |
a9beeab5 JB |
306 | %{_mandir}/man1/llvmgcc.1* |
307 | %{_mandir}/man1/llvmgxx.1* | |
308 | %{_mandir}/man1/opt.1* | |
a8575aac | 309 | #%{_mandir}/man1/stkrc.1* |
bc88141a | 310 | |
bc88141a ER |
311 | %files devel |
312 | %defattr(644,root,root,755) | |
313 | %attr(755,root,root) %{_bindir}/llvm-config | |
314 | %{_includedir}/llvm | |
315 | %{_includedir}/llvm-c | |
19f21eee | 316 | %{_libdir}/lib*.a |
1655c8b5 PS |
317 | # x86-64 only .a/.so? |
318 | %ifarch %{x8664} | |
19f21eee PS |
319 | %attr(755,root,root) %{_libdir}/libBugpointPasses.so |
320 | %attr(755,root,root) %{_libdir}/libEnhancedDisassembly.so | |
19f21eee | 321 | %attr(755,root,root) %{_libdir}/libLTO.so |
1655c8b5 PS |
322 | %endif |
323 | # | |
324 | %exclude %attr(755,root,root) %{_libdir}/libLLVM-*.*.so | |
b3a27ca2 | 325 | %exclude %attr(755,root,root) %{_libdir}/libclang.so |
19f21eee | 326 | %attr(755,root,root) %{_libdir}/libprofile_rt.so |
bc88141a | 327 | |
9556f4c9 ER |
328 | %files doc |
329 | %defattr(644,root,root,755) | |
330 | %doc moredocs/examples moredocs/html | |
331 | ||
332 | %if %{with apidocs} | |
333 | %files apidocs | |
334 | %defattr(644,root,root,755) | |
335 | %doc apidoc/* | |
336 | %endif | |
337 | ||
d997b14b | 338 | %files -n clang |
bc88141a | 339 | %defattr(644,root,root,755) |
d997b14b | 340 | %doc clang-docs/* |
9556f4c9 | 341 | %{?with_tests:%doc clang-testlog.txt} |
d997b14b | 342 | %attr(755,root,root) %{_bindir}/clang* |
d997b14b | 343 | %attr(755,root,root) %{_bindir}/tblgen |
9556f4c9 | 344 | %attr(755,root,root) %{_bindir}/c-index-test |
b3a27ca2 | 345 | %attr(755,root,root) %{_libdir}/libclang.so |
d997b14b | 346 | %{_prefix}/lib/clang |
d997b14b | 347 | %{_mandir}/man1/clang.1.* |
b3a27ca2 | 348 | %{_mandir}/man1/tblgen.1* |
d997b14b AM |
349 | |
350 | %files -n clang-analyzer | |
bc88141a | 351 | %defattr(644,root,root,755) |
d997b14b AM |
352 | %attr(755,root,root) %{_bindir}/scan-build |
353 | %attr(755,root,root) %{_bindir}/scan-view | |
ae49e501 | 354 | %dir %{_libdir}/clang-analyzer |
d997b14b | 355 | |
9556f4c9 ER |
356 | %dir %{_libdir}/clang-analyzer/scan-view |
357 | %attr(755,root,root) %{_libdir}/clang-analyzer/scan-view/scan-view | |
358 | %{_libdir}/clang-analyzer/scan-view/Resources | |
359 | %{_libdir}/clang-analyzer/scan-view/*.py | |
360 | ||
361 | %dir %{_libdir}/clang-analyzer/scan-build | |
362 | %{_libdir}/clang-analyzer/scan-build/*.css | |
363 | %{_libdir}/clang-analyzer/scan-build/*.js | |
364 | %attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/scan-build | |
365 | %attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/*-analyzer | |
366 | ||
367 | %files -n clang-devel | |
368 | %defattr(644,root,root,755) | |
369 | %{_includedir}/clang | |
370 | %{_includedir}/clang-c | |
371 | ||
372 | %files -n clang-doc | |
373 | %defattr(644,root,root,755) | |
374 | %doc tools/clang/docs/* | |
375 | ||
376 | %if %{with apidocs} | |
377 | %files -n clang-apidocs | |
378 | %defattr(644,root,root,755) | |
379 | %doc clang-apidoc/* | |
380 | %endif | |
381 | ||
382 | %if %{with ocaml} | |
d997b14b AM |
383 | %files ocaml |
384 | %defattr(644,root,root,755) | |
d997b14b AM |
385 | %{_libdir}/ocaml/*.cma |
386 | %{_libdir}/ocaml/*.cmi | |
387 | ||
388 | %files ocaml-devel | |
389 | %defattr(644,root,root,755) | |
390 | %{_libdir}/ocaml/*.a | |
391 | %{_libdir}/ocaml/*.cmx* | |
392 | %{_libdir}/ocaml/*.mli | |
9556f4c9 ER |
393 | |
394 | %files ocaml-doc | |
395 | %defattr(644,root,root,755) | |
396 | %doc moredocs/ocamldoc/html/* | |
397 | %endif |