]> git.pld-linux.org Git - packages/llvm.git/blame - llvm.spec
- updated to 3.0, fixed bcond tests, fixed build without ocaml.
[packages/llvm.git] / llvm.spec
CommitLineData
bc88141a 1#
827664e9
PS
2# TODO:
3# make *** No rule to make target (...)/rpm/BUILD/llvm-3.0.src/obj/bindings/ocaml/llvm/Release/META.llvm, needed by install-meta.
4#
9556f4c9
ER
5# Conditional build:
6%bcond_without ocaml # ocaml binding
8132e62b
JB
7%bcond_with apidocs # The doxygen docs are HUGE, so they are not built by default.
8%bcond_with tests # run tests
9556f4c9
ER
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
827664e9
PS
18Version: 3.0
19Release: 0.1
aa11c230 20License: University of Illinois/NCSA Open Source License
21Group: Development/Languages
827664e9
PS
22Source0: http://llvm.org/releases/%{version}/%{name}-%{version}.tar.gz
23# Source0-md5: a8e5f5f1c1adebae7b4a654c376a6005
24Source1: http://llvm.org/releases/%{version}/clang-%{version}.tar.gz
25# Source1-md5: 43350706ae6cf05d0068885792ea0591
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
8132e62b 46BuildRequires: perl-base >= 1:5.6
8c156e7d 47BuildRequires: perl-tools-pod
48BuildRequires: rpm-pythonprov
356a0bbd
ER
49# gcc4 might be installed, but not current __cc
50%if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4"
51BuildRequires: __cc >= 3.4
52%endif
9556f4c9
ER
53# LLVM is not supported on PPC64
54# http://llvm.org/bugs/show_bug.cgi?id=3729
55ExcludeArch: ppc64
aa11c230 56BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
356a0bbd 58%define _sysconfdir /etc/%{name}
021b3c3d 59
9556f4c9
ER
60%define specflags_ppc -fno-var-tracking-assignments
61
6832a5c5
ER
62# strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
63%define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
64
aa11c230 65%description
66LLVM is a compiler infrastructure designed for compile-time,
67link-time, runtime, and idle-time optimization of programs from
68arbitrary programming languages. LLVM is written in C++ and has been
69developed since 2000 at the University of Illinois and Apple. It
621ec11f
JB
70currently supports compilation of C and C++ programs using clang
71frontend.
aa11c230 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
621ec11f 78kompilację programów w C i C++ przy użyciu frontendu clang.
2326a99f 79
bc88141a 80%package devel
621ec11f
JB
81Summary: Static libraries and header files for LLVM
82Summary(pl.UTF-8): Biblioteki statyczne i pliki nagłówkowe dla LLVM-a
bc88141a
ER
83Group: Development/Languages
84Requires: %{name} = %{version}-%{release}
85Requires: libstdc++-devel >= 6:3.4
86
87%description devel
621ec11f
JB
88This package contains static libraries and header files needed to
89develop new native programs that use the LLVM infrastructure.
90
91%description devel -l pl.UTF-8
92Ten pakiet zawiera biblioteki statyczne oraz pliki nagłówkowe
93potrzebne do tworzenia nowych programów natywnych wykorzystujących
94infrastrukturę LLVM.
bc88141a 95
9556f4c9
ER
96%package doc
97Summary: Documentation for LLVM
621ec11f 98Summary(pl.UTF-8): Dokumentacja do LLVM-a
9556f4c9
ER
99Group: Documentation
100# does not require base
bc88141a 101
9556f4c9
ER
102%description doc
103Documentation for the LLVM compiler infrastructure.
bc88141a 104
621ec11f
JB
105%description doc -l pl.UTF-8
106Dokumentacja do infrastruktury kompilatorów LLVM.
107
9556f4c9
ER
108%package apidocs
109Summary: API documentation for LLVM
621ec11f 110Summary(pl.UTF-8): Dokumentacja API LLVM-a
9556f4c9
ER
111Group: Development/Languages
112Requires: %{name}-doc = %{version}-%{release}
bc88141a 113
9556f4c9
ER
114%description apidocs
115API documentation for the LLVM compiler infrastructure.
bc88141a 116
621ec11f
JB
117%description apidocs -l pl.UTF-8
118Dokumentacja API infrastruktury kompilatorów LLVM.
119
d997b14b
AM
120%package -n clang
121Summary: A C language family frontend for LLVM
621ec11f 122Summary(pl.UTF-8): Frontend LLVM-a do języków z rodziny C
d997b14b
AM
123License: NCSA
124Group: Development/Languages
125
126%description -n clang
127clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
128of a crane or goose. 3. C-language family front-end toolkit.
129
130The goal of the Clang project is to create a new C, C++, Objective C
131and Objective C++ front-end for the LLVM compiler. Its tools are built
132as libraries and designed to be loosely-coupled and extendable.
133
621ec11f
JB
134%description -n clang -l pl.UTF-8
135clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
136piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
137z rodziny C.
138
139Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
140LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
141budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
142i rozszerzaniu.
143
d997b14b
AM
144%package -n clang-analyzer
145Summary: A source code analysis framework
621ec11f 146Summary(pl.UTF-8): Szkielet do analizy kodu źródłowego
d997b14b
AM
147License: NCSA
148Group: Development/Languages
149Requires: clang = %{version}-%{release}
150# not picked up automatically since files are currently not instaled
151# in standard Python hierarchies yet
152Requires: python
153
154%description -n clang-analyzer
155The Clang Static Analyzer consists of both a source code analysis
156framework and a standalone tool that finds bugs in C and Objective-C
157programs. The standalone tool is invoked from the command-line, and is
158intended to run in tandem with a build of a project or code base.
159
621ec11f
JB
160%description -n clang-analyzer -l pl.UTF-8
161Clang Static Analyzer składa się ze szkieletu do analizy kodu
162źródłowego oraz samodzielnego narzędzia znajdującego błędy w
163programach w C i C++. Narzędzie jest wywoływane z linii poleceń, z
164myślą o uruchamianiu wraz z kompilacją projektu lub kodu.
165
9556f4c9 166%package -n clang-devel
621ec11f
JB
167Summary: Header files for Clang
168Summary(pl.UTF-8): Pliki nagłówkowe Clanga
9556f4c9
ER
169Group: Development/Languages
170Requires: clang = %{version}-%{release}
171
172%description -n clang-devel
173This package contains header files for the Clang compiler.
174
621ec11f
JB
175%description -n clang-devel -l pl.UTF-8
176Ten pakiet zawiera pliki nagłówkowe kompilatora Clang.
177
9556f4c9
ER
178%package -n clang-doc
179Summary: Documentation for Clang
621ec11f 180Summary(pl.UTF-8): Dokumentacja do Clanga
9556f4c9
ER
181Group: Documentation
182Requires: %{name} = %{version}-%{release}
183
184%description -n clang-doc
185Documentation for the Clang compiler front-end.
186
621ec11f
JB
187%description -n clang-doc -l pl.UTF-8
188Dokumentacja do frontendu kompilatora Clang.
189
9556f4c9
ER
190%package -n clang-apidocs
191Summary: API documentation for Clang
621ec11f 192Summary(pl.UTF-8): Dokumentacja API Clanga
9556f4c9
ER
193Group: Development/Languages
194Requires: clang-doc = %{version}-%{release}
195
196%description -n clang-apidocs
197API documentation for the Clang compiler.
198
621ec11f
JB
199%description -n clang-apidocs -l pl.UTF-8
200Dokumentacja API kompilatora Clang.
201
9556f4c9
ER
202%package ocaml
203Summary: OCaml binding for LLVM
621ec11f
JB
204Summary(pl.UTF-8): Wiązanie OCamla do LLVM-a
205Group: Libraries
9556f4c9
ER
206Requires: %{name} = %{version}-%{release}
207%requires_eq ocaml-runtime
208
621ec11f 209%description ocaml
9556f4c9
ER
210OCaml binding for LLVM.
211
621ec11f
JB
212%description ocaml -l pl.UTF-8
213Wiązanie OCamla do LLVM-a.
214
9556f4c9 215%package ocaml-devel
621ec11f
JB
216Summary: Development files for LLVM OCaml binding
217Summary(pl.UTF-8): Pliki programistyczne wiązania OCamla do LLVM-a
9556f4c9
ER
218Group: Development/Libraries
219Requires: %{name}-devel = %{version}-%{release}
220Requires: %{name}-ocaml = %{version}-%{release}
221
222%description ocaml-devel
223The llvm-ocaml-devel package contains libraries and signature files
621ec11f
JB
224for developing applications that use llvm-ocaml binding.
225
226%description ocaml-devel -l pl.UTF-8
227Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji
228wykorzystujących wiązanie llvm-ocaml.
229
9556f4c9
ER
230
231%package ocaml-doc
232Summary: Documentation for LLVM's OCaml binding
621ec11f 233Summary(pl.UTF-8): Dokumentacja wiązania OCamla do LLVM-a
9556f4c9
ER
234Group: Documentation
235Requires: %{name}-ocaml = %{version}-%{release}
236
237%description ocaml-doc
238HTML documentation for LLVM's OCaml binding.
239
621ec11f
JB
240%description ocaml-doc -l pl.UTF-8
241Dokumentacja HTML wiązania OCamla do LLVM-a.
242
aa11c230 243%prep
827664e9 244%setup -q -a1 -n %{name}-%{version}.src
d997b14b 245mv clang-*.* tools/clang
9556f4c9 246%patch3 -p1
ce9cc204 247%patch4 -p1
248
19f21eee
PS
249# configure does not properly specify libdir
250sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}|g' Makefile.config.in
251
bacc8b96
ER
252grep -rl /usr/bin/env tools utils | xargs sed -i -e '1{
253 s,^#!.*bin/env python,#!%{__python},
254 s,^#!.*bin/env perl,#!%{__perl},
255}'
256
9556f4c9 257install -d obj
aa11c230 258
259%build
d997b14b 260# Disabling assertions now, rec. by pure and needed for OpenGTL
9556f4c9 261# TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
d997b14b 262#
bc88141a 263# bash specific 'test a < b'
9556f4c9 264cd obj
d997b14b 265bash ../%configure \
bc88141a
ER
266 --libdir=%{_libdir}/%{name} \
267 --datadir=%{_datadir}/%{name}-%{version} \
d997b14b
AM
268%ifarch %{ix86}
269 --enable-pic=no \
9556f4c9
ER
270%endif
271%if %{with apidocs}
272 --enable-doxygen \
d997b14b 273%endif
827664e9 274 --enable-bindings=%{?with_ocaml:ocaml}%{!?with_ocaml:none} \
bc88141a 275 --disable-static \
d997b14b 276 --disable-assertions \
bc88141a
ER
277 --enable-debug-runtime \
278 --enable-jit \
aa11c230 279 --enable-optimized \
bc88141a
ER
280 --enable-shared \
281 --with-pic
282
d997b14b 283%{__make} \
0a0b7076 284 REQUIRES_RTTI=1 \
d997b14b 285 OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
aa11c230 286
827664e9 287%if %{with tests}
9556f4c9
ER
288%{__make} check 2>&1 | tee llvm-testlog.txt
289%{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt
290%endif
291
aa11c230 292%install
293rm -rf $RPM_BUILD_ROOT
9556f4c9 294%{__make} -C obj -j1 install \
d997b14b 295 PROJ_docsdir=/moredocs \
aa11c230 296 DESTDIR=$RPM_BUILD_ROOT
297
d997b14b 298# Static analyzer not installed by default:
9556f4c9
ER
299# http://clang-analyzer.llvm.org/installation#OtherPlatforms
300install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
d997b14b
AM
301# create launchers
302for f in scan-{build,view}; do
9556f4c9
ER
303 ln -s %{_libdir}/clang-analyzer/$f/$f $RPM_BUILD_ROOT%{_bindir}/$f
304 cp -pr tools/clang/tools/$f $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
d997b14b 305done
8132e62b
JB
306%py_comp $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-view
307%py_ocomp $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-view
308%py_postclean %{_libdir}/clang-analyzer/scan-view
d997b14b 309
d997b14b 310# Move documentation back to build directory
d997b14b
AM
311rm -rf moredocs
312mv $RPM_BUILD_ROOT/moredocs .
9556f4c9
ER
313rm -fv moredocs/*.tar.gz
314rm -fv moredocs/ocamldoc/html/*.tar.gz
315
316# and separate the apidoc
317%if %{with apidocs}
318rm -rf apidoc clang-apidoc
319mv moredocs/html/doxygen apidoc
320cp -a tools/clang/docs/doxygen/html clang-apidoc
321%endif
d997b14b
AM
322
323# And prepare Clang documentation
d997b14b 324rm -rf clang-docs
9556f4c9 325install -d clang-docs
827664e9 326for f in LICENSE.TXT NOTES.txt README.txt; do
9556f4c9 327 ln tools/clang/$f clang-docs
d997b14b 328done
021b3c3d 329
6832a5c5 330# Get rid of erroneously installed example files.
19f21eee 331rm -v $RPM_BUILD_ROOT%{_libdir}/*LLVMHello.*
6832a5c5 332
d997b14b 333# FIXME file this bug
19f21eee 334sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}",' \
d997b14b 335 $RPM_BUILD_ROOT%{_bindir}/llvm-config
6832a5c5 336
d997b14b
AM
337# remove documentation makefiles:
338# they require the build directory to work
9556f4c9
ER
339rm -rf moredocs/examples
340cp -a examples moredocs/examples
341find moredocs/examples -name Makefile | xargs -0r rm -f
6832a5c5 342
aa11c230 343%clean
344rm -rf $RPM_BUILD_ROOT
345
2326a99f
JB
346%post -p /sbin/ldconfig
347%postun -p /sbin/ldconfig
aa11c230 348
349%files
350%defattr(644,root,root,755)
8132e62b 351%doc CREDITS.TXT LICENSE.TXT README.txt %{?with_tests:llvm-testlog.txt}
a9beeab5 352%attr(755,root,root) %{_bindir}/bugpoint
a9beeab5
JB
353%attr(755,root,root) %{_bindir}/llc
354%attr(755,root,root) %{_bindir}/lli
8132e62b
JB
355%attr(755,root,root) %{_bindir}/llvm-ar
356%attr(755,root,root) %{_bindir}/llvm-as
357%attr(755,root,root) %{_bindir}/llvm-bcanalyzer
827664e9 358%attr(755,root,root) %{_bindir}/llvm-cov
8132e62b
JB
359%attr(755,root,root) %{_bindir}/llvm-diff
360%attr(755,root,root) %{_bindir}/llvm-dis
827664e9 361%attr(755,root,root) %{_bindir}/llvm-dwarfdump
8132e62b
JB
362%attr(755,root,root) %{_bindir}/llvm-extract
363%attr(755,root,root) %{_bindir}/llvm-ld
364%attr(755,root,root) %{_bindir}/llvm-link
365%attr(755,root,root) %{_bindir}/llvm-mc
366%attr(755,root,root) %{_bindir}/llvm-nm
367%attr(755,root,root) %{_bindir}/llvm-objdump
368%attr(755,root,root) %{_bindir}/llvm-prof
369%attr(755,root,root) %{_bindir}/llvm-ranlib
827664e9
PS
370%attr(755,root,root) %{_bindir}/llvm-rtdyld
371%attr(755,root,root) %{_bindir}/llvm-size
8132e62b 372%attr(755,root,root) %{_bindir}/llvm-stub
827664e9 373%attr(755,root,root) %{_bindir}/llvm-tblgen
a7973f21 374%attr(755,root,root) %{_bindir}/macho-dump
8132e62b
JB
375%attr(755,root,root) %{_bindir}/opt
376%attr(755,root,root) %{_libdir}/libLLVM-%{version}.so
a9beeab5 377%{_mandir}/man1/bugpoint.1*
a7973f21 378%{_mandir}/man1/lit.1*
a9beeab5
JB
379%{_mandir}/man1/llc.1*
380%{_mandir}/man1/lli.1*
8132e62b
JB
381%{_mandir}/man1/llvm-ar.1*
382%{_mandir}/man1/llvm-as.1*
383%{_mandir}/man1/llvm-bcanalyzer.1*
384%{_mandir}/man1/llvm-diff.1*
385%{_mandir}/man1/llvm-dis.1*
386%{_mandir}/man1/llvm-extract.1*
387%{_mandir}/man1/llvm-ld.1*
388%{_mandir}/man1/llvm-link.1*
389%{_mandir}/man1/llvm-nm.1*
390%{_mandir}/man1/llvm-prof.1*
391%{_mandir}/man1/llvm-ranlib.1*
a9beeab5 392%{_mandir}/man1/opt.1*
bc88141a 393
bc88141a
ER
394%files devel
395%defattr(644,root,root,755)
396%attr(755,root,root) %{_bindir}/llvm-config
827664e9 397%attr(755,root,root) %{_libdir}/libprofile_rt.so
8132e62b 398%{_libdir}/libLLVM*.a
827664e9 399%{_libdir}/libprofile_rt.a
1655c8b5 400%ifarch %{x8664}
0a8510f2 401%attr(755,root,root) %{_libdir}/BugpointPasses.so
19f21eee 402%attr(755,root,root) %{_libdir}/libLTO.so
8132e62b
JB
403%{_libdir}/libEnhancedDisassembly.a
404%{_libdir}/libLTO.a
1655c8b5 405%endif
8132e62b
JB
406%{_includedir}/llvm
407%{_includedir}/llvm-c
408%{_mandir}/man1/llvm-config.1*
bc88141a 409
9556f4c9
ER
410%files doc
411%defattr(644,root,root,755)
412%doc moredocs/examples moredocs/html
413
414%if %{with apidocs}
415%files apidocs
416%defattr(644,root,root,755)
417%doc apidoc/*
418%endif
419
d997b14b 420%files -n clang
bc88141a 421%defattr(644,root,root,755)
827664e9 422%doc clang-docs/{LICENSE.TXT,NOTES.txt,README.txt} %{?with_tests:clang-testlog.txt}
8132e62b
JB
423%attr(755,root,root) %{_bindir}/clang
424%attr(755,root,root) %{_bindir}/clang++
827664e9 425%attr(755,root,root) %{_bindir}/clang-tblgen
b3a27ca2 426%attr(755,root,root) %{_libdir}/libclang.so
d997b14b 427%{_prefix}/lib/clang
8132e62b 428%{_mandir}/man1/clang.1*
b3a27ca2 429%{_mandir}/man1/tblgen.1*
d997b14b
AM
430
431%files -n clang-analyzer
bc88141a 432%defattr(644,root,root,755)
d997b14b
AM
433%attr(755,root,root) %{_bindir}/scan-build
434%attr(755,root,root) %{_bindir}/scan-view
ae49e501 435%dir %{_libdir}/clang-analyzer
d997b14b 436
9556f4c9
ER
437%dir %{_libdir}/clang-analyzer/scan-build
438%{_libdir}/clang-analyzer/scan-build/*.css
439%{_libdir}/clang-analyzer/scan-build/*.js
440%attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/scan-build
441%attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/*-analyzer
442
8132e62b
JB
443%dir %{_libdir}/clang-analyzer/scan-view
444%attr(755,root,root) %{_libdir}/clang-analyzer/scan-view/scan-view
445%{_libdir}/clang-analyzer/scan-view/Resources
446%{_libdir}/clang-analyzer/scan-view/*.py[co]
447
9556f4c9
ER
448%files -n clang-devel
449%defattr(644,root,root,755)
8132e62b 450%{_libdir}/libclang*.a
9556f4c9
ER
451%{_includedir}/clang
452%{_includedir}/clang-c
453
454%files -n clang-doc
455%defattr(644,root,root,755)
8132e62b 456%doc tools/clang/docs/*.{css,html,png,txt}
9556f4c9
ER
457
458%if %{with apidocs}
459%files -n clang-apidocs
460%defattr(644,root,root,755)
461%doc clang-apidoc/*
462%endif
463
464%if %{with ocaml}
d997b14b
AM
465%files ocaml
466%defattr(644,root,root,755)
8132e62b
JB
467%{_libdir}/ocaml/llvm*.cma
468%{_libdir}/ocaml/llvm*.cmi
d997b14b
AM
469
470%files ocaml-devel
471%defattr(644,root,root,755)
8132e62b
JB
472%{_libdir}/ocaml/libLLVM*.a
473%{_libdir}/ocaml/libllvm*.a
474%{_libdir}/ocaml/llvm*.a
475%{_libdir}/ocaml/llvm*.cmx*
476%{_libdir}/ocaml/llvm*.mli
9556f4c9
ER
477
478%files ocaml-doc
479%defattr(644,root,root,755)
480%doc moredocs/ocamldoc/html/*
481%endif
This page took 0.136103 seconds and 4 git commands to generate.