1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
10 maintainer = Michael Tremer <michael.tremer@ipfire.org>
12 url = http://www.gnu.org/software/libc/libc.html
13 license = GPLv2+ LGPLv2+
14 summary = The GNU libc libraries.
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.
26 source_dl = https://ftp.gnu.org/gnu/glibc/
27 sources = %{thisapp}.tar.xz
30 # Build in a separate directory
31 DIR_BUILD = %{DIR_SRC}/glibc-build
33 # Optimize glibc for kernel
34 OPTIMIZED_KERNEL = 5.10
43 kernel-headers >= %{OPTIMIZED_KERNEL}
55 # Path to put the runtime linker
59 --build=%{DISTRO_BUILDTARGET} \
62 --libexecdir=%{libdir}/glibc \
63 --sbindir=%{sbindir} \
65 --enable-kernel=%{OPTIMIZED_KERNEL} \
70 --enable-fortify-source \
71 --enable-stack-protector=all \
73 --with-bugurl=https://bugtracker.ipfire.org \
74 --disable-build-nscd \
77 if "%{DISTRO_ARCH}" == "aarch64"
78 configure_options += \
79 --enable-memory-tagging
81 # The runtime linker on aarch64 for whatever braindead reason is in /usr/lib
82 rtlddir = %{prefix}/lib
85 rtld = /lib/ld-linux-aarch64.so.1
88 if "%{DISTRO_ARCH}" == "x86_64"
89 configure_options += \
93 rtld = /lib64/ld-linux-x86-64.so.2
98 make install install_root=%{BUILDROOT} \
99 rtlddir=%{rtlddir} rootsbindir=%{sbindir} slibdir=%{libdir}
102 mkdir -pv %{BUILDROOT}/usr/lib/locale
103 # This would install all locales that are supported
104 make localedata/install-locales install_root=%{BUILDROOT}
106 # Install runtime linker configuration
107 install -v -m 644 %{DIR_SOURCE}/ld.so.conf %{BUILDROOT}%{sysconfdir}
108 mkdir -pv %{BUILDROOT}%{sysconfdir}/ld.so.conf.d
110 # Don't distribute linker cache
111 rm -vf %{BUILDROOT}%{sysconfdir}/ld.so.cache
113 # Install nsswitch.conf
114 install -v -m 644 %{DIR_SOURCE}/nsswitch.conf %{BUILDROOT}%{sysconfdir}
116 # Remove unused statically linked binaries
117 rm -vf %{BUILDROOT}%{sbindir}/sln
119 # Include /usr/lib/gconv/gconv-modules.cache
120 > %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
121 chmod 644 %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
123 # Strip any object files
124 strip --strip-debug %{BUILDROOT}%{libdir}/*.o
126 # Some gconv libraries requires other libraries and contain $ORIGIN
127 # as RUNPATH because they are all located in the same directory.
128 # We do not support $ORIGIN as RUNPATH so change this to the directory
129 # where the modules are located.
130 find %{BUILDROOT}%{libdir}/gconv -type f -name "*.so" -exec sh -c '
132 # Obtain the RUNPATH of the module in case it has one set.
133 runpath=$(patchelf --print-rpath ${file} | tr -d '\n')
135 # Check if the RUNPATH is $ORIGIN
136 if [ "${runpath}" == "\$ORIGIN" ]; then
137 # Use patchelf to change the RUNPATH
138 patchelf --set-rpath %{libdir}/gconv ${file}
146 # Export the path to the runtime linker which is actually
147 # installed into /usr, but is being searched for elsewhere
155 kernel < %{OPTIMIZED_KERNEL}
159 glibc-common < %{thisver}
168 glibc-headers = %{thisver}
169 kernel-headers >= %{OPTIMIZED_KERNEL}
173 glibc-headers = %{thisver}
177 glibc-headers < %{thisver}
180 files += %{libdir}/*.[ao]
183 package %{name}-utils
184 summary = Development utilities from GNU C library
186 The glibc-utils package contains memusage, a memory usage profiler,
187 mtrace, a memory leak tracer and xtrace, a function call tracer
188 which can be helpful during program debugging.
193 %{bindir}/memusagestat
195 %{bindir}/pcprofiledump
197 %{libdir}/libmemusage.so
198 %{libdir}/libpcprofile.so
202 package %{name}-debuginfo