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