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