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