]> git.pld-linux.org Git - packages/llvm.git/blob - llvm.spec
e1cf542a6088505c21f0f0201b2391aab0e67548
[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.8
19 Release:        3
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:  220d361b4d17051ff4bb21c64abe05ba
24 Source1:        http://llvm.org/releases/%{version}/clang-%{version}.tgz
25 # Source1-md5:  10e14c901fc3728eecbd5b829e011b59
26 # Data files should be installed with timestamps preserved
27 Patch3:         %{name}-2.6-timestamp.patch
28 URL:            http://llvm.org/
29 BuildRequires:  bash
30 BuildRequires:  bison
31 BuildRequires:  flex
32 %if %{with apidocs}
33 BuildRequires:  doxygen
34 BuildRequires:  graphviz
35 %endif
36 %if %{with tests}
37 BuildRequires:  dejagnu
38 BuildRequires:  python
39 BuildRequires:  tcl-devel
40 %endif
41 BuildRequires:  groff
42 BuildRequires:  libltdl-devel
43 BuildRequires:  libstdc++-devel >= 5:3.4
44 BuildRequires:  ocaml-ocamldoc
45 BuildRequires:  perl-tools-pod
46 BuildRequires:  rpm-pythonprov
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
51 # LLVM is not supported on PPC64
52 # http://llvm.org/bugs/show_bug.cgi?id=3729
53 ExcludeArch:    ppc64
54 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55
56 %define         _sysconfdir     /etc/%{name}
57
58 %define         specflags_ppc   -fno-var-tracking-assignments
59
60 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
61 %define         _noautostrip    .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
62
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
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
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
94 %package doc
95 Summary:        Documentation for LLVM
96 Group:          Documentation
97 # does not require base
98
99 %description doc
100 Documentation for the LLVM compiler infrastructure.
101
102 %package apidocs
103 Summary:        API documentation for LLVM
104 Group:          Development/Languages
105 Requires:       %{name}-doc = %{version}-%{release}
106
107 %description apidocs
108 API documentation for the LLVM compiler infrastructure.
109
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
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
189 %prep
190 %setup -q -a1
191 mv clang-*.* tools/clang
192 %patch3 -p1
193
194 # configure does not properly specify libdir
195 sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}|g' Makefile.config.in
196
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
202 install -d obj
203
204 %build
205 # Disabling assertions now, rec. by pure and needed for OpenGTL
206 # TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
207 #
208 # bash specific 'test a < b'
209 cd obj
210 bash ../%configure \
211         --libdir=%{_libdir}/%{name} \
212         --datadir=%{_datadir}/%{name}-%{version} \
213 %ifarch %{ix86}
214         --enable-pic=no \
215 %endif
216 %if %{with apidocs}
217         --enable-doxygen \
218 %endif
219         --disable-static \
220         --disable-assertions \
221         --enable-debug-runtime \
222         --enable-jit \
223         --enable-optimized \
224         --enable-shared \
225         --with-pic
226
227 %{__make} \
228         OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
229
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
235 %install
236 rm -rf $RPM_BUILD_ROOT
237 %{__make} -C obj -j1 install \
238         PROJ_docsdir=/moredocs \
239         DESTDIR=$RPM_BUILD_ROOT
240
241 # Static analyzer not installed by default:
242 # http://clang-analyzer.llvm.org/installation#OtherPlatforms
243 install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
244 # create launchers
245 for f in scan-{build,view}; do
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
248 done
249
250 # Move documentation back to build directory
251 rm -rf moredocs
252 mv $RPM_BUILD_ROOT/moredocs .
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
262
263 # And prepare Clang documentation
264 rm -rf clang-docs
265 install -d clang-docs
266 for f in LICENSE.TXT NOTES.txt README.txt TODO.txt; do
267         ln tools/clang/$f clang-docs
268 done
269
270 # Get rid of erroneously installed example files.
271 rm -v $RPM_BUILD_ROOT%{_libdir}/*LLVMHello.*
272
273 # FIXME file this bug
274 sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}",' \
275         $RPM_BUILD_ROOT%{_bindir}/llvm-config
276
277 # remove documentation makefiles:
278 # they require the build directory to work
279 rm -rf moredocs/examples
280 cp -a examples moredocs/examples
281 find moredocs/examples -name Makefile | xargs -0r rm -f
282
283 %clean
284 rm -rf $RPM_BUILD_ROOT
285
286 %post   -p /sbin/ldconfig
287 %postun -p /sbin/ldconfig
288
289 %files
290 %defattr(644,root,root,755)
291 %doc CREDITS.TXT LICENSE.TXT README.txt
292 %{?with_tests:%doc llvm-testlog.txt}
293 %attr(755,root,root) %{_bindir}/bugpoint
294 %attr(755,root,root) %{_bindir}/llc
295 %attr(755,root,root) %{_bindir}/lli
296 %attr(755,root,root) %{_bindir}/opt
297 %attr(755,root,root) %{_bindir}/llvmc
298 %attr(755,root,root) %{_bindir}/llvm-*
299 %exclude %attr(755,root,root) %{_bindir}/llvm-config
300 %attr(755,root,root) %{_libdir}/libLLVM-*.*.so
301 %{_mandir}/man1/bugpoint.1*
302 %{_mandir}/man1/llc.1*
303 %{_mandir}/man1/lli.1*
304 %{_mandir}/man1/llvmc.1*
305 %{_mandir}/man1/llvm-*.1*
306 %{_mandir}/man1/llvmgcc.1*
307 %{_mandir}/man1/llvmgxx.1*
308 %{_mandir}/man1/opt.1*
309 #%{_mandir}/man1/stkrc.1*
310
311 %files devel
312 %defattr(644,root,root,755)
313 %attr(755,root,root) %{_bindir}/llvm-config
314 %{_includedir}/llvm
315 %{_includedir}/llvm-c
316 %{_libdir}/lib*.a
317 # x86-64 only .a/.so?
318 %ifarch %{x8664}
319 %attr(755,root,root) %{_libdir}/libBugpointPasses.so
320 %attr(755,root,root) %{_libdir}/libEnhancedDisassembly.so
321 %attr(755,root,root) %{_libdir}/libLTO.so
322 %endif
323 #
324 %exclude %attr(755,root,root) %{_libdir}/libLLVM-*.*.so
325 %exclude %attr(755,root,root) %{_libdir}/libclang.so
326 %attr(755,root,root) %{_libdir}/libprofile_rt.so
327
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
338 %files -n clang
339 %defattr(644,root,root,755)
340 %doc clang-docs/*
341 %{?with_tests:%doc clang-testlog.txt}
342 %attr(755,root,root) %{_bindir}/clang*
343 %attr(755,root,root) %{_bindir}/tblgen
344 %attr(755,root,root) %{_bindir}/c-index-test
345 %attr(755,root,root) %{_libdir}/libclang.so
346 %{_prefix}/lib/clang
347 %{_mandir}/man1/clang.1.*
348 %{_mandir}/man1/tblgen.1*
349
350 %files -n clang-analyzer
351 %defattr(644,root,root,755)
352 %attr(755,root,root) %{_bindir}/scan-build
353 %attr(755,root,root) %{_bindir}/scan-view
354 %dir %{_libdir}/clang-analyzer
355
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}
383 %files ocaml
384 %defattr(644,root,root,755)
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
393
394 %files ocaml-doc
395 %defattr(644,root,root,755)
396 %doc moredocs/ocamldoc/html/*
397 %endif
This page took 0.063158 seconds and 2 git commands to generate.