llvm-vl.spec 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. # Build options:
  2. #
  3. # --with doxygen
  4. # The doxygen docs are HUGE, so they are not built by default.
  5. Name: llvm
  6. Version: 2.9
  7. Release: 1%{?_dist_release}
  8. Summary: The Low Level Virtual Machine
  9. Summary(ja): LLVM - 低レベルバーチャルマシン
  10. Group: Development/Languages
  11. License: NCSA
  12. URL: http://llvm.org/
  13. Source0: http://llvm.org/releases/%{version}/llvm-%{version}.tgz
  14. Source1: http://llvm.org/releases/%{version}/clang-%{version}.tgz
  15. # multilib fixes
  16. Source2: llvm-Config-config.h
  17. Source3: llvm-Config-llvm-config.h
  18. # Data files should be installed with timestamps preserved
  19. Patch0: llvm-2.6-timestamp.patch
  20. # clang link failure if system GCC version is unknown
  21. # http://llvm.org/bugs/show_bug.cgi?id=8897
  22. Patch1: clang-2.9-add_gcc_vers.patch
  23. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  24. BuildRequires: bison
  25. BuildRequires: chrpath
  26. BuildRequires: flex
  27. BuildRequires: gcc-c++ >= 3.4
  28. BuildRequires: groff
  29. BuildRequires: libffi-devel
  30. BuildRequires: libtool-ltdl-devel
  31. BuildRequires: ocaml
  32. # for DejaGNU test suite
  33. BuildRequires: dejagnu tcl python
  34. %if %{?_with_doxygen:1}%{!?_with_doxygen:0}
  35. BuildRequires: doxygen graphviz
  36. %endif
  37. Requires: llvm-libs = %{version}-%{release}
  38. # LLVM is not supported on PPC64
  39. # http://llvm.org/bugs/show_bug.cgi?id=3729
  40. ExcludeArch: ppc64
  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. The compiler infrastructure includes
  45. mirror sets of programming tools as well as libraries with equivalent
  46. functionality.
  47. %package devel
  48. Summary: Libraries and header files for LLVM
  49. Summary(ja): LLVM のライブラリおよびヘッダファイル
  50. Group: Development/Languages
  51. Requires: %{name} = %{version}-%{release}
  52. Requires: libstdc++-devel
  53. Requires: libffi-devel
  54. Provides: llvm-static = %{version}-%{release}
  55. %description devel
  56. This package contains library and header files needed to develop new
  57. native programs that use the LLVM infrastructure.
  58. %package doc
  59. Summary: Documentation for LLVM
  60. Summary(ja): LLVM のドキュメント
  61. Group: Documentation
  62. Requires: %{name} = %{version}-%{release}
  63. %description doc
  64. Documentation for the LLVM compiler infrastructure.
  65. %package libs
  66. Summary: LLVM shared libraries
  67. Summary(ja): LLVM シェアードライブラリ
  68. Group: System Environment/Libraries
  69. %description libs
  70. Shared libraries for the LLVM compiler infrastructure.
  71. %package -n clang
  72. Summary: A C language family front-end for LLVM
  73. Summary(ja): LLVM の C 言語用フロントエンド
  74. License: NCSA
  75. Group: Development/Languages
  76. %description -n clang
  77. clang: noun
  78. 1. A loud, resonant, metallic sound.
  79. 2. The strident call of a crane or goose.
  80. 3. C-language family front-end toolkit.
  81. The goal of the Clang project is to create a new C, C++, Objective C
  82. and Objective C++ front-end for the LLVM compiler. Its tools are built
  83. as libraries and designed to be loosely-coupled and extensible.
  84. %package -n clang-devel
  85. Summary: Header files for clang
  86. Summary(ja): clang のヘッダファイル
  87. Group: Development/Languages
  88. Requires: clang = %{version}-%{release}
  89. %description -n clang-devel
  90. This package contains header files for the Clang compiler.
  91. %package -n clang-analyzer
  92. Summary: A source code analysis framework
  93. Summary(ja): ソースコー分析フレームワーク
  94. License: NCSA
  95. Group: Development/Languages
  96. Requires: clang = %{version}-%{release}
  97. # not picked up automatically since files are currently not instaled
  98. # in standard Python hierarchies yet
  99. Requires: python
  100. %description -n clang-analyzer
  101. The Clang Static Analyzer consists of both a source code analysis
  102. framework and a standalone tool that finds bugs in C and Objective-C
  103. programs. The standalone tool is invoked from the command-line, and is
  104. intended to run in tandem with a build of a project or code base.
  105. %package -n clang-doc
  106. Summary: Documentation for Clang
  107. Summary(ja): Clang のドキュメント
  108. Group: Documentation
  109. Requires: %{name} = %{version}-%{release}
  110. %description -n clang-doc
  111. Documentation for the Clang compiler front-end.
  112. %if %{?_with_doxygen:1}%{!?_with_doxygen:0}
  113. %package apidoc
  114. Summary: API documentation for LLVM
  115. Summary(ja): LLVM の API ドキュメント
  116. Group: Development/Languages
  117. Requires: %{name}-docs = %{version}-%{release}
  118. %description apidoc
  119. API documentation for the LLVM compiler infrastructure.
  120. %endif
  121. %package ocaml
  122. Summary: OCaml binding for LLVM
  123. Summary(ja): LLVM の OCaml バインディング
  124. Group: Development/Libraries
  125. Requires: %{name} = %{version}-%{release}
  126. Requires: ocaml
  127. %description ocaml
  128. OCaml binding for LLVM.
  129. %package ocaml-devel
  130. Summary: Development files for %{name}-ocaml
  131. Summary(ja): %{name}-ocaml の開発ファイル
  132. Group: Development/Libraries
  133. Requires: %{name}-devel = %{version}-%{release}
  134. Requires: %{name}-ocaml = %{version}-%{release}
  135. Requires: ocaml
  136. %description ocaml-devel
  137. The %{name}-ocaml-devel package contains libraries and signature files
  138. for developing applications that use %{name}-ocaml.
  139. %package ocaml-doc
  140. Summary: Documentation for %{name}-ocaml
  141. Summary(ja): %{name}-ocaml のドキュメント
  142. Group: Documentation
  143. Requires: %{name}-ocaml = %{version}-%{release}
  144. %description ocaml-doc
  145. HTML documentation for LLVM's OCaml binding.
  146. %prep
  147. %setup -q -n llvm-%{version} -a1 %{?_with_gcc:-a2}
  148. mv clang-%{version} tools/clang
  149. # llvm patches
  150. %patch0 -p1 -b .timestamp
  151. # clang patches
  152. pushd tools/clang
  153. %patch1 -p1 -b .add_gcc_ver
  154. popd
  155. # Encoding fix
  156. #(cd tools/clang/docs && \
  157. # iconv -f ISO88591 -t UTF8 BlockImplementation.txt \
  158. # -o BlockImplementation.txt)
  159. %build
  160. # Disabling assertions now, rec. by pure and needed for OpenGTL
  161. # TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
  162. %configure \
  163. --prefix=%{_prefix} \
  164. --libdir=%{_libdir}/%{name} \
  165. --datadir=%{_libdir}/%{name} \
  166. --disable-assertions \
  167. --enable-jit \
  168. --enable-libffi \
  169. --enable-shared \
  170. --with-c-include-dirs=%{_includedir}:$(find %{_prefix}/lib/gcc/*/* \
  171. -maxdepth 0 -type d)/include \
  172. %if %{__isa_bits} == 64
  173. --with-cxx-include-32bit-dir=32 \
  174. %endif
  175. --with-cxx-include-root=$(find %{_includedir}/c++/* -maxdepth 0 -type d) \
  176. --with-cxx-include-arch=%{_target_cpu}-%{_vendor}-%{_os}
  177. # FIXME file this
  178. # configure does not properly specify libdir
  179. sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}/%{name}|g' Makefile.config
  180. make %{_smp_mflags} REQUIRES_RTTI=1 \
  181. %ifarch ppc
  182. OPTIMIZE_OPTION="%{optflags} -fno-var-tracking-assignments"
  183. %else
  184. OPTIMIZE_OPTION="%{optflags}"
  185. %endif
  186. %install
  187. rm -rf %{buildroot}
  188. make install DESTDIR=%{buildroot} \
  189. PROJ_docsdir=/moredocs
  190. # multilib fixes
  191. mv %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}}
  192. pushd %{buildroot}%{_includedir}/llvm/Config
  193. mv config.h config-%{__isa_bits}.h
  194. cp -p %{SOURCE2} config.h
  195. mv llvm-config.h llvm-config-%{__isa_bits}.h
  196. cp -p %{SOURCE3} llvm-config.h
  197. popd
  198. # Create ld.so.conf.d entry
  199. mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
  200. cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf << EOF
  201. %{_libdir}/llvm
  202. EOF
  203. # Static analyzer not installed by default:
  204. # http://clang-analyzer.llvm.org/installation#OtherPlatforms
  205. mkdir -p %{buildroot}%{_libdir}/clang-analyzer
  206. # create launchers
  207. for f in scan-{build,view}; do
  208. ln -s %{_libdir}/clang-analyzer/$f/$f %{buildroot}%{_bindir}/$f
  209. done
  210. (cd tools/clang/tools && cp -pr scan-{build,view} \
  211. %{buildroot}%{_libdir}/clang-analyzer/)
  212. # Move documentation back to build directory
  213. #
  214. mv %{buildroot}/moredocs .
  215. rm -f moredocs/*.tar.gz
  216. rm -f moredocs/ocamldoc/html/*.tar.gz
  217. # and separate the apidoc
  218. %if 0%{?_with_doxygen}
  219. mv moredocs/html/doxygen apidoc
  220. mv tools/clang/docs/doxygen/html clang-apidoc
  221. %endif
  222. # And prepare Clang documentation
  223. #
  224. mkdir clang-docs
  225. for f in LICENSE.TXT NOTES.txt README.txt TODO.txt; do
  226. ln tools/clang/$f clang-docs/
  227. done
  228. rm -rf tools/clang/docs/{doxygen*,Makefile*,*.graffle,tools}
  229. #find %%{buildroot} -name .dir -print0 | xargs -0r rm -f
  230. file %{buildroot}/%{_bindir}/* | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
  231. file %{buildroot}/%{_libdir}/llvm/*.so | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
  232. #chrpath -d %%{buildroot}/%%{_libexecdir}/clang-cc
  233. # Get rid of erroneously installed example files.
  234. rm %{buildroot}%{_libdir}/%{name}/*LLVMHello.*
  235. # FIXME file this bug
  236. sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}/%{name}",' \
  237. %{buildroot}%{_bindir}/llvm-config-%{__isa_bits}
  238. chmod -x %{buildroot}%{_libdir}/%{name}/*.a
  239. # remove documentation makefiles:
  240. # they require the build directory to work
  241. find examples -name 'Makefile' | xargs -0r rm -f
  242. %check
  243. make check 2>&1 | tee ../llvm-testlog.txt
  244. make -C tools/clang/test 2>&1 | tee ../llvm-testlog.txt
  245. %clean
  246. rm -rf %{buildroot}
  247. %post libs -p /sbin/ldconfig
  248. %post -n clang -p /sbin/ldconfig
  249. %postun libs -p /sbin/ldconfig
  250. %postun -n clang -p /sbin/ldconfig
  251. %posttrans devel
  252. # link llvm-config to the platform-specific file;
  253. # use ISA bits as priority so that 64-bit is preferred
  254. # over 32-bit if both are installed
  255. alternatives \
  256. --install \
  257. %{_bindir}/llvm-config \
  258. llvm-config \
  259. %{_bindir}/llvm-config-%{__isa_bits} \
  260. %{__isa_bits}
  261. %postun devel
  262. if [ $1 -eq 0 ]; then
  263. alternatives --remove llvm-config \
  264. %{_bindir}/llvm-config-%{__isa_bits}
  265. fi
  266. exit 0
  267. %files
  268. %defattr(-,root,root,-)
  269. %doc CREDITS.TXT LICENSE.TXT README.txt
  270. %{_bindir}/bugpoint
  271. %{_bindir}/llc
  272. %{_bindir}/lli
  273. %exclude %{_bindir}/llvm-config-%{__isa_bits}
  274. %{_bindir}/llvm*
  275. %{_bindir}/macho-dump
  276. %{_bindir}/opt
  277. %exclude %{_mandir}/man1/clang.1.*
  278. %exclude %{_mandir}/man1/llvmg??.1.*
  279. %doc %{_mandir}/man1/*.1.*
  280. %files devel
  281. %defattr(-,root,root,-)
  282. %{_bindir}/llvm-config-%{__isa_bits}
  283. %{_includedir}/%{name}
  284. %{_includedir}/%{name}-c
  285. %{_libdir}/%{name}/*.a
  286. %files libs
  287. %defattr(-,root,root,-)
  288. %config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
  289. %dir %{_libdir}/%{name}
  290. %exclude %{_libdir}/%{name}/libclang.so
  291. %{_libdir}/%{name}/*.so
  292. %files -n clang
  293. %defattr(-,root,root,-)
  294. %doc clang-docs/*
  295. %{_bindir}/clang*
  296. #%{_bindir}/c-index-test
  297. %{_bindir}/tblgen
  298. %{_libdir}/%{name}/libclang.so
  299. %{_prefix}/lib/clang
  300. %doc %{_mandir}/man1/clang.1.*
  301. %files -n clang-devel
  302. %defattr(-,root,root,-)
  303. %{_includedir}/clang
  304. %{_includedir}/clang-c
  305. %files -n clang-analyzer
  306. %defattr(-,root,root,-)
  307. %{_bindir}/scan-build
  308. %{_bindir}/scan-view
  309. %{_libdir}/clang-analyzer
  310. %files -n clang-doc
  311. %defattr(-,root,root,-)
  312. %doc tools/clang/docs/*
  313. %files doc
  314. %defattr(-,root,root,-)
  315. %doc examples moredocs/html
  316. %files ocaml
  317. %defattr(-,root,root,-)
  318. %{_libdir}/ocaml/*.cma
  319. %{_libdir}/ocaml/*.cmi
  320. %files ocaml-devel
  321. %defattr(-,root,root,-)
  322. %{_libdir}/ocaml/*.a
  323. %{_libdir}/ocaml/*.cmx*
  324. %{_libdir}/ocaml/*.mli
  325. %files ocaml-doc
  326. %defattr(-,root,root,-)
  327. %doc moredocs/ocamldoc/html/*
  328. %if 0%{?_with_doxygen}
  329. %files apidoc
  330. %defattr(-,root,root,-)
  331. %doc apidoc/*
  332. %files -n clang-apidoc
  333. %defattr(-,root,root,-)
  334. %doc clang-apidoc/*
  335. %endif
  336. %changelog
  337. * Thu Aug 25 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.9-1
  338. - new upstream release
  339. - add BR: libffi-devel
  340. - add R: libffi-devel to -devel
  341. * Sun May 23 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7-1
  342. - initial build for Vine Linux
  343. * Sun May 2 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-1
  344. - Update to final 2.7 release
  345. * Sun Mar 28 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-0.1.pre1
  346. - Update to first 2.7 pre-release
  347. * Fri Sep 18 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.6.pre2
  348. - Update to 2.6 pre-release2
  349. - -devel subpackage now virtually provides -static
  350. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.5.pre1
  351. - Disable var tracking assignments on PPC
  352. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.4.pre1
  353. - Don't adjust clang include dir; files there are noarch (bz#521893)
  354. - Enable clang unit tests
  355. - clang and clang-analyzer renamed; no longer depend on llvm at runtime
  356. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.3.pre1
  357. - Package Clang's static analyzer tools
  358. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.2.pre1
  359. - PIC is now enabled by default; explicitly disable on %%{ix86}
  360. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.1.pre1
  361. - First 2.6 prerelease
  362. - Enable Clang front-end
  363. - Enable debuginfo generation
  364. * Sat Sep 5 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-6
  365. - Disable assertions (needed by OpenGTL, bz#521261)
  366. - Align spec file with upstream build instructions
  367. - Enable unit tests
  368. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-5
  369. - Only disable PIC on %%ix86; ppc actually needs it
  370. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-4
  371. - Disable use of position-independent code on 32-bit platforms
  372. (buggy in LLVM <= 2.5)
  373. * Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-3
  374. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  375. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-2
  376. - Remove build scripts; they require the build directory to work
  377. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-1
  378. - Update to 2.5
  379. - Package build scripts (bug #457881)
  380. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-2
  381. - Patched build process for the OCaml binding
  382. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-1
  383. - Update to 2.4
  384. - Package Ocaml binding
  385. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-2
  386. - Add dependency on groff
  387. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-1
  388. - LLVM 2.3
  389. * Thu May 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2-4
  390. - fix license tags
  391. * Wed Mar 5 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.2-3
  392. - Fix compilation problems with gcc 4.3
  393. * Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.2-2
  394. - Autorebuild for GCC 4.3
  395. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-2
  396. - Fix review comments
  397. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-1
  398. - Initial version