]> git.ipfire.org Git - ipfire-3.x.git/blob - glibc/glibc.nm
012e5b3d8ae18fccba5bd7877110f9bbb1a70ec8
[ipfire-3.x.git] / glibc / glibc.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = glibc
7 version = 2.28
8 release = 2
9
10 maintainer = Michael Tremer <michael.tremer@ipfire.org>
11 groups = System/Base
12 url = http://www.gnu.org/software/libc/libc.html
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
23 Linux system will not function.
24 end
25
26 source_dl = http://ftp.gnu.org/gnu/glibc/
27 sources = %{thisapp}.tar.xz
28
29 build
30 # Optimize glibc for kernel
31 OPTIMIZED_KERNEL = 3.2
32
33 requires
34 autoconf
35 automake
36 binutils >= 2.29
37 bison
38 gcc >= 8
39 gettext
40 kernel-headers >= %{OPTIMIZED_KERNEL}
41 make >= 4.0
42 libcap-devel
43 libstdc++-static
44 texinfo
45 end
46
47 # Build glibc with custom cflags
48 GLIBC_FLAGS = -O2 -g -DNDEBUG -pipe
49
50 if "%{DISTRO_ARCH}" == "i686"
51 GLIBC_FLAGS += -march=i686 -mtune=generic
52 end
53
54 if "%{DISTRO_ARCH}" == "x86_64"
55 GLIBC_FLAGS += -mtune=generic
56 end
57
58 export CFLAGS = %{GLIBC_FLAGS}
59 export CXXFLAGS = %{GLIBC_FLAGS}
60
61 export QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes
62
63 prepare_cmds
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
73 # We don't install pt_chown(1) on the final system
74 sed -e "/^install.*pt_chown/d" -i login/Makefile
75
76 # Build nscd with -fstack-protector-all, instead of -fstack-protector:
77 sed -e "s/fstack-protector/&-strong/" -i nscd/Makefile
78
79 # Use gnu hash style
80 sed -i Makeconfig \
81 -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/"
82
83 # http://sourceware.org/ml/libc-ports/2011-09/msg00018.html
84 sed -e "s/PIC/SHARED/g" -i sysdeps/arm/{set,__long}jmp.S
85 end
86
87 configure_options = \
88 --build=%{DISTRO_BUILDTARGET} \
89 --prefix=/usr \
90 --libexecdir=%{libdir}/glibc \
91 --disable-profile \
92 --enable-add-ons \
93 --enable-kernel=%{OPTIMIZED_KERNEL} \
94 --disable-werror \
95 --enable-stack-protector=strong \
96 --enable-bind-now \
97 --enable-obsolete-rpc \
98 --with-bugurl=http://bugtracker.ipfire.org \
99 --enable-lock-elision \
100 --enable-cet
101
102 if "%{DISTRO_ARCH}" == "armv5tel"
103 # Disable hardware FP for ARM.
104 configure_options += \
105 --without-fp
106 end
107
108 build
109 mkdir -p %{DIR_SRC}/glibc-build
110 cd %{DIR_SRC}/glibc-build
111
112 CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \
113 ../%{thisapp}/configure \
114 %{configure_options}
115
116 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
117 CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}"
118 end
119
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
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
134 if [ "%{DISTRO_ARCH}" = "armv7hl" ]; then
135 ln -svf ld-linux-armhf.so.3 %{BUILDROOT}/lib/ld-linux.so.3
136 fi
137
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
146 > %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
147 chmod 644 %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
148
149 strip -g %{BUILDROOT}%{libdir}/*.o
150
151 # Move some libs to correct place
152 mv -v %{BUILDROOT}/%{lib}/lib{memusage,pcprofile}.so %{BUILDROOT}%{libdir}
153
154 # Fix library permissions.
155 chmod 755 %{BUILDROOT}%{libdir}/lib*.so*
156
157 # rquota.x and rquota.h are now provided by quota
158 rm -vf %{BUILDROOT}%{includedir}/rpcsvc/rquota.[hx]
159 end
160
161 keep_libraries
162 %{libdir}/libc_nonshared.a
163 %{libdir}/libmvec_nonshared.a
164 %{libdir}/libpthread_nonshared.a
165 end
166 end
167
168 packages
169 package glibc
170 if "%{DISTRO_ARCH}" == "armv7hl"
171 provides += ld-linux.so.3
172 provides += ld-linux.so.3(GLIBC_2.4)
173 provides += ld-linux.so.3(GLIBC_PRIVATE)
174 end
175
176 requires
177 tzdata
178 end
179
180 conflicts
181 kernel < %{OPTIMIZED_KERNEL}
182 end
183
184 obsoletes
185 glibc-common < %{thisver}
186 end
187 end
188
189 package glibc-devel
190 template DEVEL
191
192 requires
193 glibc = %{thisver}
194 glibc-headers = %{thisver}
195 kernel-headers >= %{OPTIMIZED_KERNEL}
196 end
197
198 provides
199 glibc-headers = %{thisver}
200 end
201
202 obsoletes
203 glibc-headers < %{thisver}
204 end
205
206 files += %{libdir}/*.[ao]
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
237 %{libdir}/libmemusage.so
238 %{libdir}/libpcprofile.so
239 end
240 end
241
242 package %{name}-debuginfo
243 template DEBUGINFO
244 end
245 end