]>
Commit | Line | Data |
---|---|---|
bc88141a ER |
1 | # TODO |
2 | # - gcc/c++ packages: http://cvs.fedoraproject.org/viewvc/rpms/llvm/devel/llvm.spec?revision=HEAD&view=markup | |
6832a5c5 | 3 | # - test gcc pkgs and all |
bc88141a | 4 | # |
6832a5c5 | 5 | %define lgcc_vertar 4.2 |
d997b14b | 6 | %define lgcc_version 4.2 |
aa11c230 | 7 | Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure) |
2326a99f | 8 | Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego) |
aa11c230 | 9 | Name: llvm |
d997b14b | 10 | Version: 2.6 |
aa11c230 | 11 | Release: 0.1 |
12 | License: University of Illinois/NCSA Open Source License | |
13 | Group: Development/Languages | |
d997b14b AM |
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 | |
2326a99f | 25 | URL: http://llvm.org/ |
bc88141a | 26 | BuildRequires: bash |
d997b14b AM |
27 | BuildRequires: bison |
28 | BuildRequires: doxygen | |
29 | BuildRequires: flex | |
30 | BuildRequires: graphviz | |
31 | BuildRequires: groff | |
bc88141a | 32 | BuildRequires: libltdl-devel |
d997b14b AM |
33 | BuildRequires: libstdc++-devel >= 5:3.4 |
34 | BuildRequires: ocaml-ocamldoc | |
356a0bbd ER |
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 | |
38 | %endif | |
aa11c230 | 39 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
40 | ||
356a0bbd | 41 | %define _sysconfdir /etc/%{name} |
021b3c3d | 42 | |
6832a5c5 ER |
43 | # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ... |
44 | %define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\) | |
45 | ||
aa11c230 | 46 | %description |
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. | |
55 | ||
2326a99f JB |
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 | |
65 | funkcjonalnością. | |
66 | ||
bc88141a ER |
67 | %package doc |
68 | Summary: Documentation for LLVM | |
69 | Group: Documentation | |
70 | Requires: %{name} = %{version}-%{release} | |
71 | ||
72 | %description doc | |
73 | Documentation for the LLVM compiler infrastructure. | |
74 | ||
75 | %package devel | |
76 | Summary: Libraries and header files for LLVM | |
77 | Group: Development/Languages | |
78 | Requires: %{name} = %{version}-%{release} | |
79 | Requires: libstdc++-devel >= 6:3.4 | |
80 | ||
81 | %description devel | |
82 | This package contains library and header files needed to develop new | |
83 | native programs that use the LLVM infrastructure. | |
84 | ||
bc88141a ER |
85 | %package ocaml |
86 | Summary: OCaml binding for LLVM | |
87 | Group: Development/Libraries | |
88 | Requires: %{name} = %{version}-%{release} | |
89 | %requires_eq ocaml-runtime | |
90 | ||
91 | %description ocaml | |
92 | OCaml binding for LLVM. | |
93 | ||
94 | %package ocaml-devel | |
95 | Summary: Development files for %{name}-ocaml | |
96 | Group: Development/Libraries | |
97 | Requires: %{name}-devel = %{version}-%{release} | |
98 | Requires: %{name}-ocaml = %{version}-%{release} | |
99 | ||
100 | %description ocaml-devel | |
101 | The %{name}-ocaml-devel package contains libraries and signature files | |
102 | for developing applications that use %{name}-ocaml. | |
103 | ||
d997b14b AM |
104 | %package -n clang |
105 | Summary: A C language family frontend for LLVM | |
106 | License: NCSA | |
107 | Group: Development/Languages | |
108 | ||
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. | |
112 | ||
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. | |
116 | ||
117 | %package -n clang-analyzer | |
118 | Summary: A source code analysis framework | |
119 | License: NCSA | |
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 | |
124 | Requires: python | |
125 | ||
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. | |
131 | ||
aa11c230 | 132 | %prep |
d997b14b AM |
133 | %setup -q -a1 |
134 | mv clang-*.* tools/clang | |
135 | %patch0 -p0 -b .destdir | |
136 | cd tools/clang | |
137 | %patch1 -p0 -b .destdir-clang | |
138 | cd ../.. | |
139 | %patch2 -p1 -b .tclsh_check | |
140 | %patch3 -p1 -b .timestamp | |
aa11c230 | 141 | |
142 | %build | |
d997b14b AM |
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 | |
145 | # | |
bc88141a | 146 | # bash specific 'test a < b' |
d997b14b AM |
147 | mkdir obj && cd obj |
148 | bash ../%configure \ | |
bc88141a ER |
149 | --libdir=%{_libdir}/%{name} \ |
150 | --datadir=%{_datadir}/%{name}-%{version} \ | |
d997b14b AM |
151 | %ifarch %{ix86} |
152 | --enable-pic=no \ | |
153 | %endif | |
bc88141a | 154 | --disable-static \ |
d997b14b | 155 | --disable-assertions \ |
bc88141a ER |
156 | --enable-debug-runtime \ |
157 | --enable-jit \ | |
aa11c230 | 158 | --enable-optimized \ |
bc88141a ER |
159 | --enable-shared \ |
160 | --with-pic | |
161 | ||
d997b14b AM |
162 | # FIXME file this |
163 | # configure does not properly specify libdir | |
164 | sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}/%{name}|g' Makefile.config | |
bc88141a | 165 | |
d997b14b AM |
166 | %{__make} \ |
167 | OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}" | |
aa11c230 | 168 | |
169 | %install | |
170 | rm -rf $RPM_BUILD_ROOT | |
171 | ||
d997b14b AM |
172 | cd obj |
173 | chmod -x examples/Makefile | |
174 | ||
175 | %{__make} -j1 install \ | |
176 | PROJ_docsdir=/moredocs \ | |
aa11c230 | 177 | DESTDIR=$RPM_BUILD_ROOT |
d997b14b | 178 | cd .. |
aa11c230 | 179 | |
d997b14b AM |
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 | |
183 | # wrong path used | |
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/ | |
188 | # create launchers | |
189 | for f in scan-{build,view}; do | |
190 | ln -s %{_libdir}/clang-analyzer/$f $RPM_BUILD_ROOT%{_bindir}/$f | |
191 | done | |
192 | ||
193 | cd tools/clang/utils | |
194 | cp -p ccc-analyzer $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/libexec/ | |
195 | ||
196 | for f in scan-build scanview.css sorttable.js; do | |
197 | cp -p $f $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/ | |
198 | done | |
199 | cd ../../.. | |
200 | ||
201 | cd tools/clang/tools/scan-view | |
202 | cp -pr * $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/ | |
203 | cd ../../../../ | |
204 | ||
205 | # Move documentation back to build directory | |
206 | # | |
207 | rm -rf moredocs | |
208 | mv $RPM_BUILD_ROOT/moredocs . | |
209 | rm moredocs/*.tar.gz | |
210 | #rm moredocs/ocamldoc/html/*.tar.gz | |
211 | ||
212 | # And prepare Clang documentation | |
213 | # | |
214 | rm -rf clang-docs | |
215 | mkdir clang-docs | |
216 | for f in LICENSE.TXT NOTES.txt README.txt TODO.txt; do | |
217 | ln tools/clang/$f clang-docs/ | |
218 | done | |
219 | #rm -rf tools/clang/docs/{doxygen*,Makefile*,*.graffle,tools} | |
021b3c3d | 220 | |
6832a5c5 | 221 | # Get rid of erroneously installed example files. |
d997b14b | 222 | rm $RPM_BUILD_ROOT%{_libdir}/%{name}/*LLVMHello.* |
6832a5c5 | 223 | |
d997b14b AM |
224 | # Remove deprecated tools. |
225 | rm $RPM_BUILD_ROOT%{_bindir}/gcc{as,ld} | |
6832a5c5 | 226 | |
d997b14b AM |
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 | |
6832a5c5 | 230 | |
d997b14b AM |
231 | chmod -x $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a |
232 | ||
233 | # remove documentation makefiles: | |
234 | # they require the build directory to work | |
235 | find examples -name 'Makefile' | xargs -0r rm -f | |
6832a5c5 | 236 | |
aa11c230 | 237 | %clean |
238 | rm -rf $RPM_BUILD_ROOT | |
239 | ||
2326a99f JB |
240 | %post -p /sbin/ldconfig |
241 | %postun -p /sbin/ldconfig | |
aa11c230 | 242 | |
243 | %files | |
244 | %defattr(644,root,root,755) | |
bc88141a | 245 | %doc CREDITS.TXT LICENSE.TXT README.txt |
a9beeab5 | 246 | %attr(755,root,root) %{_bindir}/bugpoint |
a9beeab5 JB |
247 | %attr(755,root,root) %{_bindir}/llc |
248 | %attr(755,root,root) %{_bindir}/lli | |
a9beeab5 | 249 | %attr(755,root,root) %{_bindir}/opt |
a8575aac | 250 | %attr(755,root,root) %{_bindir}/llvmc |
bc88141a ER |
251 | %attr(755,root,root) %{_bindir}/llvm-* |
252 | %exclude %attr(755,root,root) %{_bindir}/llvm-config | |
a9beeab5 JB |
253 | %{_mandir}/man1/bugpoint.1* |
254 | %{_mandir}/man1/llc.1* | |
255 | %{_mandir}/man1/lli.1* | |
d997b14b | 256 | %{_mandir}/man1/llvmc.1* |
a9beeab5 | 257 | %{_mandir}/man1/llvm-*.1* |
a9beeab5 JB |
258 | %{_mandir}/man1/llvmgcc.1* |
259 | %{_mandir}/man1/llvmgxx.1* | |
260 | %{_mandir}/man1/opt.1* | |
a8575aac | 261 | #%{_mandir}/man1/stkrc.1* |
a9beeab5 | 262 | %{_mandir}/man1/tblgen.1* |
bc88141a ER |
263 | |
264 | %files doc | |
265 | %defattr(644,root,root,755) | |
d997b14b | 266 | %doc docs/*.{html,css} docs/img examples moredocs/html |
bc88141a ER |
267 | |
268 | %files devel | |
269 | %defattr(644,root,root,755) | |
d997b14b | 270 | #%doc docs/doxygen |
bc88141a ER |
271 | %attr(755,root,root) %{_bindir}/llvm-config |
272 | %{_includedir}/llvm | |
273 | %{_includedir}/llvm-c | |
d997b14b | 274 | %{_libdir}/%{name} |
bc88141a | 275 | |
d997b14b | 276 | %files -n clang |
bc88141a | 277 | %defattr(644,root,root,755) |
d997b14b AM |
278 | %doc clang-docs/* |
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 | |
284 | %{_prefix}/lib/clang | |
285 | %{_libexecdir}/clang-cc | |
286 | %{_mandir}/man1/clang.1.* | |
287 | %{_mandir}/man1/FileCheck.1.* | |
288 | ||
289 | %files -n clang-analyzer | |
bc88141a | 290 | %defattr(644,root,root,755) |
d997b14b AM |
291 | %attr(755,root,root) %{_bindir}/scan-build |
292 | %attr(755,root,root) %{_bindir}/scan-view | |
ae49e501 AM |
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 | |
d997b14b AM |
299 | |
300 | %files ocaml | |
301 | %defattr(644,root,root,755) | |
302 | %doc moredocs/ocamldoc/html/* | |
303 | %{_libdir}/ocaml/*.cma | |
304 | %{_libdir}/ocaml/*.cmi | |
305 | ||
306 | %files ocaml-devel | |
307 | %defattr(644,root,root,755) | |
308 | %{_libdir}/ocaml/*.a | |
309 | %{_libdir}/ocaml/*.cmx* | |
310 | %{_libdir}/ocaml/*.mli |