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