]> git.ipfire.org Git - ipfire-3.x.git/blob - glibc/glibc.nm
Get rid of HTTP URLs as best as possible, take one
[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.38
8 release = 1
9
10 maintainer = Michael Tremer <michael.tremer@ipfire.org>
11 groups = System/Base
12 url = https://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 = https://ftp.gnu.org/gnu/glibc/
27 sources = %{thisapp}.tar.xz
28
29 build
30 # Build in a separate directory
31 DIR_BUILD = %{DIR_SRC}/glibc-build
32
33 # Optimize glibc for kernel
34 OPTIMIZED_KERNEL = 5.10
35
36 requires
37 autoconf
38 automake
39 binutils >= 2.35
40 bison
41 gcc >= 11
42 gettext
43 kernel-headers >= %{OPTIMIZED_KERNEL}
44 libcap-devel
45 libstdc++-static
46 make >= 4.0
47 patchelf
48 python3 >= 3.4
49 texinfo
50 end
51
52 # Disable LTO
53 LTO_CFLAGS =
54
55 # Path to put the runtime linker
56 rtlddir = %{libdir}
57
58 configure_options = \
59 --build=%{DISTRO_BUILDTARGET} \
60 --prefix=/usr \
61 --libdir=%{libdir} \
62 --libexecdir=%{libdir}/glibc \
63 --sbindir=%{sbindir} \
64 --enable-multi-arch \
65 --enable-kernel=%{OPTIMIZED_KERNEL} \
66 --enable-add-ons \
67 --disable-werror \
68 --disable-profile \
69 --disable-crypt \
70 --enable-fortify-source \
71 --enable-stack-protector=all \
72 --enable-bind-now \
73 --with-bugurl=https://bugtracker.ipfire.org \
74 --disable-build-nscd \
75 --disable-nscd
76
77 if "%{DISTRO_ARCH}" == "aarch64"
78 configure_options += \
79 --enable-memory-tagging
80
81 # The runtime linker on aarch64 for whatever braindead reason is in /usr/lib
82 rtlddir = %{prefix}/lib
83
84 # Runtime Linker
85 rtld = /lib/ld-linux-aarch64.so.1
86 end
87
88 if "%{DISTRO_ARCH}" == "x86_64"
89 configure_options += \
90 --enable-cet
91
92 # Runtime Linker
93 rtld = /lib64/ld-linux-x86-64.so.2
94 end
95
96 install
97 # Install everything
98 make install install_root=%{BUILDROOT} \
99 rtlddir=%{rtlddir} rootsbindir=%{sbindir} slibdir=%{libdir}
100
101 # Locales
102 mkdir -pv %{BUILDROOT}/usr/lib/locale
103 # This would install all locales that are supported
104 make localedata/install-locales install_root=%{BUILDROOT}
105
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
109
110 # Don't distribute linker cache
111 rm -vf %{BUILDROOT}%{sysconfdir}/ld.so.cache
112
113 # Install nsswitch.conf
114 install -v -m 644 %{DIR_SOURCE}/nsswitch.conf %{BUILDROOT}%{sysconfdir}
115
116 # Remove unused statically linked binaries
117 rm -vf %{BUILDROOT}%{sbindir}/sln
118
119 # Include /usr/lib/gconv/gconv-modules.cache
120 > %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
121 chmod 644 %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
122
123 # Strip any object files
124 strip --strip-debug %{BUILDROOT}%{libdir}/*.o
125
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 '
131 for file do
132 # Obtain the RUNPATH of the module in case it has one set.
133 runpath=$(patchelf --print-rpath ${file} | tr -d '\n')
134
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}
139 fi
140 done ' sh {} +
141 end
142 end
143
144 packages
145 package glibc
146 # Export the path to the runtime linker which is actually
147 # installed into /usr, but is being searched for elsewhere
148 provides += %{rtld}
149
150 requires
151 tzdata
152 end
153
154 conflicts
155 kernel < %{OPTIMIZED_KERNEL}
156 end
157
158 obsoletes
159 glibc-common < %{thisver}
160 end
161 end
162
163 package glibc-devel
164 template DEVEL
165
166 requires
167 glibc = %{thisver}
168 glibc-headers = %{thisver}
169 kernel-headers >= %{OPTIMIZED_KERNEL}
170 end
171
172 provides
173 glibc-headers = %{thisver}
174 end
175
176 obsoletes
177 glibc-headers < %{thisver}
178 end
179
180 files += %{libdir}/*.[ao]
181 end
182
183 package %{name}-utils
184 summary = Development utilities from GNU C library
185 description
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.
189 end
190
191 files
192 %{bindir}/memusage
193 %{bindir}/memusagestat
194 %{bindir}/mtrace
195 %{bindir}/pcprofiledump
196 %{bindir}/xtrace
197 %{libdir}/libmemusage.so
198 %{libdir}/libpcprofile.so
199 end
200 end
201
202 package %{name}-debuginfo
203 template DEBUGINFO
204 end
205 end