2 # Important for %{ix86}:
3 # This rpm has to be build on a CPU with sse2 support like Pentium 4 !
7 Summary: A GNU arbitrary precision library
10 URL: http://gmplib.org/
11 Source0: ftp://ftp.gnu.org/pub/gnu/gmp/gmp-%{version}.tar.bz2
14 License: GPLv3+ and LGPLv3
15 Group: System/Libraries
16 BuildRequires: autoconf
17 BuildRequires: automake
18 BuildRequires: libtool
21 The gmp package contains GNU MP, a library for arbitrary precision
22 arithmetic, signed integers operations, rational numbers and floating
23 point numbers. GNU MP is designed for speed, for both small and very
24 large operands. GNU MP is fast because it uses fullwords as the basic
25 arithmetic type, it uses fast algorithms, it carefully optimizes
26 assembly code for many CPUs' most common inner loops, and it generally
27 emphasizes speed over simplicity/elegance in its operations.
29 Install the gmp package if you need a fast arbitrary precision
33 Summary: Development tools for the GNU MP arbitrary precision library
34 Group: Development/Libraries
35 Requires: %{name} = %{version}-%{release}
38 The libraries, header files and documentation for using the GNU MP
39 arbitrary precision library in applications.
41 If you want to develop applications which will use the GNU MP library,
42 you'll need to install the gmp-devel package. You'll also need to
43 install the gmp package.
46 Summary: Development tools for the GNU MP arbitrary precision library
47 Group: Development/Libraries
48 Requires: %{name}-devel = %{version}-%{release}
51 The static libraries for using the GNU MP arbitrary precision library
59 if as --help | grep -q execstack; then
60 # the object files do not require an executable stack
61 export CCAS="gcc -c -Wa,--noexecstack"
66 ./configure --build=%{_build} --host=%{_host} \
67 --program-prefix=%{?_program_prefix} \
69 --exec-prefix=%{_exec_prefix} \
71 --sbindir=%{_sbindir} \
72 --sysconfdir=%{_sysconfdir} \
73 --datadir=%{_datadir} \
74 --includedir=%{_includedir} \
76 --libexecdir=%{_libexecdir} \
77 --localstatedir=%{_localstatedir} \
78 --sharedstatedir=%{_sharedstatedir} \
80 --infodir=%{_infodir} \
81 --enable-mpbsd --enable-cxx
82 perl -pi -e 's|hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=\"-L\\\$libdir\"|g;' libtool
83 export LD_LIBRARY_PATH=`pwd`/.libs
84 make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
90 CFLAGS="%{optflags} -march=pentium4"
91 ./configure --build=%{_build} --host=%{_host} \
92 --program-prefix=%{?_program_prefix} \
94 --exec-prefix=%{_exec_prefix} \
96 --sbindir=%{_sbindir} \
97 --sysconfdir=%{_sysconfdir} \
98 --datadir=%{_datadir} \
99 --includedir=%{_includedir} \
100 --libdir=%{_libdir} \
101 --libexecdir=%{_libexecdir} \
102 --localstatedir=%{_localstatedir} \
103 --sharedstatedir=%{_sharedstatedir} \
104 --mandir=%{_mandir} \
105 --infodir=%{_infodir} \
106 --enable-mpbsd --enable-cxx
107 perl -pi -e 's|hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=\"-L\\\$libdir\"|g;' libtool
108 export LD_LIBRARY_PATH=`pwd`/.libs
115 rm -rf $RPM_BUILD_ROOT
117 export LD_LIBRARY_PATH=`pwd`/.libs
118 make install DESTDIR=$RPM_BUILD_ROOT
119 install -m 644 gmp-mparam.h ${RPM_BUILD_ROOT}%{_includedir}
120 rm -f $RPM_BUILD_ROOT%{_libdir}/lib{gmp,mp,gmpxx}.la
121 rm -f $RPM_BUILD_ROOT%{_infodir}/dir
122 /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
123 ln -sf libgmpxx.so.4 $RPM_BUILD_ROOT%{_libdir}/libgmpxx.so
127 export LD_LIBRARY_PATH=`pwd`/.libs
128 mkdir $RPM_BUILD_ROOT%{_libdir}/sse2
129 install -m 755 .libs/libgmp.so.10.* $RPM_BUILD_ROOT%{_libdir}/sse2
130 cp -a .libs/libgmp.so.10 $RPM_BUILD_ROOT%{_libdir}/sse2
131 chmod 755 $RPM_BUILD_ROOT%{_libdir}/sse2/libgmp.so.10
132 install -m 755 .libs/libgmpxx.so.4.* $RPM_BUILD_ROOT%{_libdir}/sse2
133 cp -a .libs/libgmpxx.so.4 $RPM_BUILD_ROOT%{_libdir}/sse2
134 chmod 755 $RPM_BUILD_ROOT%{_libdir}/sse2/libgmpxx.so.4
135 install -m 755 .libs/libmp.so.3.* $RPM_BUILD_ROOT%{_libdir}/sse2
136 cp -a .libs/libmp.so.3 $RPM_BUILD_ROOT%{_libdir}/sse2
137 chmod 755 $RPM_BUILD_ROOT%{_libdir}/sse2/libmp.so.3
141 # Rename gmp.h to gmp-<arch>.h and gmp-mparam.h to gmp-mparam-<arch>.h to
142 # avoid file conflicts on multilib systems and install wrapper include files
143 # gmp.h and gmp-mparam-<arch>.h
145 # always use i386 for iX86
149 # always use arm for arm*
153 # superH architecture support
157 # Rename files and install wrappers
159 mv %{buildroot}/%{_includedir}/gmp.h %{buildroot}/%{_includedir}/gmp-${basearch}.h
160 install -m644 %{SOURCE2} %{buildroot}/%{_includedir}/gmp.h
161 mv %{buildroot}/%{_includedir}/gmp-mparam.h %{buildroot}/%{_includedir}/gmp-mparam-${basearch}.h
162 install -m644 %{SOURCE3} %{buildroot}/%{_includedir}/gmp-mparam.h
167 export LD_LIBRARY_PATH=`pwd`/.libs
168 make %{?_smp_mflags} check
172 export LD_LIBRARY_PATH=`pwd`/.libs
173 make %{?_smp_mflags} check
180 %post -p /sbin/ldconfig
182 %postun -p /sbin/ldconfig
186 rm -rf $RPM_BUILD_ROOT
189 %defattr(-,root,root,-)
190 %{_libdir}/libgmp.so.*
191 %{_libdir}/libmp.so.*
192 %{_libdir}/libgmpxx.so.*
198 %defattr(-,root,root,-)
201 %{_libdir}/libgmpxx.so
205 %defattr(-,root,root,-)
208 %{_libdir}/libgmpxx.a