]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - gmp/gmp.nm
Merge branch 'master' of ssh://git.ipfire.org/pub/git/ipfire-3.x into arm-port
[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.1
8 release = 2
9
10 groups = System/Libraries
11 url = http://gmplib.org/
12 license = LGPLv3+
13 summary = A GNU arbitrary precision library.
14
15 description
16 The gmp package contains GNU MP, a library for arbitrary precision \
17 arithmetic, signed integers operations, rational numbers and floating \
18 point numbers. GNU MP is designed for speed, for both small and very \
19 large operands. GNU MP is fast because it uses fullwords as the basic \
20 arithmetic type, it uses fast algorithms, it carefully optimizes \
21 assembly code for many CPUs' most common inner loops, and it generally \
22 emphasizes speed over simplicity/elegance in its operations.
23 end
24
25 source_dl = ftp://ftp.gmplib.org/pub/%{thisapp}/
26 sources = %{thisapp}.tar.bz2
27
28 build
29 requires
30 gcc-c++
31 m4
32 end
33
34 # Build different versions of gmp to enhance the speed
35 # of the OS.
36 build_versions = base
37
38 export ABI = standard
39
40 if "%{DISTRO_ARCH}" == "x86_64"
41 ABI = 64
42 end
43
44 if "%{DISTRO_ARCH}" == "i686"
45 # Build sse2 enabled version of gmp.
46 build_versions += sse2
47
48 ABI = 32
49 end
50
51 configure_options += \
52 --prefix=/usr \
53 --enable-cxx \
54 --enable-mpbsd \
55 --disable-static
56
57 prepare_cmds
58 for version in %{build_versions}; do
59 mkdir build-${version}
60
61 cd build-${version}
62 ln -svf ../configure .
63 cd ..
64 done
65 end
66
67 build
68 for version in %{build_versions}; do
69 cd build-${version}
70
71 CFLAGS="%{CFLAGS}"
72 CXXFLAFS="%{CXXFLAGS}"
73 if [ "${version}" = "sse2" ]; then
74 # Enable sse2.
75 CFLAGS="${CFLAGS} -march=pentium4"
76 CXXFLAGS="${CXXFLAGS} -march=pentium4"
77 fi
78
79 CFLAGS="${CFLAGS}" \
80 CXXFLAGS="${CXXFLAGS}" \
81 ./configure \
82 %{configure_options}
83
84 # Kill RPATHs.
85 sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
86 -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
87 -e 's|-lstdc++ -lm|-lstdc++|' \
88 -i libtool
89
90 make %{PARALLELISMFLAGS} \
91 CFLAGS="${CFLAGS}" \
92 CXXFLAGS="${CXXFLAGS}"
93
94 cd ..
95 done
96 end
97
98 test
99 for version in %{build_versions}; do
100 cd build-${version}
101
102 make check
103
104 cd ..
105 done
106 end
107
108 install
109 for version in %{build_versions}; do
110 cd build-${version}
111
112 if [ "${version}" = "sse2" ]; then
113 # Manually install sse2 libs.
114 mkdir -pv %{BUILDROOT}/usr/lib/sse2
115
116 install -m 755 .libs/libgmp.so.*.* %{BUILDROOT}/usr/lib/sse2
117 cp -a .libs/libgmp.so.[^.]* %{BUILDROOT}/usr/lib/sse2
118 chmod 755 %{BUILDROOT}/usr/lib/sse2/libgmp.so.[^.]*
119
120 install -m 755 .libs/libgmpxx.so.*.* %{BUILDROOT}/usr/lib/sse2
121 cp -a .libs/libgmpxx.so.? %{BUILDROOT}/usr/lib/sse2
122 chmod 755 %{BUILDROOT}/usr/lib/sse2/libgmpxx.so.?
123
124 install -m 755 .libs/libmp.so.*.* %{BUILDROOT}/usr/lib/sse2
125 cp -a .libs/libmp.so.? %{BUILDROOT}/usr/lib/sse2
126 chmod 755 %{BUILDROOT}/usr/lib/sse2/libmp.so.?
127 else
128 make install DESTDIR="%{BUILDROOT}"
129 fi
130
131 cd ..
132 done
133 end
134 end
135
136 packages
137 package %{name}
138
139 package %{name}-devel
140 template DEVEL
141 end
142 end