]>
Commit | Line | Data |
---|---|---|
166a6c21 | 1 | ############################################################################### |
802ea3af MT |
2 | # IPFire.org - An Open Source Firewall Solution # |
3 | # Copyright (C) - IPFire Development Team <info@ipfire.org> # | |
166a6c21 MT |
4 | ############################################################################### |
5 | ||
802ea3af | 6 | name = glibc |
80b7ed53 | 7 | version = 2.26 |
d7d685fc | 8 | release = 1 |
802ea3af MT |
9 | |
10 | maintainer = Michael Tremer <michael.tremer@ipfire.org> | |
11 | groups = System/Base | |
c8f56dcc | 12 | url = http://www.gnu.org/software/libc/libc.html |
802ea3af MT |
13 | license = GPLv2+ LGPLv2+ |
14 | summary = The GNU libc libraries. | |
15 | ||
16 | description | |
17 | The glibc package contains standard libraries which are used by | |
18 | multiple programs on the system. In order to save disk space and | |
19 | memory, as well as to make upgrading easier, common system code is | |
20 | kept in one place and shared between programs. This particular package | |
21 | contains the most important sets of shared libraries: the standard C | |
22 | library and the standard math library. Without these two libraries, a | |
166a6c21 | 23 | Linux system will not function. |
802ea3af MT |
24 | end |
25 | ||
26 | source_dl = http://ftp.gnu.org/gnu/glibc/ | |
3994dee1 | 27 | sources = %{thisapp}.tar.xz |
802ea3af MT |
28 | |
29 | build | |
16cbb54b | 30 | # Optimize glibc for kernel |
ee62c3f9 | 31 | OPTIMIZED_KERNEL = 3.2 |
16cbb54b | 32 | |
802ea3af | 33 | requires |
eec2ad4c | 34 | audit-devel |
7f98fc96 MT |
35 | autoconf |
36 | automake | |
4eec3d94 | 37 | binutils >= 2.27 |
80b7ed53 | 38 | gcc >= 4.9 |
eec2ad4c | 39 | gettext |
3994dee1 | 40 | kernel-headers >= %{OPTIMIZED_KERNEL} |
802ea3af | 41 | libcap-devel |
ee62c3f9 | 42 | libstdc++-static |
7f98fc96 | 43 | texinfo |
802ea3af MT |
44 | end |
45 | ||
46 | # Build glibc with custom cflags | |
4eec3d94 | 47 | GLIBC_FLAGS = -O3 -g -fasynchronous-unwind-tables -DNDEBUG |
802ea3af MT |
48 | |
49 | if "%{DISTRO_ARCH}" == "i686" | |
50 | GLIBC_FLAGS += -march=i686 -mtune=generic | |
706fb4da MT |
51 | end |
52 | ||
53 | if "%{DISTRO_ARCH}" == "x86_64" | |
802ea3af MT |
54 | GLIBC_FLAGS += -mtune=generic |
55 | end | |
56 | ||
57 | export CFLAGS = %{GLIBC_FLAGS} | |
58 | export CXXFLAGS = %{GLIBC_FLAGS} | |
59 | ||
802ea3af MT |
60 | export QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes |
61 | ||
3994dee1 | 62 | prepare_cmds |
802ea3af MT |
63 | # In the vi_VN.TCVN locale, bash enters an infinite loop at startup. It is |
64 | # unknown whether this is a bash bug or a Glibc problem. Disable | |
65 | # installation of this locale in order to avoid the problem. | |
66 | sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED | |
67 | ||
68 | # The ldd shell script contains Bash-specific syntax. Change its default | |
69 | # program interpreter to /bin/bash in case another /bin/sh is installed. | |
70 | sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in | |
71 | ||
ee62c3f9 | 72 | # We don't install pt_chown(1) on the final system |
802ea3af MT |
73 | sed -e "/^install.*pt_chown/d" -i login/Makefile |
74 | ||
75 | # Build nscd with -fstack-protector-all, instead of -fstack-protector: | |
ee62c3f9 | 76 | sed -e "s/fstack-protector/&-strong/" -i nscd/Makefile |
802ea3af | 77 | |
802ea3af MT |
78 | # Use gnu hash style |
79 | sed -i Makeconfig \ | |
80 | -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/" | |
81 | ||
3994dee1 | 82 | # http://sourceware.org/ml/libc-ports/2011-09/msg00018.html |
389ab7f8 | 83 | sed -e "s/PIC/SHARED/g" -i sysdeps/arm/{set,__long}jmp.S |
802ea3af MT |
84 | end |
85 | ||
e4c5e530 MT |
86 | configure_options = \ |
87 | --build=%{DISTRO_BUILDTARGET} \ | |
e4c5e530 | 88 | --prefix=/usr \ |
706fb4da | 89 | --libexecdir=%{libdir}/glibc \ |
e4c5e530 MT |
90 | --disable-profile \ |
91 | --enable-add-ons \ | |
92 | --enable-kernel=%{OPTIMIZED_KERNEL} \ | |
e4c5e530 | 93 | --disable-werror \ |
d7d685fc | 94 | --enable-stack-protector=strong \ |
eec2ad4c | 95 | --enable-bind-now \ |
3994dee1 | 96 | --enable-obsolete-rpc \ |
b8e1d265 MT |
97 | --with-bugurl=http://bugtracker.ipfire.org \ |
98 | --enable-lock-elision | |
e4c5e530 MT |
99 | |
100 | if "%{DISTRO_ARCH}" == "armv5tel" | |
101 | # Disable hardware FP for ARM. | |
102 | configure_options += \ | |
103 | --without-fp | |
104 | end | |
105 | ||
802ea3af | 106 | build |
e4c5e530 | 107 | mkdir -p %{DIR_SRC}/glibc-build |
802ea3af MT |
108 | cd %{DIR_SRC}/glibc-build |
109 | ||
110 | CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \ | |
111 | ../%{thisapp}/configure \ | |
e4c5e530 | 112 | %{configure_options} |
70b63715 | 113 | |
802ea3af MT |
114 | make PARALLELMFLAGS=%{PARALLELISMFLAGS} \ |
115 | CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}" | |
116 | end | |
117 | ||
802ea3af MT |
118 | install |
119 | cd %{DIR_SRC}/glibc-build | |
120 | make install install_root=%{BUILDROOT} | |
121 | ||
122 | # Locales | |
123 | mkdir -pv %{BUILDROOT}/usr/lib/locale | |
124 | # This would install all locales that are supported | |
125 | make localedata/install-locales install_root=%{BUILDROOT} | |
126 | ||
802ea3af MT |
127 | # Configuration |
128 | cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc | |
129 | mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d} | |
130 | install -p -m644 %{DIR_APP}/nis/nss %{BUILDROOT}/etc/default/nss | |
131 | ||
08884d73 MT |
132 | if [ "%{DISTRO_ARCH}" = "armv7hl" ]; then |
133 | ln -svf ld-linux-armhf.so.3 %{BUILDROOT}/lib/ld-linux.so.3 | |
134 | fi | |
135 | ||
802ea3af MT |
136 | # Remove unused binaries |
137 | rm -vf %{BUILDROOT}/sbin/sln \ | |
138 | %{BUILDROOT}/usr/bin/rpcinfo | |
139 | ||
140 | # Don't distribute linker cache | |
141 | rm -vf %{BUILDROOT}/etc/ld.so.cache | |
142 | ||
143 | # Include /usr/lib/gconv/gconv-modules.cache | |
706fb4da MT |
144 | > %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache |
145 | chmod 644 %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache | |
802ea3af | 146 | |
706fb4da | 147 | strip -g %{BUILDROOT}%{libdir}/*.o |
802ea3af MT |
148 | |
149 | # Move some libs to correct place | |
706fb4da | 150 | mv -v %{BUILDROOT}/%{lib}/lib{memusage,pcprofile}.so %{BUILDROOT}%{libdir} |
4b31eadd MT |
151 | |
152 | # Fix library permissions. | |
153 | chmod 755 %{BUILDROOT}%{libdir}/lib*.so* | |
e448e014 MT |
154 | |
155 | # rquota.x and rquota.h are now provided by quota | |
156 | rm -vf %{BUILDROOT}%{includedir}/rpcsvc/rquota.[hx] | |
802ea3af | 157 | end |
8a3a777f MT |
158 | |
159 | keep_libraries | |
706fb4da | 160 | %{libdir}/libc_nonshared.a |
301beda7 | 161 | %{libdir}/libmvec_nonshared.a |
706fb4da | 162 | %{libdir}/libpthread_nonshared.a |
8a3a777f | 163 | end |
802ea3af MT |
164 | end |
165 | ||
166 | packages | |
167 | package glibc | |
08884d73 MT |
168 | if "%{DISTRO_ARCH}" == "armv7hl" |
169 | provides += ld-linux.so.3 | |
170 | provides += ld-linux.so.3(GLIBC_2.4) | |
3bece620 | 171 | provides += ld-linux.so.3(GLIBC_PRIVATE) |
08884d73 | 172 | end |
ee62c3f9 | 173 | |
1262a291 | 174 | requires |
1262a291 MT |
175 | tzdata |
176 | end | |
b0f38bbb | 177 | |
9ec02175 MT |
178 | conflicts |
179 | kernel < %{OPTIMIZED_KERNEL} | |
180 | end | |
181 | ||
182 | obsoletes | |
183 | glibc-common < %{thisver} | |
802ea3af MT |
184 | end |
185 | end | |
186 | ||
187 | package glibc-devel | |
9ec02175 | 188 | template DEVEL |
802ea3af | 189 | |
1262a291 MT |
190 | requires |
191 | glibc = %{thisver} | |
192 | glibc-headers = %{thisver} | |
9ec02175 | 193 | kernel-headers >= %{OPTIMIZED_KERNEL} |
1262a291 | 194 | end |
802ea3af | 195 | |
9ec02175 MT |
196 | provides |
197 | glibc-headers = %{thisver} | |
802ea3af MT |
198 | end |
199 | ||
9ec02175 MT |
200 | obsoletes |
201 | glibc-headers < %{thisver} | |
1262a291 | 202 | end |
802ea3af | 203 | |
9ec02175 | 204 | files += %{libdir}/*.[ao] |
802ea3af MT |
205 | end |
206 | ||
207 | package nscd | |
208 | summary = A Name Service Caching Daemon (nscd). | |
209 | description | |
210 | Nscd caches name service lookups and can dramatically improve | |
211 | performance with NIS+, and may help with DNS as well. | |
212 | end | |
213 | group = System/Daemons | |
214 | ||
215 | files | |
216 | /usr/sbin/nscd | |
217 | end | |
218 | end | |
219 | ||
220 | package %{name}-utils | |
221 | summary = Development utilities from GNU C library. | |
222 | description | |
223 | The glibc-utils package contains memusage, a memory usage profiler, | |
224 | mtrace, a memory leak tracer and xtrace, a function call tracer | |
225 | which can be helpful during program debugging. | |
226 | end | |
227 | group = Development/Tools | |
228 | ||
229 | files | |
230 | /usr/bin/memusage | |
231 | /usr/bin/memusagestat | |
232 | /usr/bin/mtrace | |
233 | /usr/bin/pcprofiledump | |
234 | /usr/bin/xtrace | |
706fb4da MT |
235 | %{libdir}/libmemusage.so |
236 | %{libdir}/libpcprofile.so | |
802ea3af MT |
237 | end |
238 | end | |
1f9bc2f0 MT |
239 | |
240 | package %{name}-debuginfo | |
241 | template DEBUGINFO | |
242 | end | |
802ea3af | 243 | end |