]> git.pld-linux.org Git - packages/llvm.git/blob - llvm.spec
7b4b6a365a6b60f56e58b550e1daa9cc7e1045d4
[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.7
11 Release:        0.1
12 License:        University of Illinois/NCSA Open Source License
13 Group:          Development/Languages
14 Source0:        http://llvm.org/releases/%{version}/%{name}-%{version}.tgz
15 # Source0-md5:  ac322661f20e7d6c810b1869f886ad9b
16 Source1:        http://llvm.org/releases/2.7/clang-%{version}.tgz
17 # Source1-md5:  b83260aa8c13494adf8978b5f238bf1b
18 # Data files should be installed with timestamps preserved
19 Patch3:         %{name}-2.6-timestamp.patch
20 URL:            http://llvm.org/
21 BuildRequires:  bash
22 BuildRequires:  bison
23 BuildRequires:  doxygen
24 BuildRequires:  flex
25 BuildRequires:  graphviz
26 BuildRequires:  groff
27 BuildRequires:  libltdl-devel
28 BuildRequires:  libstdc++-devel >= 5:3.4
29 BuildRequires:  ocaml-ocamldoc
30 # gcc4 might be installed, but not current __cc
31 %if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4"
32 BuildRequires:  __cc >= 3.4
33 %endif
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %define         _sysconfdir     /etc/%{name}
37
38 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
39 %define         _noautostrip    .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
40
41 %description
42 LLVM is a compiler infrastructure designed for compile-time,
43 link-time, runtime, and idle-time optimization of programs from
44 arbitrary programming languages. LLVM is written in C++ and has been
45 developed since 2000 at the University of Illinois and Apple. It
46 currently supports compilation of C and C++ programs, using front-ends
47 derived from GCC 4.0.1. A new front-end for the C family of languages
48 is in development. The compiler infrastructure includes mirror sets of
49 programming tools as well as libraries with equivalent functionality.
50
51 %description -l pl.UTF-8
52 LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
53 czasu kompilowania, linkowania, działania i bezczynności programów w
54 dowolnych językach programowania. Jest napisana w C++, rozwijana od
55 roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
56 kompilację programów w C i C++ przy użyciu frontendów wywodzących się
57 z GCC 4.0.1. W trakcie tworzenia jest nowy frontend do języków z
58 rodziny C. Infrastruktura kompilatora zawiera lustrzane zestawy
59 narzędzi programistycznych oraz biblioteki z odpowiadającą narzędziom
60 funkcjonalnością.
61
62 %package doc
63 Summary:        Documentation for LLVM
64 Group:          Documentation
65 Requires:       %{name} = %{version}-%{release}
66
67 %description doc
68 Documentation for the LLVM compiler infrastructure.
69
70 %package devel
71 Summary:        Libraries and header files for LLVM
72 Group:          Development/Languages
73 Requires:       %{name} = %{version}-%{release}
74 Requires:       libstdc++-devel >= 6:3.4
75
76 %description devel
77 This package contains library and header files needed to develop new
78 native programs that use the LLVM infrastructure.
79
80 %package ocaml
81 Summary:        OCaml binding for LLVM
82 Group:          Development/Libraries
83 Requires:       %{name} = %{version}-%{release}
84 %requires_eq    ocaml-runtime
85
86 %description    ocaml
87 OCaml binding for LLVM.
88
89 %package ocaml-devel
90 Summary:        Development files for %{name}-ocaml
91 Group:          Development/Libraries
92 Requires:       %{name}-devel = %{version}-%{release}
93 Requires:       %{name}-ocaml = %{version}-%{release}
94
95 %description ocaml-devel
96 The %{name}-ocaml-devel package contains libraries and signature files
97 for developing applications that use %{name}-ocaml.
98
99 %package -n clang
100 Summary:        A C language family frontend for LLVM
101 License:        NCSA
102 Group:          Development/Languages
103
104 %description -n clang
105 clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
106 of a crane or goose. 3. C-language family front-end toolkit.
107
108 The goal of the Clang project is to create a new C, C++, Objective C
109 and Objective C++ front-end for the LLVM compiler. Its tools are built
110 as libraries and designed to be loosely-coupled and extendable.
111
112 %package -n clang-analyzer
113 Summary:        A source code analysis framework
114 License:        NCSA
115 Group:          Development/Languages
116 Requires:       clang = %{version}-%{release}
117 # not picked up automatically since files are currently not instaled
118 # in standard Python hierarchies yet
119 Requires:       python
120
121 %description -n clang-analyzer
122 The Clang Static Analyzer consists of both a source code analysis
123 framework and a standalone tool that finds bugs in C and Objective-C
124 programs. The standalone tool is invoked from the command-line, and is
125 intended to run in tandem with a build of a project or code base.
126
127 %prep
128 %setup -q -a1
129 mv clang-*.* tools/clang
130 %patch3 -p1 -b .timestamp
131
132 %build
133 # Disabling assertions now, rec. by pure and needed for OpenGTL
134 # no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3239
135 #
136 # bash specific 'test a < b'
137 mkdir obj && cd obj
138 bash ../%configure \
139         --libdir=%{_libdir}/%{name} \
140         --datadir=%{_datadir}/%{name}-%{version} \
141 %ifarch %{ix86}
142         --enable-pic=no \
143 %endif
144         --disable-static \
145         --disable-assertions \
146         --enable-debug-runtime \
147         --enable-jit \
148         --enable-optimized \
149         --enable-shared \
150         --with-pic
151
152 # FIXME file this
153 # configure does not properly specify libdir
154 sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}/%{name}|g' Makefile.config
155
156 %{__make} \
157         OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
158
159 %install
160 rm -rf $RPM_BUILD_ROOT
161
162 cd obj
163 chmod -x examples/Makefile
164
165 %{__make} -j1 install \
166         PROJ_docsdir=/moredocs \
167         DESTDIR=$RPM_BUILD_ROOT
168 cd ..
169
170 # Static analyzer not installed by default:
171 install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/
172 # wrong path used
173 install -d $RPM_BUILD_ROOT%{_libexecdir}
174 # create launchers
175
176 for f in scan-{build,view}; do
177   ln -s %{_libdir}/clang-analyzer/$f $RPM_BUILD_ROOT%{_bindir}/$f
178 done
179
180 cd tools/clang/tools/scan-build
181
182 for f in scan-build scanview.css sorttable.js; do
183   cp -p $f $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/
184 done
185 cp -pr * $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/
186 cd ../../../../
187
188 # Move documentation back to build directory
189 #
190 rm -rf moredocs
191 mv $RPM_BUILD_ROOT/moredocs .
192 rm moredocs/*.tar.gz
193 #rm moredocs/ocamldoc/html/*.tar.gz
194
195 # And prepare Clang documentation
196 #
197 rm -rf clang-docs
198 mkdir clang-docs
199 for f in LICENSE.TXT NOTES.txt README.txt TODO.txt; do
200   ln tools/clang/$f clang-docs/
201 done
202 #rm -rf tools/clang/docs/{doxygen*,Makefile*,*.graffle,tools}
203
204 # Get rid of erroneously installed example files.
205 rm $RPM_BUILD_ROOT%{_libdir}/%{name}/*LLVMHello.*
206
207 # FIXME file this bug
208 sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}/%{name}",' \
209         $RPM_BUILD_ROOT%{_bindir}/llvm-config
210
211 chmod -x $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a
212
213 # remove documentation makefiles:
214 # they require the build directory to work
215 find examples -name 'Makefile' | xargs -0r rm -f
216
217 %clean
218 rm -rf $RPM_BUILD_ROOT
219
220 %post   -p /sbin/ldconfig
221 %postun -p /sbin/ldconfig
222
223 %files
224 %defattr(644,root,root,755)
225 %doc CREDITS.TXT LICENSE.TXT README.txt
226 %attr(755,root,root) %{_bindir}/bugpoint
227 %attr(755,root,root) %{_bindir}/llc
228 %attr(755,root,root) %{_bindir}/lli
229 %attr(755,root,root) %{_bindir}/opt
230 %attr(755,root,root) %{_bindir}/llvmc
231 %attr(755,root,root) %{_bindir}/llvm-*
232 %exclude %attr(755,root,root) %{_bindir}/llvm-config
233 %{_mandir}/man1/bugpoint.1*
234 %{_mandir}/man1/llc.1*
235 %{_mandir}/man1/lli.1*
236 %{_mandir}/man1/llvmc.1*
237 %{_mandir}/man1/llvm-*.1*
238 %{_mandir}/man1/llvmgcc.1*
239 %{_mandir}/man1/llvmgxx.1*
240 %{_mandir}/man1/opt.1*
241 #%{_mandir}/man1/stkrc.1*
242 %{_mandir}/man1/tblgen.1*
243
244 %files doc
245 %defattr(644,root,root,755)
246 %doc docs/*.{html,css} docs/img examples moredocs/html
247
248 %files devel
249 %defattr(644,root,root,755)
250 #%doc docs/doxygen
251 %attr(755,root,root) %{_bindir}/llvm-config
252 %{_includedir}/llvm
253 %{_includedir}/llvm-c
254 %{_libdir}/%{name}
255
256 %files -n clang
257 %defattr(644,root,root,755)
258 %doc clang-docs/*
259 %doc tools/clang/docs/*
260 %attr(755,root,root) %{_bindir}/clang*
261 %attr(755,root,root) %{_bindir}/tblgen
262 %{_prefix}/lib/clang
263 %{_mandir}/man1/clang.1.*
264
265 %files -n clang-analyzer
266 %defattr(644,root,root,755)
267 %attr(755,root,root) %{_bindir}/scan-build
268 %attr(755,root,root) %{_bindir}/scan-view
269 %dir %{_libdir}/clang-analyzer
270 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-*
271 %attr(755,root,root) %{_libdir}/clang-analyzer/c++-*
272 %attr(755,root,root) %{_libdir}/clang-analyzer/ccc-*
273 %attr(755,root,root) %{_libdir}/clang-analyzer/set-xcode-*
274 %{_libdir}/clang-analyzer/*.*
275
276 %files ocaml
277 %defattr(644,root,root,755)
278 %doc moredocs/ocamldoc/html/*
279 %{_libdir}/ocaml/*.cma
280 %{_libdir}/ocaml/*.cmi
281
282 %files ocaml-devel
283 %defattr(644,root,root,755)
284 %{_libdir}/ocaml/*.a
285 %{_libdir}/ocaml/*.cmx*
286 %{_libdir}/ocaml/*.mli
This page took 0.067673 seconds and 3 git commands to generate.