]> git.pld-linux.org Git - packages/llvm.git/blob - llvm.spec
- fix some files
[packages/llvm.git] / llvm.spec
1 # TODO
2 # - gcc/c++ packages: http://cvs.fedoraproject.org/viewvc/rpms/llvm/devel/llvm.spec?revision=HEAD&view=markup
3 # - test gcc pkgs and all
4 #
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)
9 Name:           llvm
10 Version:        2.6
11 Release:        0.1
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
25 URL:            http://llvm.org/
26 BuildRequires:  bash
27 BuildRequires:  bison
28 BuildRequires:  doxygen
29 BuildRequires:  flex
30 BuildRequires:  graphviz
31 BuildRequires:  groff
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
38 %endif
39 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41 %define         _sysconfdir     /etc/%{name}
42
43 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
44 %define         _noautostrip    .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
45
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
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
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
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
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
132 %prep
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
141
142 %build
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 #
146 # bash specific 'test a < b'
147 mkdir obj && cd obj
148 bash ../%configure \
149         --libdir=%{_libdir}/%{name} \
150         --datadir=%{_datadir}/%{name}-%{version} \
151 %ifarch %{ix86}
152         --enable-pic=no \
153 %endif
154         --disable-static \
155         --disable-assertions \
156         --enable-debug-runtime \
157         --enable-jit \
158         --enable-optimized \
159         --enable-shared \
160         --with-pic
161
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
165
166 %{__make} \
167         OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
168
169 %install
170 rm -rf $RPM_BUILD_ROOT
171
172 cd obj
173 chmod -x examples/Makefile
174
175 %{__make} -j1 install \
176         PROJ_docsdir=/moredocs \
177         DESTDIR=$RPM_BUILD_ROOT
178 cd ..
179
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}
220
221 # Get rid of erroneously installed example files.
222 rm $RPM_BUILD_ROOT%{_libdir}/%{name}/*LLVMHello.*
223
224 # Remove deprecated tools.
225 rm $RPM_BUILD_ROOT%{_bindir}/gcc{as,ld}
226
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
230
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
236
237 %clean
238 rm -rf $RPM_BUILD_ROOT
239
240 %post   -p /sbin/ldconfig
241 %postun -p /sbin/ldconfig
242
243 %files
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*
263
264 %files doc
265 %defattr(644,root,root,755)
266 %doc docs/*.{html,css} docs/img examples moredocs/html
267
268 %files devel
269 %defattr(644,root,root,755)
270 #%doc docs/doxygen
271 %attr(755,root,root) %{_bindir}/llvm-config
272 %{_includedir}/llvm
273 %{_includedir}/llvm-c
274 %{_libdir}/%{name}
275
276 %files -n clang
277 %defattr(644,root,root,755)
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
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
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
This page took 0.888771 seconds and 3 git commands to generate.