]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - gmp/gmp.nm
gmp: Update to 5.0.3.
[people/ms/ipfire-3.x.git] / gmp / gmp.nm
CommitLineData
58608bd4 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
58608bd4
MT
4###############################################################################
5
802ea3af 6name = gmp
02881f15
MT
7version = 5.0.3
8release = 1
482cb9d2
MT
9
10compat_version = 4.3.2
58608bd4 11
802ea3af
MT
12groups = System/Libraries
13url = http://gmplib.org/
14license = LGPLv3+
15summary = A GNU arbitrary precision library.
58608bd4 16
802ea3af 17description
482cb9d2
MT
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
58608bd4 24 emphasizes speed over simplicity/elegance in its operations.
802ea3af 25end
58608bd4 26
02881f15 27source_dl += ftp://ftp.gnu.org/gnu/gmp/
482cb9d2 28sources = %{thisapp}.tar.bz2 %{name}-%{compat_version}.tar.bz2
64dc7375 29
802ea3af
MT
30build
31 requires
32 gcc-c++
33 m4
34 end
64dc7375 35
01841414
MT
36 # Build different versions of gmp to enhance the speed
37 # of the OS.
38 build_versions = base
39
40 export ABI = standard
ed91fe31
MT
41
42 if "%{DISTRO_ARCH}" == "x86_64"
43 ABI = 64
44 end
58608bd4 45
ed91fe31 46 if "%{DISTRO_ARCH}" == "i686"
01841414
MT
47 # Build sse2 enabled version of gmp.
48 build_versions += sse2
49
ed91fe31
MT
50 ABI = 32
51 end
52
01841414 53 configure_options += \
01841414
MT
54 --enable-cxx \
55 --enable-mpbsd \
56 --disable-static
57
58 prepare_cmds
59 for version in %{build_versions}; do
3b0f022c 60 mkdir -p build-${version}
01841414
MT
61
62 cd build-${version}
63 ln -svf ../configure .
64 cd ..
65 done
66 end
67
482cb9d2
MT
68 build_one
69 CFLAGS="${CFLAGS}" \
70 CXXFLAGS="${CXXFLAGS}" \
71 ./configure \
72 %{configure_options}
73
74 # Kill RPATHs.
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++|' \
78 -i libtool
79
80 export LD_LIBRARY_PATH=$(pwd)/.libs
81 make %{PARALLELISMFLAGS} \
82 CFLAGS="${CFLAGS}" \
83 CXXFLAGS="${CXXFLAGS}"
84 end
85
ed91fe31 86 build
01841414
MT
87 for version in %{build_versions}; do
88 cd build-${version}
89
90 CFLAGS="%{CFLAGS}"
482cb9d2 91 CXXFLAGS="%{CXXFLAGS}"
01841414
MT
92 if [ "${version}" = "sse2" ]; then
93 # Enable sse2.
94 CFLAGS="${CFLAGS} -march=pentium4"
95 CXXFLAGS="${CXXFLAGS} -march=pentium4"
96 fi
97
482cb9d2 98 %{build_one}
01841414
MT
99
100 cd ..
101 done
482cb9d2
MT
102
103 # Build compat version of library.
104 cd %{DIR_SRC}/%{name}-%{compat_version}
105 %{build_one}
802ea3af
MT
106 end
107
108 test
01841414
MT
109 for version in %{build_versions}; do
110 cd build-${version}
111
482cb9d2 112 export LD_LIBRARY_PATH=$(pwd)/.libs
01841414
MT
113 make check
114
115 cd ..
116 done
482cb9d2
MT
117
118 # Check compat version of library.
119 cd %{DIR_SRC}/%{name}-%{compat_version}
120
121 export LD_LIBRARY_PATH=$(pwd)/.libs
122 make check
01841414
MT
123 end
124
125 install
126 for version in %{build_versions}; do
127 cd build-${version}
128
129 if [ "${version}" = "sse2" ]; then
130 # Manually install sse2 libs.
131 mkdir -pv %{BUILDROOT}/usr/lib/sse2
132
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.[^.]*
136
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.?
140
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.?
144 else
145 make install DESTDIR="%{BUILDROOT}"
146 fi
147
148 cd ..
149 done
482cb9d2
MT
150
151 # Install compat version of library.
152 cd %{DIR_SRC}/%{name}-%{compat_version}
3b0f022c
MT
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
802ea3af
MT
155 end
156end
157
158packages
159 package %{name}
01841414 160
802ea3af
MT
161 package %{name}-devel
162 template DEVEL
163 end
482cb9d2
MT
164
165 package %{name}-compat
166 summary = Compatibility version of %{thisapp} (%{compat_version}).
167
168 files
3b0f022c 169 %{libdir}/libgmp.so.3*
482cb9d2
MT
170 end
171 end
1f9bc2f0
MT
172
173 package %{name}-debuginfo
174 template DEBUGINFO
175 end
802ea3af 176end