source: projects/specs/trunk/l/llvm/llvm-vl.spec @ 4656

Revision 4656, 14.2 KB checked in by daisuke, 13 years ago (diff)

llvm: update to 2.9

Line 
1# Build options:
2#
3# --with doxygen
4#   The doxygen docs are HUGE, so they are not built by default.
5
6Name:           llvm
7Version:        2.9
8Release:        1%{?_dist_release}
9Summary:        The Low Level Virtual Machine
10Summary(ja):    LLVM - 低レベルバーチャルマシン
11
12Group:          Development/Languages
13License:        NCSA
14URL:            http://llvm.org/
15Source0:        http://llvm.org/releases/%{version}/llvm-%{version}.tgz
16Source1:        http://llvm.org/releases/%{version}/clang-%{version}.tgz
17# multilib fixes
18Source2:        llvm-Config-config.h
19Source3:        llvm-Config-llvm-config.h
20
21# Data files should be installed with timestamps preserved
22Patch0:         llvm-2.6-timestamp.patch
23# clang link failure if system GCC version is unknown
24# http://llvm.org/bugs/show_bug.cgi?id=8897
25Patch1:         clang-2.9-add_gcc_vers.patch
26
27BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
28
29BuildRequires:  bison
30BuildRequires:  chrpath
31BuildRequires:  flex
32BuildRequires:  gcc-c++ >= 3.4
33BuildRequires:  groff
34BuildRequires:  libffi-devel
35BuildRequires:  libtool-ltdl-devel
36BuildRequires:  ocaml
37# for DejaGNU test suite
38BuildRequires:  dejagnu tcl python
39%if %{?_with_doxygen:1}%{!?_with_doxygen:0}
40BuildRequires:  doxygen graphviz
41%endif
42Requires:       llvm-libs = %{version}-%{release}
43
44# LLVM is not supported on PPC64
45# http://llvm.org/bugs/show_bug.cgi?id=3729
46ExcludeArch:    ppc64
47
48%description
49LLVM is a compiler infrastructure designed for compile-time,
50link-time, runtime, and idle-time optimization of programs from
51arbitrary programming languages.  The compiler infrastructure includes
52mirror sets of programming tools as well as libraries with equivalent
53functionality.
54
55
56%package devel
57Summary:        Libraries and header files for LLVM
58Summary(ja):    LLVM のライブラリおよびヘッダファイル
59Group:          Development/Languages
60Requires:       %{name} = %{version}-%{release}
61Requires:       libstdc++-devel
62Requires:       libffi-devel
63Provides:       llvm-static = %{version}-%{release}
64
65
66%description devel
67This package contains library and header files needed to develop new
68native programs that use the LLVM infrastructure.
69
70
71%package doc
72Summary:        Documentation for LLVM
73Summary(ja):    LLVM のドキュメント
74Group:          Documentation
75Requires:       %{name} = %{version}-%{release}
76
77%description doc
78Documentation for the LLVM compiler infrastructure.
79
80
81%package libs
82Summary:        LLVM shared libraries
83Summary(ja):    LLVM シェアードライブラリ
84Group:          System Environment/Libraries
85
86%description libs
87Shared libraries for the LLVM compiler infrastructure.
88
89
90%package -n clang
91Summary:        A C language family front-end for LLVM
92Summary(ja):    LLVM の C 言語用フロントエンド
93License:        NCSA
94Group:          Development/Languages
95
96%description -n clang
97clang: noun
98    1. A loud, resonant, metallic sound.
99    2. The strident call of a crane or goose.
100    3. C-language family front-end toolkit.
101
102The goal of the Clang project is to create a new C, C++, Objective C
103and Objective C++ front-end for the LLVM compiler. Its tools are built
104as libraries and designed to be loosely-coupled and extensible.
105
106
107%package -n clang-devel
108Summary:        Header files for clang
109Summary(ja):    clang のヘッダファイル
110Group:          Development/Languages
111Requires:       clang = %{version}-%{release}
112
113%description -n clang-devel
114This package contains header files for the Clang compiler.
115
116
117%package -n clang-analyzer
118Summary:        A source code analysis framework
119Summary(ja):    ソースコー分析フレームワーク
120License:        NCSA
121Group:          Development/Languages
122Requires:       clang = %{version}-%{release}
123# not picked up automatically since files are currently not instaled
124# in standard Python hierarchies yet
125Requires:       python
126
127%description -n clang-analyzer
128The Clang Static Analyzer consists of both a source code analysis
129framework and a standalone tool that finds bugs in C and Objective-C
130programs. The standalone tool is invoked from the command-line, and is
131intended to run in tandem with a build of a project or code base.
132
133
134%package -n clang-doc
135Summary:        Documentation for Clang
136Summary(ja):    Clang のドキュメント
137Group:          Documentation
138Requires:       %{name} = %{version}-%{release}
139
140%description -n clang-doc
141Documentation for the Clang compiler front-end.
142
143
144%if %{?_with_doxygen:1}%{!?_with_doxygen:0}
145%package apidoc
146Summary:        API documentation for LLVM
147Summary(ja):    LLVM の API ドキュメント
148Group:          Development/Languages
149Requires:       %{name}-docs = %{version}-%{release}
150
151
152%description apidoc
153API documentation for the LLVM compiler infrastructure.
154%endif
155
156
157%package        ocaml
158Summary:        OCaml binding for LLVM
159Summary(ja):    LLVM の OCaml バインディング
160Group:          Development/Libraries
161Requires:       %{name} = %{version}-%{release}
162Requires:       ocaml
163
164%description    ocaml
165OCaml binding for LLVM.
166
167
168%package        ocaml-devel
169Summary:        Development files for %{name}-ocaml
170Summary(ja):    %{name}-ocaml の開発ファイル
171Group:          Development/Libraries
172Requires:       %{name}-devel = %{version}-%{release}
173Requires:       %{name}-ocaml = %{version}-%{release}
174Requires:       ocaml
175
176%description    ocaml-devel
177The %{name}-ocaml-devel package contains libraries and signature files
178for developing applications that use %{name}-ocaml.
179
180
181%package ocaml-doc
182Summary:        Documentation for %{name}-ocaml
183Summary(ja):    %{name}-ocaml のドキュメント
184Group:          Documentation
185Requires:       %{name}-ocaml = %{version}-%{release}
186
187%description ocaml-doc
188HTML documentation for LLVM's OCaml binding.
189
190
191
192%prep
193%setup -q -n llvm-%{version} -a1 %{?_with_gcc:-a2}
194mv clang-%{version} tools/clang
195
196# llvm patches
197%patch0 -p1 -b .timestamp
198
199# clang patches
200pushd tools/clang
201%patch1 -p1 -b .add_gcc_ver
202popd
203
204# Encoding fix
205#(cd tools/clang/docs && \
206#    iconv -f ISO88591 -t UTF8 BlockImplementation.txt \
207#    -o BlockImplementation.txt)
208
209
210%build
211# Disabling assertions now, rec. by pure and needed for OpenGTL
212# TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
213%configure \
214  --prefix=%{_prefix} \
215  --libdir=%{_libdir}/%{name} \
216  --datadir=%{_libdir}/%{name} \
217  --disable-assertions \
218  --enable-jit \
219  --enable-libffi \
220  --enable-shared \
221  --with-c-include-dirs=%{_includedir}:$(find %{_prefix}/lib/gcc/*/* \
222      -maxdepth 0 -type d)/include \
223%if %{__isa_bits} == 64
224  --with-cxx-include-32bit-dir=32 \
225%endif
226  --with-cxx-include-root=$(find %{_includedir}/c++/* -maxdepth 0 -type d) \
227  --with-cxx-include-arch=%{_target_cpu}-%{_vendor}-%{_os}
228 
229
230# FIXME file this
231# configure does not properly specify libdir
232sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}/%{name}|g' Makefile.config
233
234make %{_smp_mflags} REQUIRES_RTTI=1 \
235%ifarch ppc
236  OPTIMIZE_OPTION="%{optflags} -fno-var-tracking-assignments"
237%else
238  OPTIMIZE_OPTION="%{optflags}"
239%endif
240
241
242%install
243rm -rf %{buildroot}
244make install DESTDIR=%{buildroot} \
245     PROJ_docsdir=/moredocs
246
247# multilib fixes
248mv %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}}
249
250pushd %{buildroot}%{_includedir}/llvm/Config
251mv config.h config-%{__isa_bits}.h
252cp -p %{SOURCE2} config.h
253mv llvm-config.h llvm-config-%{__isa_bits}.h
254cp -p %{SOURCE3} llvm-config.h
255popd
256
257# Create ld.so.conf.d entry
258mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
259cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf << EOF
260%{_libdir}/llvm
261EOF
262
263# Static analyzer not installed by default:
264# http://clang-analyzer.llvm.org/installation#OtherPlatforms
265mkdir -p %{buildroot}%{_libdir}/clang-analyzer
266# create launchers
267for f in scan-{build,view}; do
268  ln -s %{_libdir}/clang-analyzer/$f/$f %{buildroot}%{_bindir}/$f
269done
270
271(cd tools/clang/tools && cp -pr scan-{build,view} \
272 %{buildroot}%{_libdir}/clang-analyzer/)
273
274
275# Move documentation back to build directory
276#
277mv %{buildroot}/moredocs .
278rm -f moredocs/*.tar.gz
279rm -f moredocs/ocamldoc/html/*.tar.gz
280
281# and separate the apidoc
282%if 0%{?_with_doxygen}
283mv moredocs/html/doxygen apidoc
284mv tools/clang/docs/doxygen/html clang-apidoc
285%endif
286
287# And prepare Clang documentation
288#
289mkdir clang-docs
290for f in LICENSE.TXT NOTES.txt README.txt TODO.txt; do
291  ln tools/clang/$f clang-docs/
292done
293rm -rf tools/clang/docs/{doxygen*,Makefile*,*.graffle,tools}
294
295
296#find %%{buildroot} -name .dir -print0 | xargs -0r rm -f
297file %{buildroot}/%{_bindir}/* | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
298file %{buildroot}/%{_libdir}/llvm/*.so | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
299#chrpath -d %%{buildroot}/%%{_libexecdir}/clang-cc
300
301# Get rid of erroneously installed example files.
302rm %{buildroot}%{_libdir}/%{name}/*LLVMHello.*
303
304# FIXME file this bug
305sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}/%{name}",' \
306  %{buildroot}%{_bindir}/llvm-config-%{__isa_bits}
307
308chmod -x %{buildroot}%{_libdir}/%{name}/*.a
309
310# remove documentation makefiles:
311# they require the build directory to work
312find examples -name 'Makefile' | xargs -0r rm -f
313
314
315%check
316make check 2>&1 | tee ../llvm-testlog.txt
317make -C tools/clang/test 2>&1 | tee ../llvm-testlog.txt
318
319
320%clean
321rm -rf %{buildroot}
322
323
324%post libs -p /sbin/ldconfig
325%post -n clang -p /sbin/ldconfig
326
327
328%postun libs -p /sbin/ldconfig
329%postun -n clang -p /sbin/ldconfig
330
331
332%posttrans devel
333# link llvm-config to the platform-specific file;
334# use ISA bits as priority so that 64-bit is preferred
335# over 32-bit if both are installed
336alternatives \
337  --install \
338  %{_bindir}/llvm-config \
339  llvm-config \
340  %{_bindir}/llvm-config-%{__isa_bits} \
341  %{__isa_bits}
342
343%postun devel
344if [ $1 -eq 0 ]; then
345  alternatives --remove llvm-config \
346    %{_bindir}/llvm-config-%{__isa_bits}
347fi
348exit 0
349
350
351%files
352%defattr(-,root,root,-)
353%doc CREDITS.TXT LICENSE.TXT README.txt
354%{_bindir}/bugpoint
355%{_bindir}/llc
356%{_bindir}/lli
357%exclude %{_bindir}/llvm-config-%{__isa_bits}
358%{_bindir}/llvm*
359%{_bindir}/macho-dump
360%{_bindir}/opt
361%exclude %{_mandir}/man1/clang.1.*
362%exclude %{_mandir}/man1/llvmg??.1.*
363%doc %{_mandir}/man1/*.1.*
364
365%files devel
366%defattr(-,root,root,-)
367%{_bindir}/llvm-config-%{__isa_bits}
368%{_includedir}/%{name}
369%{_includedir}/%{name}-c
370%{_libdir}/%{name}/*.a
371
372%files libs
373%defattr(-,root,root,-)
374%config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
375%dir %{_libdir}/%{name}
376%exclude %{_libdir}/%{name}/libclang.so
377%{_libdir}/%{name}/*.so
378
379%files -n clang
380%defattr(-,root,root,-)
381%doc clang-docs/*
382%{_bindir}/clang*
383#%{_bindir}/c-index-test
384%{_bindir}/tblgen
385%{_libdir}/%{name}/libclang.so
386%{_prefix}/lib/clang
387%doc %{_mandir}/man1/clang.1.*
388
389%files -n clang-devel
390%defattr(-,root,root,-)
391%{_includedir}/clang
392%{_includedir}/clang-c
393
394%files -n clang-analyzer
395%defattr(-,root,root,-)
396%{_bindir}/scan-build
397%{_bindir}/scan-view
398%{_libdir}/clang-analyzer
399
400%files -n clang-doc
401%defattr(-,root,root,-)
402%doc tools/clang/docs/*
403
404%files doc
405%defattr(-,root,root,-)
406%doc examples moredocs/html
407
408%files ocaml
409%defattr(-,root,root,-)
410%{_libdir}/ocaml/*.cma
411%{_libdir}/ocaml/*.cmi
412
413%files ocaml-devel
414%defattr(-,root,root,-)
415%{_libdir}/ocaml/*.a
416%{_libdir}/ocaml/*.cmx*
417%{_libdir}/ocaml/*.mli
418
419%files ocaml-doc
420%defattr(-,root,root,-)
421%doc moredocs/ocamldoc/html/*
422
423%if 0%{?_with_doxygen}
424%files apidoc
425%defattr(-,root,root,-)
426%doc apidoc/*
427
428%files -n clang-apidoc
429%defattr(-,root,root,-)
430%doc clang-apidoc/*
431%endif
432
433
434%changelog
435* Thu Aug 25 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.9-1
436- new upstream release
437- add BR: libffi-devel
438- add R: libffi-devel to -devel
439
440* Sun May 23 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7-1
441- initial build for Vine Linux
442
443* Sun May  2 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-1
444- Update to final 2.7 release
445
446* Sun Mar 28 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-0.1.pre1
447- Update to first 2.7 pre-release
448
449* Fri Sep 18 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.6.pre2
450- Update to 2.6 pre-release2
451- -devel subpackage now virtually provides -static
452
453* Wed Sep  9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.5.pre1
454- Disable var tracking assignments on PPC
455
456* Wed Sep  9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.4.pre1
457- Don't adjust clang include dir; files there are noarch (bz#521893)
458- Enable clang unit tests
459- clang and clang-analyzer renamed; no longer depend on llvm at runtime
460
461* Mon Sep  7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.3.pre1
462- Package Clang's static analyzer tools
463
464* Mon Sep  7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.2.pre1
465- PIC is now enabled by default; explicitly disable on %%{ix86}
466
467* Mon Sep  7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.1.pre1
468- First 2.6 prerelease
469- Enable Clang front-end
470- Enable debuginfo generation
471
472* Sat Sep  5 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-6
473- Disable assertions (needed by OpenGTL, bz#521261)
474- Align spec file with upstream build instructions
475- Enable unit tests
476
477* Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-5
478- Only disable PIC on %%ix86; ppc actually needs it
479
480* Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-4
481- Disable use of position-independent code on 32-bit platforms
482  (buggy in LLVM <= 2.5)
483
484* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-3
485- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
486
487* Wed Mar  4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-2
488- Remove build scripts; they require the build directory to work
489
490* Wed Mar  4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-1
491- Update to 2.5
492- Package build scripts (bug #457881)
493
494* Tue Dec  2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-2
495- Patched build process for the OCaml binding
496
497* Tue Dec  2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-1
498- Update to 2.4
499- Package Ocaml binding
500
501* Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-2
502- Add dependency on groff
503
504* Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-1
505- LLVM 2.3
506
507* Thu May 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2-4
508- fix license tags
509
510* Wed Mar  5 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.2-3
511- Fix compilation problems with gcc 4.3
512
513* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.2-2
514- Autorebuild for GCC 4.3
515
516* Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-2
517- Fix review comments
518
519* Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-1
520- Initial version
Note: See TracBrowser for help on using the repository browser.