]>
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 |
c8f56dcc | 7 | version = 2.21 |
b8e1d265 | 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 MT |
30 | # Optimize glibc for kernel |
31 | OPTIMIZED_KERNEL = 2.6.32 | |
32 | ||
802ea3af | 33 | requires |
eec2ad4c | 34 | audit-devel |
7f98fc96 MT |
35 | autoconf |
36 | automake | |
eec2ad4c | 37 | gettext |
3994dee1 | 38 | kernel-headers >= %{OPTIMIZED_KERNEL} |
802ea3af MT |
39 | libcap-devel |
40 | libselinux-devel | |
7f98fc96 | 41 | texinfo |
802ea3af MT |
42 | end |
43 | ||
44 | # Build glibc with custom cflags | |
706fb4da | 45 | GLIBC_FLAGS = -O3 -g -fasynchronous-unwind-tables -DNDEBUG -fPIC -DPIC |
802ea3af MT |
46 | |
47 | if "%{DISTRO_ARCH}" == "i686" | |
48 | GLIBC_FLAGS += -march=i686 -mtune=generic | |
706fb4da MT |
49 | end |
50 | ||
51 | if "%{DISTRO_ARCH}" == "x86_64" | |
802ea3af MT |
52 | GLIBC_FLAGS += -mtune=generic |
53 | end | |
54 | ||
55 | export CFLAGS = %{GLIBC_FLAGS} | |
56 | export CXXFLAGS = %{GLIBC_FLAGS} | |
57 | ||
802ea3af MT |
58 | export QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes |
59 | ||
3994dee1 | 60 | prepare_cmds |
802ea3af MT |
61 | # In the vi_VN.TCVN locale, bash enters an infinite loop at startup. It is |
62 | # unknown whether this is a bash bug or a Glibc problem. Disable | |
63 | # installation of this locale in order to avoid the problem. | |
64 | sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED | |
65 | ||
66 | # The ldd shell script contains Bash-specific syntax. Change its default | |
67 | # program interpreter to /bin/bash in case another /bin/sh is installed. | |
68 | sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in | |
69 | ||
70 | # We don't install pt_chown(1) on the final system, so why install it to | |
71 | # $(TOOLS_DIR): | |
72 | sed -e "/^install.*pt_chown/d" -i login/Makefile | |
73 | ||
74 | # Build nscd with -fstack-protector-all, instead of -fstack-protector: | |
75 | sed -e "s/fstack-protector/&-all/" -i nscd/Makefile | |
76 | ||
802ea3af MT |
77 | # Use gnu hash style |
78 | sed -i Makeconfig \ | |
79 | -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/" | |
80 | ||
3994dee1 | 81 | # http://sourceware.org/ml/libc-ports/2011-09/msg00018.html |
389ab7f8 | 82 | sed -e "s/PIC/SHARED/g" -i sysdeps/arm/{set,__long}jmp.S |
802ea3af MT |
83 | end |
84 | ||
e4c5e530 MT |
85 | configure_options = \ |
86 | --build=%{DISTRO_BUILDTARGET} \ | |
e4c5e530 | 87 | --prefix=/usr \ |
706fb4da | 88 | --libexecdir=%{libdir}/glibc \ |
e4c5e530 MT |
89 | --disable-profile \ |
90 | --enable-add-ons \ | |
91 | --enable-kernel=%{OPTIMIZED_KERNEL} \ | |
92 | --with-selinux \ | |
93 | --disable-werror \ | |
eec2ad4c | 94 | --enable-bind-now \ |
3994dee1 | 95 | --enable-obsolete-rpc \ |
b8e1d265 MT |
96 | --with-bugurl=http://bugtracker.ipfire.org \ |
97 | --enable-lock-elision | |
e4c5e530 MT |
98 | |
99 | if "%{DISTRO_ARCH}" == "armv5tel" | |
100 | # Disable hardware FP for ARM. | |
101 | configure_options += \ | |
102 | --without-fp | |
103 | end | |
104 | ||
802ea3af | 105 | build |
e4c5e530 | 106 | mkdir -p %{DIR_SRC}/glibc-build |
802ea3af MT |
107 | cd %{DIR_SRC}/glibc-build |
108 | ||
109 | CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \ | |
110 | ../%{thisapp}/configure \ | |
e4c5e530 | 111 | %{configure_options} |
70b63715 | 112 | |
802ea3af MT |
113 | sed -i config.make \ |
114 | -e "s/^build-pic-default=.*/build-pic-default=yes/" | |
115 | ||
116 | # Our GCC is already passing -fPIC, and that's all we want for the libraries. | |
117 | # LDFLAGS.so is appended to so we don't build shared libraries with | |
118 | # DT_TEXTREL (and to tell us if something goes wrong). For now we only build | |
119 | # the libraries, not the programs: | |
120 | echo "build-programs=no" >> configparms | |
121 | ||
122 | make PARALLELMFLAGS=%{PARALLELISMFLAGS} \ | |
123 | CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \ | |
124 | CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" | |
125 | ||
126 | # Then build the programs with hardening, so everything possible in | |
127 | # is hardened: | |
128 | echo "# Nothing in here :D" > configparms | |
129 | make PARALLELMFLAGS=%{PARALLELISMFLAGS} \ | |
130 | CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}" | |
131 | end | |
132 | ||
802ea3af MT |
133 | install |
134 | cd %{DIR_SRC}/glibc-build | |
135 | make install install_root=%{BUILDROOT} | |
136 | ||
137 | # Locales | |
138 | mkdir -pv %{BUILDROOT}/usr/lib/locale | |
139 | # This would install all locales that are supported | |
140 | make localedata/install-locales install_root=%{BUILDROOT} | |
141 | ||
802ea3af MT |
142 | # Configuration |
143 | cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc | |
144 | mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d} | |
145 | install -p -m644 %{DIR_APP}/nis/nss %{BUILDROOT}/etc/default/nss | |
146 | ||
08884d73 MT |
147 | if [ "%{DISTRO_ARCH}" = "armv7hl" ]; then |
148 | ln -svf ld-linux-armhf.so.3 %{BUILDROOT}/lib/ld-linux.so.3 | |
149 | fi | |
150 | ||
802ea3af MT |
151 | # Remove unused binaries |
152 | rm -vf %{BUILDROOT}/sbin/sln \ | |
153 | %{BUILDROOT}/usr/bin/rpcinfo | |
154 | ||
155 | # Don't distribute linker cache | |
156 | rm -vf %{BUILDROOT}/etc/ld.so.cache | |
157 | ||
158 | # Include /usr/lib/gconv/gconv-modules.cache | |
706fb4da MT |
159 | > %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache |
160 | chmod 644 %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache | |
802ea3af | 161 | |
706fb4da | 162 | strip -g %{BUILDROOT}%{libdir}/*.o |
802ea3af MT |
163 | |
164 | # Move some libs to correct place | |
706fb4da | 165 | mv -v %{BUILDROOT}/%{lib}/lib{memusage,pcprofile}.so %{BUILDROOT}%{libdir} |
4b31eadd MT |
166 | |
167 | # Fix library permissions. | |
168 | chmod 755 %{BUILDROOT}%{libdir}/lib*.so* | |
e448e014 MT |
169 | |
170 | # rquota.x and rquota.h are now provided by quota | |
171 | rm -vf %{BUILDROOT}%{includedir}/rpcsvc/rquota.[hx] | |
802ea3af | 172 | end |
8a3a777f MT |
173 | |
174 | keep_libraries | |
706fb4da MT |
175 | %{libdir}/libc_nonshared.a |
176 | %{libdir}/libpthread_nonshared.a | |
8a3a777f | 177 | end |
802ea3af MT |
178 | end |
179 | ||
180 | packages | |
181 | package glibc | |
1262a291 | 182 | requires = glibc-common = %{thisver} |
08884d73 MT |
183 | |
184 | if "%{DISTRO_ARCH}" == "armv7hl" | |
185 | provides += ld-linux.so.3 | |
186 | provides += ld-linux.so.3(GLIBC_2.4) | |
3bece620 | 187 | provides += ld-linux.so.3(GLIBC_PRIVATE) |
08884d73 | 188 | end |
802ea3af MT |
189 | end |
190 | ||
191 | package glibc-common | |
192 | # XXX description and summary are missing | |
193 | ||
1262a291 MT |
194 | requires |
195 | glibc = %{thisver} | |
196 | tzdata | |
197 | end | |
b0f38bbb | 198 | |
802ea3af MT |
199 | files |
200 | /usr/bin | |
201 | /usr/sbin | |
202 | /usr/share | |
20580800 | 203 | /usr/lib/locale |
802ea3af MT |
204 | !/usr/share/zoneinfo |
205 | end | |
206 | end | |
207 | ||
208 | package glibc-devel | |
209 | summary = Object files for development using standard C libraries. | |
210 | description | |
211 | The glibc-devel package contains the object files necessary | |
212 | for developing programs which use the standard C libraries (which are | |
213 | used by nearly all programs). If you are developing programs which | |
214 | will use the standard C libraries, your system needs to have these | |
215 | standard object files available in order to create the | |
216 | executables. | |
217 | ||
218 | Install glibc-devel if you are going to develop programs which will | |
219 | use the standard C libraries. | |
220 | end | |
221 | group = Development/Libraries | |
222 | ||
1262a291 MT |
223 | requires |
224 | glibc = %{thisver} | |
225 | glibc-headers = %{thisver} | |
226 | end | |
802ea3af | 227 | |
08884d73 MT |
228 | files |
229 | %{includedir} | |
230 | %{libdir}/*.a | |
231 | %{libdir}/*.o | |
232 | end | |
802ea3af MT |
233 | end |
234 | ||
235 | package glibc-headers | |
236 | description | |
237 | The glibc-headers package contains the header files necessary | |
238 | for developing programs which use the standard C libraries (which are | |
239 | used by nearly all programs). If you are developing programs which | |
240 | will use the standard C libraries, your system needs to have these | |
241 | standard header files available in order to create the | |
242 | executables. | |
243 | ||
244 | Install glibc-headers if you are going to develop programs which will | |
245 | use the standard C libraries. | |
246 | end | |
247 | ||
1262a291 MT |
248 | requires |
249 | glibc = %{thisver} | |
250 | kernel-headers >= %{OPTIMIZED_KERNEL} | |
251 | end | |
802ea3af MT |
252 | |
253 | files | |
254 | /usr/include | |
255 | !/usr/include/linuxthreads | |
256 | !/usr/include/gnu/stubs-[32164]*.h | |
257 | end | |
258 | end | |
259 | ||
260 | package nscd | |
261 | summary = A Name Service Caching Daemon (nscd). | |
262 | description | |
263 | Nscd caches name service lookups and can dramatically improve | |
264 | performance with NIS+, and may help with DNS as well. | |
265 | end | |
266 | group = System/Daemons | |
267 | ||
268 | files | |
269 | /usr/sbin/nscd | |
270 | end | |
271 | end | |
272 | ||
273 | package %{name}-utils | |
274 | summary = Development utilities from GNU C library. | |
275 | description | |
276 | The glibc-utils package contains memusage, a memory usage profiler, | |
277 | mtrace, a memory leak tracer and xtrace, a function call tracer | |
278 | which can be helpful during program debugging. | |
279 | end | |
280 | group = Development/Tools | |
281 | ||
282 | files | |
283 | /usr/bin/memusage | |
284 | /usr/bin/memusagestat | |
285 | /usr/bin/mtrace | |
286 | /usr/bin/pcprofiledump | |
287 | /usr/bin/xtrace | |
706fb4da MT |
288 | %{libdir}/libmemusage.so |
289 | %{libdir}/libpcprofile.so | |
802ea3af MT |
290 | end |
291 | end | |
1f9bc2f0 MT |
292 | |
293 | package %{name}-debuginfo | |
294 | template DEBUGINFO | |
295 | end | |
802ea3af | 296 | end |