]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - gmp/gmp.nm
grep: Update to 2.17.
[people/ms/ipfire-3.x.git] / gmp / gmp.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = gmp
7 version = 5.0.5
8 release = 1
9
10 compat_version = 4.3.2
11
12 groups = System/Libraries
13 url = http://gmplib.org/
14 license = LGPLv3+
15 summary = A GNU arbitrary precision library.
16
17 description
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.
25 end
26
27 source_dl += ftp://ftp.gnu.org/gnu/gmp/
28 sources = %{thisapp}.tar.bz2 %{name}-%{compat_version}.tar.bz2
29
30 build
31 requires
32 gcc-c++
33 m4
34 end
35
36 # Build different versions of gmp to enhance the speed
37 # of the OS.
38 build_versions = base
39
40 export ABI = standard
41
42 if "%{DISTRO_ARCH}" == "x86_64"
43 ABI = 64
44 end
45
46 if "%{DISTRO_ARCH}" == "i686"
47 # Build sse2 enabled version of gmp.
48 build_versions += sse2
49
50 ABI = 32
51 end
52
53 configure_options += \
54 --enable-cxx \
55 --enable-mpbsd \
56 --disable-static
57
58 prepare_cmds
59 for version in %{build_versions}; do
60 mkdir -p build-${version}
61
62 cd build-${version}
63 ln -svf ../configure .
64 cd ..
65 done
66 end
67
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
86 build
87 for version in %{build_versions}; do
88 cd build-${version}
89
90 CFLAGS="%{CFLAGS}"
91 CXXFLAGS="%{CXXFLAGS}"
92 if [ "${version}" = "sse2" ]; then
93 # Enable sse2.
94 CFLAGS="${CFLAGS} -march=pentium4"
95 CXXFLAGS="${CXXFLAGS} -march=pentium4"
96 fi
97
98 %{build_one}
99
100 cd ..
101 done
102
103 # Build compat version of library.
104 cd %{DIR_SRC}/%{name}-%{compat_version}
105 %{build_one}
106 end
107
108 test
109 for version in %{build_versions}; do
110 cd build-${version}
111
112 export LD_LIBRARY_PATH=$(pwd)/.libs
113 make check
114
115 cd ..
116 done
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
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
150
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
155 end
156 end
157
158 packages
159 package %{name}
160
161 package %{name}-devel
162 template DEVEL
163 end
164
165 package %{name}-compat
166 summary = Compatibility version of %{thisapp} (%{compat_version}).
167
168 files
169 %{libdir}/libgmp.so.3*
170 end
171 end
172
173 package %{name}-debuginfo
174 template DEBUGINFO
175 end
176 end