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

Revision 9121, 16.1 KB checked in by Takemikaduchi, 9 years ago (diff)

llvm: fix BTS:2832
others: add Group tag

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