gmp-vl.spec 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. %bcond_without test
  2. # Important for %{ix86}:
  3. # This rpm has to be build on a CPU with sse2 support like Pentium 4 !
  4. %ifarch %{ix86}
  5. %define SSE2 1
  6. %else
  7. %define SSE2 0
  8. %endif
  9. # Don't you want to build a libraries using SSE2?
  10. %{?_without_sse2%define SSE2 0}
  11. %define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}
  12. # to disable "Provides: pkgconfig(foo)" in compat32-*
  13. %global __provides_exclude_from ^%{_libdir}/pkgconfig/.*$
  14. Summary: A GNU arbitrary precision library.
  15. Summary(ja): GNU 多倍長演算ライブラリ
  16. Name: gmp
  17. Version: 6.2.1
  18. Release: 2%{?_dist_release}
  19. Group: system
  20. Vendor: Project Vine
  21. Distribution: Vine Linux
  22. Packager: inagaki, kenta
  23. License: LGPLv3+ or GPL2+
  24. URL: https://gmplib.org/
  25. Source: https://gmplib.org/download/gmp/gmp-%{version}.tar.xz
  26. Source2: gmp.h
  27. Source3: gmp-mparam.h
  28. Patch2: gmp-6.0.0-debuginfo.patch
  29. Patch1000: CVE-2021-43618.patch
  30. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  31. BuildRequires: autoconf libtool
  32. Obsoletes: gmp4
  33. %description
  34. The gmp package contains GNU MP, a library for arbitrary precision
  35. arithmetic, signed integers operations, rational numbers and floating
  36. point numbers. GNU MP is designed for speed, for both small and very
  37. large operands. GNU MP is fast because it uses fullwords as the basic
  38. arithmetic type, it uses fast algorithms, it carefully optimizes
  39. assembly code for many CPUs' most common inner loops, and it generally
  40. emphasizes speed over simplicity/elegance in its operations.
  41. Install the gmp package if you need a fast arbitrary precision
  42. library.
  43. %package devel
  44. Summary: Development tools for the GNU MP arbitrary precision library.
  45. Group: programming
  46. Requires: %{name} = %{version}-%{release}
  47. Provides: pkgconfig(gmp) = %{version}
  48. Provides: pkgconfig(gmpxx) = %{version}
  49. #Obsoletes: gmp4-devel
  50. %description devel
  51. The libraries, header files and documentation for using the GNU MP
  52. arbitrary precision library in applications.
  53. If you want to develop applications which will use the GNU MP library,
  54. you'll need to install the gmp-devel package. You'll also need to
  55. install the gmp package.
  56. %package static
  57. Summary: Development tools for the GNU MP arbitrary precision library
  58. Group: programming
  59. Requires: %{name}-devel = %{version}-%{release}
  60. %description static
  61. The static libraries for using the GNU MP arbitrary precision library
  62. in applications.
  63. %package -n compat32-%{name}
  64. Summary: A GNU arbitrary precision library.
  65. Group: system,legacy
  66. Requires: %{name} = %{version}-%{release}
  67. %description -n compat32-%{name}
  68. The gmp package contains GNU MP, a library for arbitrary precision
  69. arithmetic, signed integers operations, rational numbers and floating
  70. point numbers. GNU MP is designed for speed, for both small and very
  71. large operands. GNU MP is fast because it uses fullwords as the basic
  72. arithmetic type, it uses fast algorithms, it carefully optimizes
  73. assembly code for many CPUs' most common inner loops, and it generally
  74. emphasizes speed over simplicity/elegance in its operations.
  75. Install the gmp package if you need a fast arbitrary precision
  76. library.
  77. %package -n compat32-%{name}-devel
  78. Summary: Development tools for the GNU MP arbitrary precision library.
  79. Group: programming,legacy
  80. Requires: compat32-%{name} = %{version}-%{release}
  81. Requires: %{name}-devel = %{version}-%{release}
  82. %description -n compat32-%{name}-devel
  83. The libraries, header files and documentation for using the GNU MP
  84. arbitrary precision library in applications.
  85. If you want to develop applications which will use the GNU MP library,
  86. you'll need to install the gmp-devel package. You'll also need to
  87. install the gmp package.
  88. %package -n compat32-%{name}-static
  89. Summary: Development tools for the GNU MP arbitrary precision library
  90. Group: programming,legacy
  91. Requires: compat32-%{name}-devel = %{version}-%{release}
  92. %description -n compat32-%{name}-static
  93. The static libraries for using the GNU MP arbitrary precision library
  94. in applications.
  95. %debug_package
  96. %prep
  97. %setup -q
  98. %patch2 -p1 -b .debuginfo
  99. %patch1000 -p1
  100. %build
  101. autoreconf -if
  102. if as --help | grep -q execstack; then
  103. # the object files do not require an executable stack
  104. export CCAS="gcc -c -Wa,--noexecstack"
  105. fi
  106. mkdir base
  107. cd base
  108. ln -s ../configure .
  109. #%configure --enable-mpbsd --enable-cxx
  110. %configure --enable-cxx
  111. perl -pi -e 's|hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=\"-L\\\$libdir\"|g;' libtool
  112. export LD_LIBRARY_PATH=`pwd`/.libs
  113. make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
  114. cd ..
  115. %if %{SSE2}
  116. %define _host pentium4-vine-linux
  117. mkdir build-sse2
  118. cd build-sse2
  119. ln -s ../configure .
  120. CFLAGS="%{optflags} -march=pentium4"
  121. #%configure --enable-mpbsd --enable-cxx
  122. %configure --enable-cxx
  123. perl -pi -e 's|hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=\"-L\\\$libdir\"|g;' libtool
  124. export LD_LIBRARY_PATH=`pwd`/.libs
  125. make %{?_smp_mflags}
  126. unset CFLAGS
  127. cd ..
  128. %endif
  129. %install
  130. [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
  131. cd base
  132. export LD_LIBRARY_PATH=`pwd`/.libs
  133. make install DESTDIR=$RPM_BUILD_ROOT
  134. install -m 644 gmp-mparam.h ${RPM_BUILD_ROOT}%{_includedir}
  135. rm -f $RPM_BUILD_ROOT%{_libdir}/lib{gmp,mp,gmpxx}.la
  136. rm -f $RPM_BUILD_ROOT%{_infodir}/dir
  137. /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
  138. ln -sf libgmpxx.so.4 $RPM_BUILD_ROOT%{_libdir}/libgmpxx.so
  139. cd ..
  140. %if %{SSE2}
  141. cd build-sse2
  142. export LD_LIBRARY_PATH=`pwd`/.libs
  143. mkdir $RPM_BUILD_ROOT%{_libdir}/sse2
  144. install -m 755 .libs/libgmp.so.*.* $RPM_BUILD_ROOT%{_libdir}/sse2
  145. cp -a .libs/libgmp.so.[^.]* $RPM_BUILD_ROOT%{_libdir}/sse2
  146. chmod 755 $RPM_BUILD_ROOT%{_libdir}/sse2/libgmp.so.[^.]*
  147. install -m 755 .libs/libgmpxx.so.*.* $RPM_BUILD_ROOT%{_libdir}/sse2
  148. cp -a .libs/libgmpxx.so.? $RPM_BUILD_ROOT%{_libdir}/sse2
  149. chmod 755 $RPM_BUILD_ROOT%{_libdir}/sse2/libgmpxx.so.?
  150. cd ..
  151. %endif
  152. # Rename gmp.h to gmp-<arch>.h and gmp-mparam.h to gmp-mparam-<arch>.h to
  153. # avoid file conflicts on multilib systems and install wrapper include files
  154. # gmp.h and gmp-mparam-<arch>.h
  155. basearch=%{_arch}
  156. # always use i386 for iX86
  157. %ifarch %{ix86}
  158. basearch=i386
  159. %endif
  160. # always use arm for arm*
  161. %ifarch %{arm}
  162. basearch=arm
  163. %endif
  164. # Rename files and install wrappers
  165. mv %{buildroot}/%{_includedir}/gmp.h %{buildroot}/%{_includedir}/gmp-${basearch}.h
  166. install -m644 %{SOURCE2} %{buildroot}/%{_includedir}/gmp.h
  167. mv %{buildroot}/%{_includedir}/gmp-mparam.h %{buildroot}/%{_includedir}/gmp-mparam-${basearch}.h
  168. install -m644 %{SOURCE3} %{buildroot}/%{_includedir}/gmp-mparam.h
  169. %if %{with test}
  170. %check
  171. %ifnarch ppc
  172. cd base
  173. export LD_LIBRARY_PATH=`pwd`/.libs
  174. make %{?_smp_mflags} check
  175. cd ..
  176. %endif
  177. %if %{SSE2}
  178. cd build-sse2
  179. export LD_LIBRARY_PATH=`pwd`/.libs
  180. make %{?_smp_mflags} check
  181. cd ..
  182. %endif
  183. %endif
  184. %clean
  185. [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
  186. %files
  187. %defattr(-,root,root,-)
  188. %license COPYING*
  189. %doc NEWS README
  190. %{_libdir}/libgmp.so.*
  191. %{_libdir}/libgmpxx.so.*
  192. %if %{SSE2}
  193. %{_libdir}/sse2/*
  194. %endif
  195. %files devel
  196. %defattr(-,root,root,-)
  197. %{_libdir}/libgmp.so
  198. %{_libdir}/libgmpxx.so
  199. #{_libdir}/libmpfr.a
  200. %{_includedir}/*.h
  201. %{_infodir}/gmp.info*
  202. #{_infodir}/mpfr.info*
  203. %{_libdir}/pkgconfig/*.pc
  204. %files static
  205. %defattr(-,root,root,-)
  206. %doc README
  207. %{_libdir}/libgmp.a
  208. %{_libdir}/libgmpxx.a
  209. # compat32
  210. %if %{build_compat32}
  211. %files -n compat32-%{name}
  212. %defattr(-,root,root,-)
  213. %{_libdir}/libgmp.so.*
  214. %{_libdir}/libgmpxx.so.*
  215. %if %{SSE2}
  216. %{_libdir}/sse2/*
  217. %endif
  218. %files -n compat32-%{name}-devel
  219. %defattr(-,root,root,-)
  220. %{_libdir}/libgmp.so
  221. %{_libdir}/libgmpxx.so
  222. #{_libdir}/libmpfr.a
  223. %{_libdir}/pkgconfig/*.pc
  224. %files -n compat32-%{name}-static
  225. %defattr(-,root,root,-)
  226. %doc README
  227. %{_libdir}/libgmp.a
  228. %{_libdir}/libgmpxx.a
  229. %endif
  230. %changelog
  231. * Fri Nov 19 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.2.1-2
  232. - imported Patch1000 from upstream to fix CVE-2021-43618.
  233. - dropped scriptlets.
  234. * Tue Feb 02 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.2.1-1
  235. - new upstream release.
  236. * Sun Mar 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.2.0-1
  237. - new upstream release.
  238. * Sun May 05 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.1.2-1
  239. - new upstream release.
  240. - updated Source2 and Source3.
  241. * Sat Jul 2 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 6.1.1-1
  242. - new upstream release.
  243. - dropped Patch0.
  244. - imported Patch2 from rawhide.
  245. - updated Source2 and Source3.
  246. * Sat May 07 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.1.0-1
  247. - new upstream release
  248. * Tue Jan 14 2014 NAKAMURA Kenta <kenta@vinelinux.org> 5.1.3-2
  249. - rebuilt with the current environment
  250. * Sun Nov 03 2013 Toshiharu Kudoh <toshi.kd2@gmail.com> 5.1.3-1
  251. - new upstream release
  252. - changed file archive type to xz
  253. - replaced Patch0 to Fedora rawhide's Patch
  254. - deleted unrecognized option: --enable-mpbsd
  255. * Tue Apr 19 2011 NAKAMURA Kenta <kenta@vinelinux.org> 4.3.2-1
  256. - new upstream release
  257. * Sun Apr 17 2011 Shu KONNO <owa@bg.wakwak.com> 4.3.1-2
  258. - rebuilt with rpm-4.8.1-3
  259. * Sat Nov 28 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.3.1-1
  260. - new upstream release
  261. - split static libraries to subpackage
  262. * Sun Jun 28 2009 NAKAMURA Kenta <kenta@vinelinux.org> 4.2.2-5
  263. - added compat32 package for x86_64 arch support
  264. - run autoreconf to get autotools right
  265. * Mon May 19 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.2.2-4
  266. - applied new versioning policy
  267. - added Patch3 from upstream
  268. * Wed Oct 24 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.2.2-3vl2
  269. - remove --enable-mpfr
  270. (mpfr has been splitted since gmp 4.2)
  271. * Wed Oct 24 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.2.2-3vl1
  272. - new upstream release
  273. * Mon Sep 24 2007 Ivana Varekova <varekova@redhat.com> 4.2.2-3
  274. - fix libgmpxx.so link
  275. * Thu Sep 20 2007 Ivana Varekova <varekova@redhat.com> 4.2.2-2
  276. - fix check tag
  277. * Thu Nov 2 2006 Thomas Woerner <twoerner@redhat.com> 4.1.4-10
  278. - fixed arch order in gmp.h and gmp-mparam.h wrapper for all architectures
  279. - re-include libraries using SSE2 on x86 arch
  280. - updated URL
  281. * Wed May 09 2007 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 4.1.4-6vl2
  282. - rebuilt with new toolchain
  283. * Sat Feb 11 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.1.4-6vl1
  284. - new upstream release
  285. * Mon Apr 18 2005 Thomas Woerner <twoerner@redhat.com> 4.1.4-6
  286. - fixed __setfpucw call in mpfr-test.h
  287. * Sun Sep 26 2004 Florian La Roche <Florian.LaRoche@redhat.de>
  288. - disable ppc64 patch, now fixed upstream
  289. * Wed Mar 31 2004 Thomas Woerner <twoerner@redhat.com> 4.1.2-14
  290. - dropped RPATH (#118506)
  291. - exclude libraries using SSE2 in default settings.
  292. * Fri Mar 12 2004 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 4.1.2-13vl1
  293. - modified for Vine
  294. * Mon Jan 20 2003 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 4.1-1vl3
  295. - added Obsoletes: gmp4(-devel)
  296. * Wed Jan 15 2003 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 4.1-1vl2
  297. - rebuilt against new toolchain
  298. * Fri May 31 2002 KOBAYASHI R. Taizo <tkoba@vinelinux.org>
  299. - modified for Vine
  300. * Sat May 25 2002 Florian La Roche <Florian.LaRoche@redhat.de>
  301. - update to version 4.1
  302. - patch s390 gmp-mparam.h to match other archs.
  303. * Thu May 23 2002 Tim Powers <timp@redhat.com>
  304. - automated rebuild
  305. * Mon Mar 11 2002 Trond Eivind Glomsrød <teg@redhat.com> 4.0.1-3
  306. - Use standard %%configure macro and edit %%{_tmppath}
  307. * Tue Feb 26 2002 Trond Eivind Glomsrød <teg@redhat.com> 4.0.1-2
  308. - Rebuild
  309. * Tue Jan 22 2002 Florian La Roche <Florian.LaRoche@redhat.de>
  310. - update to 4.0.1
  311. - bzip2 src
  312. * Wed Jan 09 2002 Tim Powers <timp@redhat.com>
  313. - automated rebuild
  314. * Sun Jun 24 2001 Elliot Lee <sopwith@redhat.com>
  315. - Bump release + rebuild.
  316. * Mon Feb 05 2001 Philipp Knirsch <pknirsch@redhat.de>
  317. - Fixed bugzilla bug #25515 where GMP wouldn't work on IA64 as IA64 is not
  318. correctly identified as a 64 bit platform.
  319. * Mon Dec 18 2000 Preston Brown <pbrown@redhat.com>
  320. - include bsd mp library
  321. * Tue Oct 17 2000 Florian La Roche <Florian.LaRoche@redhat.de>
  322. - update to 3.1.1
  323. * Sun Sep 3 2000 Florian La Roche <Florian.LaRoche@redhat.com>
  324. - update to 3.1
  325. * Sat Aug 19 2000 Preston Brown <pbrown@redhat.com>
  326. - devel subpackage depends on main package so that .so symlink is OK.
  327. * Thu Jul 13 2000 Prospector <bugzilla@redhat.com>
  328. - automatic rebuild
  329. * Sat Jun 3 2000 Nalin Dahyabhai <nalin@redhat.com>
  330. - switch to the configure and makeinstall macros
  331. - FHS-compliance fixing
  332. - move docs to non-devel package
  333. * Fri Apr 28 2000 Bill Nottingham <notting@redhat.com>
  334. - libtoolize for ia64
  335. * Fri Apr 28 2000 Florian La Roche <Florian.LaRoche@redhat.com>
  336. - update to 3.0.1
  337. * Thu Apr 27 2000 Jakub Jelinek <jakub@redhat.com>
  338. - sparc64 fixes for 3.0
  339. * Wed Apr 26 2000 Florian La Roche <Florian.LaRoche@redhat.com>
  340. - update to 3.0
  341. * Mon Feb 14 2000 Matt Wilson <msw@redhat.com>
  342. - #include <string.h> in files that use string functions
  343. * Wed Feb 02 2000 Cristian Gafton <gafton@redhat.com>
  344. - fix description and summary
  345. * Mon Dec 06 1999 Michael K. Johnson <johnsonm@redhat.com>
  346. - s/GPL/LGPL/
  347. - build as non-root (#7604)
  348. * Mon Sep 06 1999 Jakub Jelinek <jj@ultra.linux.cz>
  349. - merge in some debian gmp fixes
  350. - Ulrich Drepper's __gmp_scale2 fix
  351. - my mpf_set_q fix
  352. - sparc64 fixes
  353. * Wed Apr 28 1999 Cristian Gafton <gafton@redhat.com>
  354. - add sparc patch for PIC handling
  355. * Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com>
  356. - auto rebuild in the new build environment (release 8)
  357. * Thu Feb 11 1999 Michael Johnson <johnsonm@redhat.com>
  358. - include the private header file gmp-mparam.h because several
  359. apps seem to assume that they are building against the gmp
  360. source tree and require it. Sigh.
  361. * Tue Jan 12 1999 Michael K. Johnson <johnsonm@redhat.com>
  362. - libtoolize to work on arm
  363. * Thu Sep 10 1998 Cristian Gafton <gafton@redhat.com>
  364. - yet another touch of the spec file
  365. * Wed Sep 2 1998 Michael Fulbright <msf@redhat.com>
  366. - looked over before inclusion in RH 5.2
  367. * Sun May 24 1998 Dick Porter <dick@cymru.net>
  368. - Patch Makefile.in, not Makefile
  369. - Don't specify i586, let configure decide the arch
  370. * Sat Jan 24 1998 Marc Ewing <marc@redhat.com>
  371. - started with package from Toshio Kuratomi <toshiok@cats.ucsc.edu>
  372. - cleaned up file list
  373. - fixed up install-info support