]>
Commit | Line | Data |
---|---|---|
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 MT |
6 | name = gmp |
7 | version = 5.0.1 | |
01841414 | 8 | release = 2 |
58608bd4 | 9 | |
802ea3af MT |
10 | groups = System/Libraries |
11 | url = http://gmplib.org/ | |
12 | license = LGPLv3+ | |
13 | summary = A GNU arbitrary precision library. | |
58608bd4 | 14 | |
802ea3af | 15 | description |
58608bd4 MT |
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. | |
802ea3af | 23 | end |
58608bd4 | 24 | |
ed91fe31 | 25 | source_dl = ftp://ftp.gmplib.org/pub/%{thisapp}/ |
802ea3af | 26 | sources = %{thisapp}.tar.bz2 |
64dc7375 | 27 | |
802ea3af MT |
28 | build |
29 | requires | |
30 | gcc-c++ | |
31 | m4 | |
32 | end | |
64dc7375 | 33 | |
01841414 MT |
34 | # Build different versions of gmp to enhance the speed |
35 | # of the OS. | |
36 | build_versions = base | |
37 | ||
38 | export ABI = standard | |
ed91fe31 MT |
39 | |
40 | if "%{DISTRO_ARCH}" == "x86_64" | |
41 | ABI = 64 | |
42 | end | |
58608bd4 | 43 | |
ed91fe31 | 44 | if "%{DISTRO_ARCH}" == "i686" |
01841414 MT |
45 | # Build sse2 enabled version of gmp. |
46 | build_versions += sse2 | |
47 | ||
ed91fe31 MT |
48 | ABI = 32 |
49 | end | |
50 | ||
01841414 MT |
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 | ||
ed91fe31 | 67 | build |
01841414 MT |
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 | |
802ea3af MT |
96 | end |
97 | ||
98 | test | |
01841414 MT |
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 | |
802ea3af MT |
133 | end |
134 | end | |
135 | ||
136 | packages | |
137 | package %{name} | |
01841414 | 138 | |
802ea3af MT |
139 | package %{name}-devel |
140 | template DEVEL | |
141 | end | |
142 | end |