]>
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 |
4eec3d94 | 7 | version = 2.24 |
963c362f | 8 | release = 3 |
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 |
ee62c3f9 | 38 | gcc >= 4.7 |
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 \ |
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 | # Our GCC is already passing -fPIC, and that's all we want for the libraries. |
114 | # LDFLAGS.so is appended to so we don't build shared libraries with | |
115 | # DT_TEXTREL (and to tell us if something goes wrong). For now we only build | |
116 | # the libraries, not the programs: | |
117 | echo "build-programs=no" >> configparms | |
118 | ||
119 | make PARALLELMFLAGS=%{PARALLELISMFLAGS} \ | |
120 | CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \ | |
121 | CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" | |
122 | ||
123 | # Then build the programs with hardening, so everything possible in | |
124 | # is hardened: | |
125 | echo "# Nothing in here :D" > configparms | |
126 | make PARALLELMFLAGS=%{PARALLELISMFLAGS} \ | |
127 | CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}" | |
128 | end | |
129 | ||
802ea3af MT |
130 | install |
131 | cd %{DIR_SRC}/glibc-build | |
132 | make install install_root=%{BUILDROOT} | |
133 | ||
134 | # Locales | |
135 | mkdir -pv %{BUILDROOT}/usr/lib/locale | |
136 | # This would install all locales that are supported | |
137 | make localedata/install-locales install_root=%{BUILDROOT} | |
138 | ||
802ea3af MT |
139 | # Configuration |
140 | cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc | |
141 | mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d} | |
142 | install -p -m644 %{DIR_APP}/nis/nss %{BUILDROOT}/etc/default/nss | |
143 | ||
08884d73 MT |
144 | if [ "%{DISTRO_ARCH}" = "armv7hl" ]; then |
145 | ln -svf ld-linux-armhf.so.3 %{BUILDROOT}/lib/ld-linux.so.3 | |
146 | fi | |
147 | ||
802ea3af MT |
148 | # Remove unused binaries |
149 | rm -vf %{BUILDROOT}/sbin/sln \ | |
150 | %{BUILDROOT}/usr/bin/rpcinfo | |
151 | ||
152 | # Don't distribute linker cache | |
153 | rm -vf %{BUILDROOT}/etc/ld.so.cache | |
154 | ||
155 | # Include /usr/lib/gconv/gconv-modules.cache | |
706fb4da MT |
156 | > %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache |
157 | chmod 644 %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache | |
802ea3af | 158 | |
706fb4da | 159 | strip -g %{BUILDROOT}%{libdir}/*.o |
802ea3af MT |
160 | |
161 | # Move some libs to correct place | |
706fb4da | 162 | mv -v %{BUILDROOT}/%{lib}/lib{memusage,pcprofile}.so %{BUILDROOT}%{libdir} |
4b31eadd MT |
163 | |
164 | # Fix library permissions. | |
165 | chmod 755 %{BUILDROOT}%{libdir}/lib*.so* | |
e448e014 MT |
166 | |
167 | # rquota.x and rquota.h are now provided by quota | |
168 | rm -vf %{BUILDROOT}%{includedir}/rpcsvc/rquota.[hx] | |
802ea3af | 169 | end |
8a3a777f MT |
170 | |
171 | keep_libraries | |
706fb4da | 172 | %{libdir}/libc_nonshared.a |
301beda7 | 173 | %{libdir}/libmvec_nonshared.a |
706fb4da | 174 | %{libdir}/libpthread_nonshared.a |
8a3a777f | 175 | end |
802ea3af MT |
176 | end |
177 | ||
178 | packages | |
179 | package glibc | |
08884d73 MT |
180 | if "%{DISTRO_ARCH}" == "armv7hl" |
181 | provides += ld-linux.so.3 | |
182 | provides += ld-linux.so.3(GLIBC_2.4) | |
3bece620 | 183 | provides += ld-linux.so.3(GLIBC_PRIVATE) |
08884d73 | 184 | end |
ee62c3f9 | 185 | |
1262a291 | 186 | requires |
1262a291 MT |
187 | tzdata |
188 | end | |
b0f38bbb | 189 | |
9ec02175 MT |
190 | conflicts |
191 | kernel < %{OPTIMIZED_KERNEL} | |
192 | end | |
193 | ||
194 | obsoletes | |
195 | glibc-common < %{thisver} | |
802ea3af MT |
196 | end |
197 | end | |
198 | ||
199 | package glibc-devel | |
9ec02175 | 200 | template DEVEL |
802ea3af | 201 | |
1262a291 MT |
202 | requires |
203 | glibc = %{thisver} | |
204 | glibc-headers = %{thisver} | |
9ec02175 | 205 | kernel-headers >= %{OPTIMIZED_KERNEL} |
1262a291 | 206 | end |
802ea3af | 207 | |
9ec02175 MT |
208 | provides |
209 | glibc-headers = %{thisver} | |
802ea3af MT |
210 | end |
211 | ||
9ec02175 MT |
212 | obsoletes |
213 | glibc-headers < %{thisver} | |
1262a291 | 214 | end |
802ea3af | 215 | |
9ec02175 | 216 | files += %{libdir}/*.[ao] |
802ea3af MT |
217 | end |
218 | ||
219 | package nscd | |
220 | summary = A Name Service Caching Daemon (nscd). | |
221 | description | |
222 | Nscd caches name service lookups and can dramatically improve | |
223 | performance with NIS+, and may help with DNS as well. | |
224 | end | |
225 | group = System/Daemons | |
226 | ||
227 | files | |
228 | /usr/sbin/nscd | |
229 | end | |
230 | end | |
231 | ||
232 | package %{name}-utils | |
233 | summary = Development utilities from GNU C library. | |
234 | description | |
235 | The glibc-utils package contains memusage, a memory usage profiler, | |
236 | mtrace, a memory leak tracer and xtrace, a function call tracer | |
237 | which can be helpful during program debugging. | |
238 | end | |
239 | group = Development/Tools | |
240 | ||
241 | files | |
242 | /usr/bin/memusage | |
243 | /usr/bin/memusagestat | |
244 | /usr/bin/mtrace | |
245 | /usr/bin/pcprofiledump | |
246 | /usr/bin/xtrace | |
706fb4da MT |
247 | %{libdir}/libmemusage.so |
248 | %{libdir}/libpcprofile.so | |
802ea3af MT |
249 | end |
250 | end | |
1f9bc2f0 MT |
251 | |
252 | package %{name}-debuginfo | |
253 | template DEBUGINFO | |
254 | end | |
802ea3af | 255 | end |