]> git.pld-linux.org Git - packages/llvm.git/blame - llvm.spec
- release 2
[packages/llvm.git] / llvm.spec
CommitLineData
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 15Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
2326a99f 16Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
aa11c230 17Name: llvm
a7973f21 18Version: 2.9
0acc46f3 19Release: 2
aa11c230 20License: University of Illinois/NCSA Open Source License
21Group: Development/Languages
7e30fbbc 22Source0: http://llvm.org/releases/%{version}/%{name}-%{version}.tgz
a7973f21 23# Source0-md5: 793138412d2af2c7c7f54615f8943771
9556f4c9 24Source1: http://llvm.org/releases/%{version}/clang-%{version}.tgz
a7973f21 25# Source1-md5: 634de18d04b7a4ded19ec4c17d23cfca
d997b14b
AM
26# Data files should be installed with timestamps preserved
27Patch3: %{name}-2.6-timestamp.patch
ce9cc204 28Patch4: %{name}-pld.patch
2326a99f 29URL: http://llvm.org/
bc88141a 30BuildRequires: bash
d997b14b 31BuildRequires: bison
d997b14b 32BuildRequires: flex
9556f4c9
ER
33%if %{with apidocs}
34BuildRequires: doxygen
d997b14b 35BuildRequires: graphviz
9556f4c9
ER
36%endif
37%if %{with tests}
38BuildRequires: dejagnu
39BuildRequires: python
40BuildRequires: tcl-devel
41%endif
d997b14b 42BuildRequires: groff
bc88141a 43BuildRequires: libltdl-devel
d997b14b
AM
44BuildRequires: libstdc++-devel >= 5:3.4
45BuildRequires: ocaml-ocamldoc
8c156e7d 46BuildRequires: perl-tools-pod
47BuildRequires: rpm-pythonprov
356a0bbd
ER
48# gcc4 might be installed, but not current __cc
49%if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4"
50BuildRequires: __cc >= 3.4
51%endif
9556f4c9
ER
52# LLVM is not supported on PPC64
53# http://llvm.org/bugs/show_bug.cgi?id=3729
54ExcludeArch: ppc64
aa11c230 55BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56
356a0bbd 57%define _sysconfdir /etc/%{name}
021b3c3d 58
9556f4c9
ER
59%define specflags_ppc -fno-var-tracking-assignments
60
6832a5c5
ER
61# strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
62%define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
63
aa11c230 64%description
65LLVM is a compiler infrastructure designed for compile-time,
66link-time, runtime, and idle-time optimization of programs from
67arbitrary programming languages. LLVM is written in C++ and has been
68developed since 2000 at the University of Illinois and Apple. It
69currently supports compilation of C and C++ programs, using front-ends
70derived from GCC 4.0.1. A new front-end for the C family of languages
71is in development. The compiler infrastructure includes mirror sets of
72programming tools as well as libraries with equivalent functionality.
73
2326a99f
JB
74%description -l pl.UTF-8
75LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
76czasu kompilowania, linkowania, działania i bezczynności programów w
77dowolnych językach programowania. Jest napisana w C++, rozwijana od
78roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
79kompilację programów w C i C++ przy użyciu frontendów wywodzących się
80z GCC 4.0.1. W trakcie tworzenia jest nowy frontend do języków z
81rodziny C. Infrastruktura kompilatora zawiera lustrzane zestawy
82narzędzi programistycznych oraz biblioteki z odpowiadającą narzędziom
83funkcjonalnością.
84
bc88141a
ER
85%package devel
86Summary: Libraries and header files for LLVM
87Group: Development/Languages
88Requires: %{name} = %{version}-%{release}
89Requires: libstdc++-devel >= 6:3.4
90
91%description devel
92This package contains library and header files needed to develop new
93native programs that use the LLVM infrastructure.
94
9556f4c9
ER
95%package doc
96Summary: Documentation for LLVM
97Group: Documentation
98# does not require base
bc88141a 99
9556f4c9
ER
100%description doc
101Documentation for the LLVM compiler infrastructure.
bc88141a 102
9556f4c9
ER
103%package apidocs
104Summary: API documentation for LLVM
105Group: Development/Languages
106Requires: %{name}-doc = %{version}-%{release}
bc88141a 107
9556f4c9
ER
108%description apidocs
109API documentation for the LLVM compiler infrastructure.
bc88141a 110
d997b14b
AM
111%package -n clang
112Summary: A C language family frontend for LLVM
113License: NCSA
114Group: Development/Languages
115
116%description -n clang
117clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
118of a crane or goose. 3. C-language family front-end toolkit.
119
120The goal of the Clang project is to create a new C, C++, Objective C
121and Objective C++ front-end for the LLVM compiler. Its tools are built
122as libraries and designed to be loosely-coupled and extendable.
123
124%package -n clang-analyzer
125Summary: A source code analysis framework
126License: NCSA
127Group: Development/Languages
128Requires: clang = %{version}-%{release}
129# not picked up automatically since files are currently not instaled
130# in standard Python hierarchies yet
131Requires: python
132
133%description -n clang-analyzer
134The Clang Static Analyzer consists of both a source code analysis
135framework and a standalone tool that finds bugs in C and Objective-C
136programs. The standalone tool is invoked from the command-line, and is
137intended to run in tandem with a build of a project or code base.
138
9556f4c9
ER
139%package -n clang-devel
140Summary: Header files for clang
141Group: Development/Languages
142Requires: clang = %{version}-%{release}
143
144%description -n clang-devel
145This package contains header files for the Clang compiler.
146
147%package -n clang-doc
148Summary: Documentation for Clang
149Group: Documentation
150Requires: %{name} = %{version}-%{release}
151
152%description -n clang-doc
153Documentation for the Clang compiler front-end.
154
155%package -n clang-apidocs
156Summary: API documentation for Clang
157Group: Development/Languages
158Requires: clang-doc = %{version}-%{release}
159
160%description -n clang-apidocs
161API documentation for the Clang compiler.
162
163%package ocaml
164Summary: OCaml binding for LLVM
165Group: Development/Libraries
166Requires: %{name} = %{version}-%{release}
167%requires_eq ocaml-runtime
168
169%description ocaml
170OCaml binding for LLVM.
171
172%package ocaml-devel
173Summary: Development files for %{name}-ocaml
174Group: Development/Libraries
175Requires: %{name}-devel = %{version}-%{release}
176Requires: %{name}-ocaml = %{version}-%{release}
177
178%description ocaml-devel
179The llvm-ocaml-devel package contains libraries and signature files
180for developing applications that use llvm-ocaml.
181
182%package ocaml-doc
183Summary: Documentation for LLVM's OCaml binding
184Group: Documentation
185Requires: %{name}-ocaml = %{version}-%{release}
186
187%description ocaml-doc
188HTML documentation for LLVM's OCaml binding.
189
aa11c230 190%prep
d997b14b
AM
191%setup -q -a1
192mv clang-*.* tools/clang
9556f4c9 193%patch3 -p1
ce9cc204 194%patch4 -p1
195
196sed -i 's|triplet-plox-here|%{_host}|' tools/clang/lib/Driver/ToolChains.cpp
9556f4c9 197
19f21eee
PS
198# configure does not properly specify libdir
199sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}|g' Makefile.config.in
200
bacc8b96
ER
201grep -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
9556f4c9 206install -d obj
aa11c230 207
208%build
d997b14b 209# Disabling assertions now, rec. by pure and needed for OpenGTL
9556f4c9 210# TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
d997b14b 211#
bc88141a 212# bash specific 'test a < b'
9556f4c9 213cd obj
d997b14b 214bash ../%configure \
bc88141a
ER
215 --libdir=%{_libdir}/%{name} \
216 --datadir=%{_datadir}/%{name}-%{version} \
d997b14b
AM
217%ifarch %{ix86}
218 --enable-pic=no \
9556f4c9
ER
219%endif
220%if %{with apidocs}
221 --enable-doxygen \
d997b14b 222%endif
bc88141a 223 --disable-static \
d997b14b 224 --disable-assertions \
bc88141a
ER
225 --enable-debug-runtime \
226 --enable-jit \
aa11c230 227 --enable-optimized \
bc88141a
ER
228 --enable-shared \
229 --with-pic
230
d997b14b 231%{__make} \
0a0b7076 232 REQUIRES_RTTI=1 \
d997b14b 233 OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
aa11c230 234
9556f4c9
ER
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
aa11c230 240%install
241rm -rf $RPM_BUILD_ROOT
9556f4c9 242%{__make} -C obj -j1 install \
d997b14b 243 PROJ_docsdir=/moredocs \
aa11c230 244 DESTDIR=$RPM_BUILD_ROOT
245
d997b14b 246# Static analyzer not installed by default:
9556f4c9
ER
247# http://clang-analyzer.llvm.org/installation#OtherPlatforms
248install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
d997b14b
AM
249# create launchers
250for f in scan-{build,view}; do
9556f4c9
ER
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
d997b14b
AM
253done
254
d997b14b 255# Move documentation back to build directory
d997b14b
AM
256rm -rf moredocs
257mv $RPM_BUILD_ROOT/moredocs .
9556f4c9
ER
258rm -fv moredocs/*.tar.gz
259rm -fv moredocs/ocamldoc/html/*.tar.gz
260
261# and separate the apidoc
262%if %{with apidocs}
263rm -rf apidoc clang-apidoc
264mv moredocs/html/doxygen apidoc
265cp -a tools/clang/docs/doxygen/html clang-apidoc
266%endif
d997b14b
AM
267
268# And prepare Clang documentation
d997b14b 269rm -rf clang-docs
9556f4c9 270install -d clang-docs
d997b14b 271for f in LICENSE.TXT NOTES.txt README.txt TODO.txt; do
9556f4c9 272 ln tools/clang/$f clang-docs
d997b14b 273done
021b3c3d 274
6832a5c5 275# Get rid of erroneously installed example files.
19f21eee 276rm -v $RPM_BUILD_ROOT%{_libdir}/*LLVMHello.*
6832a5c5 277
d997b14b 278# FIXME file this bug
19f21eee 279sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}",' \
d997b14b 280 $RPM_BUILD_ROOT%{_bindir}/llvm-config
6832a5c5 281
d997b14b
AM
282# remove documentation makefiles:
283# they require the build directory to work
9556f4c9
ER
284rm -rf moredocs/examples
285cp -a examples moredocs/examples
286find moredocs/examples -name Makefile | xargs -0r rm -f
6832a5c5 287
aa11c230 288%clean
289rm -rf $RPM_BUILD_ROOT
290
2326a99f
JB
291%post -p /sbin/ldconfig
292%postun -p /sbin/ldconfig
aa11c230 293
294%files
295%defattr(644,root,root,755)
bc88141a 296%doc CREDITS.TXT LICENSE.TXT README.txt
9556f4c9 297%{?with_tests:%doc llvm-testlog.txt}
a9beeab5 298%attr(755,root,root) %{_bindir}/bugpoint
a9beeab5
JB
299%attr(755,root,root) %{_bindir}/llc
300%attr(755,root,root) %{_bindir}/lli
a9beeab5 301%attr(755,root,root) %{_bindir}/opt
a8575aac 302%attr(755,root,root) %{_bindir}/llvmc
bc88141a 303%attr(755,root,root) %{_bindir}/llvm-*
a7973f21 304%attr(755,root,root) %{_bindir}/macho-dump
bc88141a 305%exclude %attr(755,root,root) %{_bindir}/llvm-config
b3a27ca2 306%attr(755,root,root) %{_libdir}/libLLVM-*.*.so
a9beeab5 307%{_mandir}/man1/bugpoint.1*
a7973f21 308%{_mandir}/man1/lit.1*
a9beeab5
JB
309%{_mandir}/man1/llc.1*
310%{_mandir}/man1/lli.1*
311%{_mandir}/man1/llvm-*.1*
a7973f21 312%{_mandir}/man1/llvmc.1*
a9beeab5
JB
313%{_mandir}/man1/llvmgcc.1*
314%{_mandir}/man1/llvmgxx.1*
315%{_mandir}/man1/opt.1*
a8575aac 316#%{_mandir}/man1/stkrc.1*
bc88141a 317
bc88141a
ER
318%files devel
319%defattr(644,root,root,755)
320%attr(755,root,root) %{_bindir}/llvm-config
321%{_includedir}/llvm
322%{_includedir}/llvm-c
19f21eee 323%{_libdir}/lib*.a
1655c8b5
PS
324# x86-64 only .a/.so?
325%ifarch %{x8664}
0a8510f2 326%attr(755,root,root) %{_libdir}/BugpointPasses.so
19f21eee 327%attr(755,root,root) %{_libdir}/libEnhancedDisassembly.so
19f21eee 328%attr(755,root,root) %{_libdir}/libLTO.so
1655c8b5
PS
329%endif
330#
331%exclude %attr(755,root,root) %{_libdir}/libLLVM-*.*.so
b3a27ca2 332%exclude %attr(755,root,root) %{_libdir}/libclang.so
a7973f21 333%attr(755,root,root) %{_libdir}/profile_rt.so
bc88141a 334
9556f4c9
ER
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
d997b14b 345%files -n clang
bc88141a 346%defattr(644,root,root,755)
d997b14b 347%doc clang-docs/*
9556f4c9 348%{?with_tests:%doc clang-testlog.txt}
d997b14b 349%attr(755,root,root) %{_bindir}/clang*
d997b14b 350%attr(755,root,root) %{_bindir}/tblgen
b3a27ca2 351%attr(755,root,root) %{_libdir}/libclang.so
d997b14b 352%{_prefix}/lib/clang
d997b14b 353%{_mandir}/man1/clang.1.*
b3a27ca2 354%{_mandir}/man1/tblgen.1*
d997b14b
AM
355
356%files -n clang-analyzer
bc88141a 357%defattr(644,root,root,755)
d997b14b
AM
358%attr(755,root,root) %{_bindir}/scan-build
359%attr(755,root,root) %{_bindir}/scan-view
ae49e501 360%dir %{_libdir}/clang-analyzer
d997b14b 361
9556f4c9
ER
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}
d997b14b
AM
389%files ocaml
390%defattr(644,root,root,755)
d997b14b
AM
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
9556f4c9
ER
399
400%files ocaml-doc
401%defattr(644,root,root,755)
402%doc moredocs/ocamldoc/html/*
403%endif
This page took 0.076993 seconds and 4 git commands to generate.