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