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