2 # - gcc/c++ packages: http://cvs.fedoraproject.org/viewvc/rpms/llvm/devel/llvm.spec?revision=HEAD&view=markup
3 # - test gcc pkgs and all
5 %define lgcc_vertar 4.2
6 %define lgcc_version 4.2
7 Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
8 Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
12 License: University of Illinois/NCSA Open Source License
13 Group: Development/Languages
14 Source0: http://llvm.org/prereleases/%{version}/%{name}-%{version}.tar.gz
15 # Source0-md5: d4d2cfbb962eca0c96aa1d794e23a681
16 Source1: http://llvm.org/prereleases/2.6/clang-%{version}.tar.gz
17 # Source1-md5: 80a2a9bbe8fa7c403b2ec7aca8b4108f
18 # http://llvm.org/bugs/show_bug.cgi?id=3153
19 Patch0: %{name}-2.6-destdir.patch
20 Patch1: %{name}-2.6-destdir-clang.patch
21 # http://llvm.org/bugs/show_bug.cgi?id=4911
22 Patch2: %{name}-2.5-tclsh_check.patch
23 # Data files should be installed with timestamps preserved
24 Patch3: %{name}-2.6-timestamp.patch
28 BuildRequires: doxygen
30 BuildRequires: graphviz
32 BuildRequires: libltdl-devel
33 BuildRequires: libstdc++-devel >= 5:3.4
34 BuildRequires: ocaml-ocamldoc
35 # gcc4 might be installed, but not current __cc
36 %if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4"
37 BuildRequires: __cc >= 3.4
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 %define _sysconfdir /etc/%{name}
43 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
44 %define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
47 LLVM is a compiler infrastructure designed for compile-time,
48 link-time, runtime, and idle-time optimization of programs from
49 arbitrary programming languages. LLVM is written in C++ and has been
50 developed since 2000 at the University of Illinois and Apple. It
51 currently supports compilation of C and C++ programs, using front-ends
52 derived from GCC 4.0.1. A new front-end for the C family of languages
53 is in development. The compiler infrastructure includes mirror sets of
54 programming tools as well as libraries with equivalent functionality.
56 %description -l pl.UTF-8
57 LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
58 czasu kompilowania, linkowania, działania i bezczynności programów w
59 dowolnych językach programowania. Jest napisana w C++, rozwijana od
60 roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
61 kompilację programów w C i C++ przy użyciu frontendów wywodzących się
62 z GCC 4.0.1. W trakcie tworzenia jest nowy frontend do języków z
63 rodziny C. Infrastruktura kompilatora zawiera lustrzane zestawy
64 narzędzi programistycznych oraz biblioteki z odpowiadającą narzędziom
68 Summary: Documentation for LLVM
70 Requires: %{name} = %{version}-%{release}
73 Documentation for the LLVM compiler infrastructure.
76 Summary: Libraries and header files for LLVM
77 Group: Development/Languages
78 Requires: %{name} = %{version}-%{release}
79 Requires: libstdc++-devel >= 6:3.4
82 This package contains library and header files needed to develop new
83 native programs that use the LLVM infrastructure.
86 Summary: OCaml binding for LLVM
87 Group: Development/Libraries
88 Requires: %{name} = %{version}-%{release}
89 %requires_eq ocaml-runtime
92 OCaml binding for LLVM.
95 Summary: Development files for %{name}-ocaml
96 Group: Development/Libraries
97 Requires: %{name}-devel = %{version}-%{release}
98 Requires: %{name}-ocaml = %{version}-%{release}
100 %description ocaml-devel
101 The %{name}-ocaml-devel package contains libraries and signature files
102 for developing applications that use %{name}-ocaml.
105 Summary: A C language family frontend for LLVM
107 Group: Development/Languages
109 %description -n clang
110 clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
111 of a crane or goose. 3. C-language family front-end toolkit.
113 The goal of the Clang project is to create a new C, C++, Objective C
114 and Objective C++ front-end for the LLVM compiler. Its tools are built
115 as libraries and designed to be loosely-coupled and extendable.
117 %package -n clang-analyzer
118 Summary: A source code analysis framework
120 Group: Development/Languages
121 Requires: clang = %{version}-%{release}
122 # not picked up automatically since files are currently not instaled
123 # in standard Python hierarchies yet
126 %description -n clang-analyzer
127 The Clang Static Analyzer consists of both a source code analysis
128 framework and a standalone tool that finds bugs in C and Objective-C
129 programs. The standalone tool is invoked from the command-line, and is
130 intended to run in tandem with a build of a project or code base.
134 mv clang-*.* tools/clang
135 %patch0 -p0 -b .destdir
137 %patch1 -p0 -b .destdir-clang
139 %patch2 -p1 -b .tclsh_check
140 %patch3 -p1 -b .timestamp
143 # Disabling assertions now, rec. by pure and needed for OpenGTL
144 # no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3239
146 # bash specific 'test a < b'
149 --libdir=%{_libdir}/%{name} \
150 --datadir=%{_datadir}/%{name}-%{version} \
155 --disable-assertions \
156 --enable-debug-runtime \
163 # configure does not properly specify libdir
164 sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}/%{name}|g' Makefile.config
167 OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
170 rm -rf $RPM_BUILD_ROOT
173 chmod -x examples/Makefile
175 %{__make} -j1 install \
176 PROJ_docsdir=/moredocs \
177 DESTDIR=$RPM_BUILD_ROOT
180 # Static analyzer not installed by default:
181 # http://clang-analyzer.llvm.org/installation#OtherPlatforms
182 install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/libexec
184 install -d $RPM_BUILD_ROOT%{_libexecdir}
185 mv $RPM_BUILD_ROOT/usr/libexec/clang-cc $RPM_BUILD_ROOT%{_libexecdir}/clang-cc
186 # link clang-cc for scan-build to find
187 ln -s %{_libexecdir}/clang-cc $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/libexec/
189 for f in scan-{build,view}; do
190 ln -s %{_libdir}/clang-analyzer/$f $RPM_BUILD_ROOT%{_bindir}/$f
194 cp -p ccc-analyzer $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/libexec/
196 for f in scan-build scanview.css sorttable.js; do
197 cp -p $f $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/
201 cd tools/clang/tools/scan-view
202 cp -pr * $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/
205 # Move documentation back to build directory
208 mv $RPM_BUILD_ROOT/moredocs .
210 #rm moredocs/ocamldoc/html/*.tar.gz
212 # And prepare Clang documentation
216 for f in LICENSE.TXT NOTES.txt README.txt TODO.txt; do
217 ln tools/clang/$f clang-docs/
219 #rm -rf tools/clang/docs/{doxygen*,Makefile*,*.graffle,tools}
221 # Get rid of erroneously installed example files.
222 rm $RPM_BUILD_ROOT%{_libdir}/%{name}/*LLVMHello.*
224 # Remove deprecated tools.
225 rm $RPM_BUILD_ROOT%{_bindir}/gcc{as,ld}
227 # FIXME file this bug
228 sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}/%{name}",' \
229 $RPM_BUILD_ROOT%{_bindir}/llvm-config
231 chmod -x $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a
233 # remove documentation makefiles:
234 # they require the build directory to work
235 find examples -name 'Makefile' | xargs -0r rm -f
238 rm -rf $RPM_BUILD_ROOT
240 %post -p /sbin/ldconfig
241 %postun -p /sbin/ldconfig
244 %defattr(644,root,root,755)
245 %doc CREDITS.TXT LICENSE.TXT README.txt
246 %attr(755,root,root) %{_bindir}/bugpoint
247 %attr(755,root,root) %{_bindir}/llc
248 %attr(755,root,root) %{_bindir}/lli
249 %attr(755,root,root) %{_bindir}/opt
250 %attr(755,root,root) %{_bindir}/llvmc
251 %attr(755,root,root) %{_bindir}/llvm-*
252 %exclude %attr(755,root,root) %{_bindir}/llvm-config
253 %{_mandir}/man1/bugpoint.1*
254 %{_mandir}/man1/llc.1*
255 %{_mandir}/man1/lli.1*
256 %{_mandir}/man1/llvmc.1*
257 %{_mandir}/man1/llvm-*.1*
258 %{_mandir}/man1/llvmgcc.1*
259 %{_mandir}/man1/llvmgxx.1*
260 %{_mandir}/man1/opt.1*
261 #%{_mandir}/man1/stkrc.1*
262 %{_mandir}/man1/tblgen.1*
265 %defattr(644,root,root,755)
266 %doc docs/*.{html,css} docs/img examples moredocs/html
269 %defattr(644,root,root,755)
271 %attr(755,root,root) %{_bindir}/llvm-config
273 %{_includedir}/llvm-c
277 %defattr(644,root,root,755)
279 %doc tools/clang/docs/*
280 %attr(755,root,root) %{_bindir}/clang*
281 %attr(755,root,root) %{_bindir}/FileCheck
282 %attr(755,root,root) %{_bindir}/FileUpdate
283 %attr(755,root,root) %{_bindir}/tblgen
285 %{_libexecdir}/clang-cc
286 %{_mandir}/man1/clang.1.*
287 %{_mandir}/man1/FileCheck.1.*
289 %files -n clang-analyzer
290 %defattr(644,root,root,755)
291 %attr(755,root,root) %{_bindir}/scan-build
292 %attr(755,root,root) %{_bindir}/scan-view
293 %dir %{_libdir}/clang-analyzer
294 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-*
295 %{_libdir}/clang-analyzer/*.*
296 %dir %{_libdir}/clang-analyzer/libexec
297 %attr(755,root,root) %{_libdir}/clang-analyzer/libexec/*
298 %{_libdir}/clang-analyzer/Resource
301 %defattr(644,root,root,755)
302 %doc moredocs/ocamldoc/html/*
303 %{_libdir}/ocaml/*.cma
304 %{_libdir}/ocaml/*.cmi
307 %defattr(644,root,root,755)
309 %{_libdir}/ocaml/*.cmx*
310 %{_libdir}/ocaml/*.mli