1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
10 compat_version = 4.3.2
12 groups = System/Libraries
13 url = http://gmplib.org/
15 summary = A GNU arbitrary precision library.
18 The gmp package contains GNU MP, a library for arbitrary precision
19 arithmetic, signed integers operations, rational numbers and floating
20 point numbers. GNU MP is designed for speed, for both small and very
21 large operands. GNU MP is fast because it uses fullwords as the basic
22 arithmetic type, it uses fast algorithms, it carefully optimizes
23 assembly code for many CPUs' most common inner loops, and it generally
24 emphasizes speed over simplicity/elegance in its operations.
27 source_dl += ftp://ftp.gnu.org/gnu/gmp/
28 sources = %{thisapp}.tar.bz2 %{name}-%{compat_version}.tar.bz2
36 # Build different versions of gmp to enhance the speed
42 if "%{DISTRO_ARCH}" == "x86_64"
46 if "%{DISTRO_ARCH}" == "i686"
47 # Build sse2 enabled version of gmp.
48 build_versions += sse2
53 configure_options += \
59 for version in %{build_versions}; do
60 mkdir -p build-${version}
63 ln -svf ../configure .
70 CXXFLAGS="${CXXFLAGS}" \
75 sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
76 -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
77 -e 's|-lstdc++ -lm|-lstdc++|' \
80 export LD_LIBRARY_PATH=$(pwd)/.libs
81 make %{PARALLELISMFLAGS} \
83 CXXFLAGS="${CXXFLAGS}"
87 for version in %{build_versions}; do
91 CXXFLAGS="%{CXXFLAGS}"
92 if [ "${version}" = "sse2" ]; then
94 CFLAGS="${CFLAGS} -march=pentium4"
95 CXXFLAGS="${CXXFLAGS} -march=pentium4"
103 # Build compat version of library.
104 cd %{DIR_SRC}/%{name}-%{compat_version}
109 for version in %{build_versions}; do
112 export LD_LIBRARY_PATH=$(pwd)/.libs
118 # Check compat version of library.
119 cd %{DIR_SRC}/%{name}-%{compat_version}
121 export LD_LIBRARY_PATH=$(pwd)/.libs
126 for version in %{build_versions}; do
129 if [ "${version}" = "sse2" ]; then
130 # Manually install sse2 libs.
131 mkdir -pv %{BUILDROOT}/usr/lib/sse2
133 install -m 755 .libs/libgmp.so.*.* %{BUILDROOT}/usr/lib/sse2
134 cp -a .libs/libgmp.so.[^.]* %{BUILDROOT}/usr/lib/sse2
135 chmod 755 %{BUILDROOT}/usr/lib/sse2/libgmp.so.[^.]*
137 install -m 755 .libs/libgmpxx.so.*.* %{BUILDROOT}/usr/lib/sse2
138 cp -a .libs/libgmpxx.so.? %{BUILDROOT}/usr/lib/sse2
139 chmod 755 %{BUILDROOT}/usr/lib/sse2/libgmpxx.so.?
141 install -m 755 .libs/libmp.so.*.* %{BUILDROOT}/usr/lib/sse2
142 cp -a .libs/libmp.so.? %{BUILDROOT}/usr/lib/sse2
143 chmod 755 %{BUILDROOT}/usr/lib/sse2/libmp.so.?
145 make install DESTDIR="%{BUILDROOT}"
151 # Install compat version of library.
152 cd %{DIR_SRC}/%{name}-%{compat_version}
153 install -m 644 .libs/libgmp.so.3.5.2 %{BUILDROOT}%{libdir}
154 ln -svf libgmp.so.3.5.2 %{BUILDROOT}%{libdir}/libgmp.so.3
161 package %{name}-devel
165 package %{name}-compat
166 summary = Compatibility version of %{thisapp} (%{compat_version}).
169 %{libdir}/libgmp.so.3*
173 package %{name}-debuginfo