[12020] | 1 | %bcond_with gcc5 |
---|
| 2 | %bcond_with systemd |
---|
| 3 | |
---|
[12525] | 4 | %define glibcversion 2.33 |
---|
[5290] | 5 | %define glibcsrcdir glibc-%{glibcversion} |
---|
| 6 | %define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0} |
---|
[521] | 7 | ### glibc.spec.in follows: |
---|
| 8 | %define run_glibc_tests 1 |
---|
| 9 | %define auxarches athlon sparcv9v sparc64v alphaev6 |
---|
[5290] | 10 | %if %{build_compat32} |
---|
| 11 | %define auxarches i586 athlon sparcv9 alphaev6 |
---|
| 12 | %endif |
---|
[521] | 13 | %define xenarches i686 athlon |
---|
| 14 | %ifarch %{xenarches} |
---|
| 15 | %define buildxen 1 |
---|
| 16 | %define xenpackage 0 |
---|
| 17 | %else |
---|
| 18 | %define buildxen 0 |
---|
| 19 | %define xenpackage 0 |
---|
| 20 | %endif |
---|
[5290] | 21 | %ifarch ppc64 |
---|
| 22 | %define buildpower6 1 |
---|
[521] | 23 | %else |
---|
| 24 | %define buildpower6 0 |
---|
| 25 | %endif |
---|
[5290] | 26 | %define biarcharches %{ix86} x86_64 ppc ppc64 s390 s390x |
---|
[12398] | 27 | %global _enable_debug_packages 1 |
---|
[5290] | 28 | %define debuginfocommonarches %{biarcharches} alpha alphaev6 |
---|
| 29 | %define multiarcharches ppc ppc64 %{ix86} x86_64 %{sparc} |
---|
| 30 | # Remove -s to get verbose output. |
---|
| 31 | %define silentrules PARALLELMFLAGS=-s |
---|
[521] | 32 | |
---|
| 33 | Summary: The GNU libc libraries |
---|
| 34 | Summary(ja): GNU libc ライブラリ |
---|
| 35 | Name: glibc |
---|
| 36 | Version: %{glibcversion} |
---|
[12525] | 37 | Release: 1%{?_dist_release}%{?with_systemd:.systemd} |
---|
| 38 | Group: system |
---|
| 39 | Vendor: Project Vine |
---|
| 40 | Distribution: Vine Linux |
---|
[521] | 41 | # GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries. |
---|
| 42 | # Things that are linked directly into dynamically linked programs |
---|
| 43 | # and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional |
---|
| 44 | # exception which allows linking it into any kind of programs or shared |
---|
| 45 | # libraries without restrictions. |
---|
| 46 | License: LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ |
---|
[5290] | 47 | URL: http://www.gnu.org/software/glibc/ |
---|
[12342] | 48 | Source0: https://ftp.gnu.org/gnu/glibc/%{glibcsrcdir}.tar.xz |
---|
[7961] | 49 | Source1: build-locale-archive.c |
---|
[12020] | 50 | Source4: nscd.conf |
---|
[7961] | 51 | Source7: nsswitch.conf.vine |
---|
[12020] | 52 | Source8: power6emul.c |
---|
| 53 | Source9: bench.mk |
---|
| 54 | Source10: glibc-bench-compare |
---|
| 55 | # A copy of localedata/SUPPORTED in the Source0 tarball. The |
---|
| 56 | # SUPPORTED file is used below to generate the list of locale |
---|
| 57 | # packages, using a Lua snippet. |
---|
| 58 | Source11: SUPPORTED |
---|
[5300] | 59 | |
---|
[12020] | 60 | Source1000: rpm-old-changelog.txt |
---|
[5300] | 61 | |
---|
[12020] | 62 | # patched form upstream |
---|
[12525] | 63 | Patch0: glibc-2.33-20210209.patch |
---|
[12020] | 64 | |
---|
[7961] | 65 | # patches from Fedora |
---|
[12525] | 66 | #Patch1: glibc-post_upgrade.patch |
---|
[12020] | 67 | Patch2: glibc-fedora-nscd.patch |
---|
| 68 | Patch3: glibc-rh697421.patch |
---|
| 69 | Patch4: glibc-fedora-linux-tcsetattr.patch |
---|
[12525] | 70 | #Patch5: glibc-rh741105.patch |
---|
[12020] | 71 | Patch6: glibc-fedora-localedef.patch |
---|
[12525] | 72 | #Patch7: glibc-fedora-nis-rh188246.patch |
---|
[12020] | 73 | Patch8: glibc-fedora-manual-dircategory.patch |
---|
| 74 | Patch9: glibc-rh827510.patch |
---|
[12342] | 75 | # needed by build-locale-archive.c |
---|
[12020] | 76 | Patch10: glibc-fedora-locarchive.patch |
---|
| 77 | Patch12: glibc-rh819430.patch |
---|
| 78 | Patch13: glibc-fedora-localedata-rh61908.patch |
---|
[12525] | 79 | #Patch14: glibc-fedora-__libc_multiple_libcs.patch |
---|
[12020] | 80 | Patch15: glibc-rh1070416.patch |
---|
| 81 | Patch16: glibc-nscd-sysconfig.patch |
---|
| 82 | Patch17: glibc-cs-path.patch |
---|
| 83 | Patch18: glibc-c-utf8-locale.patch |
---|
| 84 | Patch23: glibc-python3.patch |
---|
[12342] | 85 | Patch29: glibc-fedora-nsswitch.patch |
---|
[7961] | 86 | |
---|
| 87 | # patch for Vine |
---|
[12020] | 88 | #Patch10001: glibc-2.18-vine-build-env.patch |
---|
[7961] | 89 | |
---|
[10738] | 90 | # security |
---|
[7961] | 91 | |
---|
[521] | 92 | Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
---|
| 93 | Obsoletes: glibc-profile < 2.4 |
---|
| 94 | Provides: ldconfig |
---|
| 95 | # The dynamic linker supports DT_GNU_HASH |
---|
| 96 | Provides: rtld(GNU_HASH) |
---|
| 97 | Requires: glibc-common = %{version}-%{release} |
---|
| 98 | # Require libgcc in case some program calls pthread_cancel in its %%post |
---|
| 99 | Requires(pre): basesystem, libgcc |
---|
| 100 | # This is for building auxiliary programs like memusage, nscd |
---|
| 101 | # For initial glibc bootstraps it can be commented out |
---|
| 102 | BuildRequires: gd-devel libpng-devel zlib-devel texinfo |
---|
| 103 | BuildRequires: audit-libs-devel >= 1.1.3, sed >= 3.95, libcap-devel, gettext, nss-devel |
---|
[12225] | 104 | BuildRequires: python3-devel |
---|
[12020] | 105 | BuildRequires: bison |
---|
[521] | 106 | BuildRequires: /bin/ps, /bin/kill, /bin/awk |
---|
| 107 | # This is to ensure that __frame_state_for is exported by glibc |
---|
| 108 | # will be compatible with egcs 1.x.y |
---|
| 109 | BuildRequires: gcc >= 3.2 |
---|
[12020] | 110 | %define enablekernel 3.2 |
---|
[5290] | 111 | Conflicts: kernel < %{enablekernel} |
---|
[521] | 112 | %ifarch i386 |
---|
[7961] | 113 | %define target_cpu i486 |
---|
[521] | 114 | %else |
---|
[7961] | 115 | %define target_cpu %{_target_cpu} |
---|
[521] | 116 | %endif |
---|
[7961] | 117 | |
---|
| 118 | %define target %{_target_cpu}-vine-linux |
---|
| 119 | %ifarch %{arm} |
---|
| 120 | %define target %{_target_cpu}-vine-linuxeabi |
---|
| 121 | %endif |
---|
| 122 | %ifarch %{power64} |
---|
| 123 | %define target ppc64-vine-linux |
---|
| 124 | %endif |
---|
| 125 | |
---|
[521] | 126 | %ifarch %{multiarcharches} |
---|
| 127 | # Need STT_IFUNC support |
---|
| 128 | %ifarch ppc ppc64 |
---|
| 129 | BuildRequires: binutils >= 2.20.51.0.2 |
---|
| 130 | Conflicts: binutils < 2.20.51.0.2 |
---|
| 131 | %else |
---|
| 132 | BuildRequires: binutils >= 2.19.51.0.10 |
---|
| 133 | Conflicts: binutils < 2.19.51.0.10 |
---|
| 134 | %endif |
---|
| 135 | # Earlier releases have broken support for IRELATIVE relocations |
---|
| 136 | Conflicts: prelink < 0.4.2 |
---|
| 137 | %else |
---|
| 138 | # Need AS_NEEDED directive |
---|
| 139 | # Need --hash-style=* support |
---|
| 140 | BuildRequires: binutils >= 2.17.50.0.2-5 |
---|
| 141 | %endif |
---|
| 142 | BuildRequires: gcc >= 3.2.1-5 |
---|
| 143 | %ifarch ppc s390 s390x |
---|
| 144 | BuildRequires: gcc >= 4.1.0-0.17 |
---|
| 145 | %endif |
---|
| 146 | %if 0%{?_enable_debug_packages} |
---|
| 147 | BuildRequires: elfutils >= 0.72 |
---|
| 148 | BuildRequires: rpm >= 4.2-0.56 |
---|
| 149 | %endif |
---|
[7961] | 150 | |
---|
| 151 | # The testsuite builds static C++ binaries that require a static |
---|
| 152 | # C++ runtime from libstdc++-static. |
---|
| 153 | BuildRequires: libstdc++-static |
---|
| 154 | |
---|
| 155 | BuildRequires: tzdata |
---|
| 156 | |
---|
[521] | 157 | %define __find_provides %{SOURCE10} |
---|
| 158 | %define __find_requires %{SOURCE11} |
---|
| 159 | %define _filter_GLIBC_PRIVATE 1 |
---|
| 160 | |
---|
| 161 | %description |
---|
| 162 | The glibc package contains standard libraries which are used by |
---|
| 163 | multiple programs on the system. In order to save disk space and |
---|
| 164 | memory, as well as to make upgrading easier, common system code is |
---|
| 165 | kept in one place and shared between programs. This particular package |
---|
| 166 | contains the most important sets of shared libraries: the standard C |
---|
| 167 | library and the standard math library. Without these two libraries, a |
---|
| 168 | Linux system will not function. |
---|
| 169 | |
---|
| 170 | %description -l ja |
---|
| 171 | glibc パッケージはシステム上の複数のプログラムで使われる標準ライブラリを |
---|
| 172 | ふくみます。ディスクスペースとメモリを節約したり、アップグレードを |
---|
| 173 | 用意にするために、共通のシステムコードは一つの場所におかれ、プログラム |
---|
| 174 | 間で共有されます。この部分的なパッケージはシェアドライブラリのかなり |
---|
| 175 | 重要なセットをふくみます: 標準 C ライブラリと標準数値ライブラリです。 |
---|
| 176 | この二つのライブラリ抜きでは、Linux システムは機能しません。 |
---|
| 177 | |
---|
[12525] | 178 | |
---|
[521] | 179 | %package -n compat32-%{name} |
---|
| 180 | Summary: The GNU libc libraries. |
---|
| 181 | Summary(ja): GNU libc ライブラリ |
---|
[12525] | 182 | Group: system |
---|
[5290] | 183 | Requires: %{name} >= %{version}-%{release} |
---|
[521] | 184 | |
---|
| 185 | %description -n compat32-%{name} |
---|
| 186 | The glibc package contains standard libraries which are used by |
---|
| 187 | multiple programs on the system. In order to save disk space and |
---|
| 188 | memory, as well as to make upgrading easier, common system code is |
---|
| 189 | kept in one place and shared between programs. This particular package |
---|
| 190 | contains the most important sets of shared libraries: the standard C |
---|
| 191 | library and the standard math library. Without these two libraries, a |
---|
| 192 | Linux system will not function. |
---|
| 193 | |
---|
| 194 | %description -n compat32-%{name} -l ja |
---|
| 195 | glibc パッケージはシステム上の複数のプログラムで使われる標準ライブラリを |
---|
| 196 | ふくみます。ディスクスペースとメモリを節約したり、アップグレードを |
---|
| 197 | 用意にするために、共通のシステムコードは一つの場所におかれ、プログラム |
---|
| 198 | 間で共有されます。この部分的なパッケージはシェアドライブラリのかなり |
---|
| 199 | 重要なセットをふくみます: 標準 C ライブラリと標準数値ライブラリです。 |
---|
| 200 | この二つのライブラリ抜きでは、Linux システムは機能しません。 |
---|
| 201 | |
---|
[12525] | 202 | |
---|
[521] | 203 | %if %{xenpackage} |
---|
| 204 | %package xen |
---|
| 205 | Summary: The GNU libc libraries (optimized for running under Xen) |
---|
[12525] | 206 | Group: system |
---|
[521] | 207 | Requires: glibc = %{version}-%{release}, glibc-utils = %{version}-%{release} |
---|
| 208 | |
---|
| 209 | %description xen |
---|
| 210 | The standard glibc package is optimized for native kernels and does not |
---|
| 211 | perform as well under the Xen hypervisor. This package provides alternative |
---|
| 212 | library binaries that will be selected instead when running under Xen. |
---|
| 213 | |
---|
| 214 | Install glibc-xen if you might run your system under the Xen hypervisor. |
---|
| 215 | %endif |
---|
| 216 | |
---|
[12525] | 217 | |
---|
[521] | 218 | %package devel |
---|
| 219 | Summary: Object files for development using standard C libraries. |
---|
| 220 | Summary(ja): 標準 C ライブラリで使われるオブジェクトファイル |
---|
[12525] | 221 | Group: programming |
---|
[521] | 222 | Requires(pre): /sbin/install-info |
---|
| 223 | Requires(pre): %{name}-headers |
---|
| 224 | Requires: %{name}-headers = %{version}-%{release} |
---|
| 225 | Requires: %{name} = %{version}-%{release} |
---|
| 226 | |
---|
| 227 | %description devel |
---|
| 228 | The glibc-devel package contains the object files necessary |
---|
| 229 | for developing programs which use the standard C libraries (which are |
---|
| 230 | used by nearly all programs). If you are developing programs which |
---|
| 231 | will use the standard C libraries, your system needs to have these |
---|
| 232 | standard object files available in order to create the |
---|
| 233 | executables. |
---|
| 234 | |
---|
| 235 | Install glibc-devel if you are going to develop programs which will |
---|
| 236 | use the standard C libraries. |
---|
| 237 | |
---|
| 238 | %description devel -l ja |
---|
| 239 | glibc-devel パッケージには (ほとんどすべてのプログラムで使われる) |
---|
| 240 | 標準 C ライブラリを使用したプログラムを開発するためのオブジェクトファイルが |
---|
| 241 | 含まれます。標準 C ライブラリを使用するプログラムを開発する場合には、 |
---|
| 242 | これらオブジェクトファイルを使用して実行ファイルを作成できます。 |
---|
| 243 | |
---|
| 244 | 標準 C ライブラリを使用するプログラムを開発するなら glibc-devel |
---|
| 245 | をインストールしてください。 |
---|
| 246 | |
---|
[12525] | 247 | |
---|
[521] | 248 | %package -n compat32-%{name}-devel |
---|
| 249 | Summary: Object files for development using standard C libraries. |
---|
| 250 | Summary(ja): 標準 C ライブラリで使われるオブジェクトファイル |
---|
[12525] | 251 | Group: programming |
---|
[5290] | 252 | Requires: %{name}-devel = %{version}-%{release} |
---|
[521] | 253 | Requires: compat32-%{name} = %{version}-%{release} |
---|
| 254 | |
---|
| 255 | %description -n compat32-%{name}-devel |
---|
| 256 | The glibc-devel package contains the object files necessary |
---|
| 257 | for developing programs which use the standard C libraries (which are |
---|
| 258 | used by nearly all programs). If you are developing programs which |
---|
| 259 | will use the standard C libraries, your system needs to have these |
---|
| 260 | standard object files available in order to create the |
---|
| 261 | executables. |
---|
| 262 | |
---|
| 263 | Install glibc-devel if you are going to develop programs which will |
---|
| 264 | use the standard C libraries. |
---|
| 265 | |
---|
| 266 | %description -n compat32-%{name}-devel -l ja |
---|
| 267 | glibc-devel パッケージには (ほとんどすべてのプログラムで使われる) |
---|
| 268 | 標準 C ライブラリを使用したプログラムを開発するためのオブジェクトファイルが |
---|
| 269 | 含まれます。標準 C ライブラリを使用するプログラムを開発する場合には、 |
---|
| 270 | これらオブジェクトファイルを使用して実行ファイルを作成できます。 |
---|
| 271 | |
---|
| 272 | 標準 C ライブラリを使用するプログラムを開発するなら glibc-devel |
---|
| 273 | をインストールしてください。 |
---|
| 274 | |
---|
[12525] | 275 | |
---|
[521] | 276 | %package static |
---|
| 277 | Summary: C library static libraries for -static linking. |
---|
| 278 | Summary(ja): -static リンクのための静的 C ライブラリ |
---|
[12525] | 279 | Group: programming |
---|
[521] | 280 | Requires: %{name}-devel = %{version}-%{release} |
---|
| 281 | |
---|
| 282 | %description static |
---|
| 283 | The glibc-static package contains the C library static libraries |
---|
| 284 | for -static linking. You don't need these, unless you link statically, |
---|
| 285 | which is highly discouraged. |
---|
| 286 | |
---|
| 287 | %description static -l ja |
---|
| 288 | glibc-static パッケージには -static リンクで使用する静的 C ライブラリが |
---|
| 289 | 入っています。 |
---|
| 290 | 静的ライブラリが必要な場合でなければ、このパッケージをインストールする |
---|
| 291 | ことは避けて下さい。 |
---|
| 292 | |
---|
[12525] | 293 | |
---|
[3081] | 294 | %package -n compat32-%{name}-static |
---|
| 295 | Summary: C library static libraries for -static linking. |
---|
| 296 | Summary(ja): -static リンクのための静的 C ライブラリ |
---|
[12525] | 297 | Group: programming |
---|
[3081] | 298 | Requires: %{name}-devel = %{version}-%{release} |
---|
| 299 | Requires: %{name}-static = %{version}-%{release} |
---|
| 300 | Requires: compat32-%{name}-devel = %{version}-%{release} |
---|
| 301 | |
---|
| 302 | %description -n compat32-%{name}-static |
---|
| 303 | The glibc-static package contains the C library static libraries |
---|
| 304 | for -static linking. You don't need these, unless you link statically, |
---|
| 305 | which is highly discouraged. |
---|
| 306 | |
---|
| 307 | %description -n compat32-%{name}-static -l ja |
---|
| 308 | glibc-static パッケージには -static リンクで使用する静的 C ライブラリが |
---|
| 309 | 入っています。 |
---|
| 310 | 静的ライブラリが必要な場合でなければ、このパッケージをインストールする |
---|
| 311 | ことは避けて下さい。 |
---|
| 312 | |
---|
[12525] | 313 | |
---|
[521] | 314 | %package headers |
---|
| 315 | Summary: Header files for development using standard C libraries. |
---|
| 316 | Summary(ja): 標準 C ライブラリで使われるヘッダーファイル |
---|
[12525] | 317 | Group: programming |
---|
[521] | 318 | Provides: %{name}-headers(%{_target_cpu}) |
---|
| 319 | %ifarch x86_64 |
---|
| 320 | # If both -m32 and -m64 is to be supported on AMD64, x86_64 glibc-headers |
---|
| 321 | # have to be installed, not i586 ones. |
---|
| 322 | Obsoletes: %{name}-headers(i586) |
---|
| 323 | Obsoletes: %{name}-headers(i686) |
---|
| 324 | %endif |
---|
| 325 | Requires(pre): kernel-headers |
---|
| 326 | Requires: kernel-headers >= 2.2.1, %{name} = %{version}-%{release} |
---|
| 327 | BuildRequires: kernel-headers >= 2.6.22 |
---|
| 328 | |
---|
| 329 | %description headers |
---|
| 330 | The glibc-headers package contains the header files necessary |
---|
| 331 | for developing programs which use the standard C libraries (which are |
---|
| 332 | used by nearly all programs). If you are developing programs which |
---|
| 333 | will use the standard C libraries, your system needs to have these |
---|
| 334 | standard header files available in order to create the |
---|
| 335 | executables. |
---|
| 336 | |
---|
| 337 | Install glibc-headers if you are going to develop programs which will |
---|
| 338 | use the standard C libraries. |
---|
| 339 | |
---|
[5290] | 340 | %description headers -l ja |
---|
[521] | 341 | glibc-headers パッケージには (ほとんどすべてのプログラムで使われる) |
---|
| 342 | 標準 C ライブラリを使用したプログラムを開発するためのヘッダーファイルが |
---|
| 343 | 含まれます。標準 C ライブラリを使用するプログラムを開発する場合には、 |
---|
| 344 | これら標準ヘッダーファイルを使用して実行ファイルを作成できます。 |
---|
| 345 | |
---|
| 346 | 標準 C ライブラリを使用するプログラムを開発するなら glibc-headers |
---|
| 347 | をインストールしてください。 |
---|
| 348 | |
---|
[12525] | 349 | |
---|
[521] | 350 | %package common |
---|
| 351 | Summary: Common binaries and locale data for glibc |
---|
| 352 | Summary(ja): glibc 用共通バイナリとロケールデータ |
---|
| 353 | Requires: %{name} = %{version}-%{release} |
---|
| 354 | Requires: tzdata >= 2003a |
---|
[12525] | 355 | Group: system |
---|
[521] | 356 | |
---|
| 357 | %description common |
---|
| 358 | The glibc-common package includes common binaries for the GNU libc |
---|
| 359 | libraries, as well as national language (locale) support. |
---|
| 360 | This package include ja and en locale-archive. |
---|
| 361 | |
---|
| 362 | %description common -l ja |
---|
| 363 | glibc-common パッケージには GNU libc ライブラリ用の共用バイナリに |
---|
| 364 | 加えて、言語(ロケール)サポートや時間帯データベースが収められています。 |
---|
| 365 | このパッケージには日本語と英語のみの locale-archive が含まれます。 |
---|
| 366 | |
---|
[12525] | 367 | |
---|
[521] | 368 | %package common-extra |
---|
| 369 | Summary: Extra Locale data for glibc |
---|
| 370 | Summary(ja): glibc 用ロケールデータ(日本語以外) |
---|
[12525] | 371 | Group: system |
---|
[521] | 372 | Autoreq: false |
---|
| 373 | Requires(pre): %{name}-common = %{version}-%{release} |
---|
| 374 | |
---|
| 375 | %description common-extra |
---|
| 376 | The glibc-common-extra package includes national language (locale) |
---|
| 377 | support except for English and Japanese. |
---|
| 378 | |
---|
| 379 | %description common-extra -l ja |
---|
| 380 | glibc-common-extra パッケージには GNU libc ライブラリ用の英語と |
---|
| 381 | 日本語以外の言語(ロケール)が収められています。 |
---|
| 382 | |
---|
[12525] | 383 | |
---|
[12020] | 384 | %package locale-source |
---|
| 385 | Summary: The sources for the locales of glibc |
---|
| 386 | Summary(ja): glibc 用ロケールデータのソース |
---|
[12525] | 387 | Group: system |
---|
[12020] | 388 | Requires: %{name} = %{version}-%{release} |
---|
| 389 | Requires: %{name}-common = %{version}-%{release} |
---|
| 390 | |
---|
| 391 | %description locale-source |
---|
| 392 | The sources for all locales provided in glibc. If you are building |
---|
| 393 | custom locales you will most likely use these sources as the basis |
---|
| 394 | for your new locale. |
---|
| 395 | |
---|
[12525] | 396 | |
---|
[521] | 397 | %package -n nscd |
---|
| 398 | Summary: A Name Service Caching Daemon (nscd). |
---|
| 399 | Summary(ja): ネームサービスキャッシングデーモン (nscd) |
---|
[12525] | 400 | Group: system |
---|
[5290] | 401 | Requires: %{name} = %{version}-%{release} |
---|
[521] | 402 | Requires: audit-libs >= 1.1.3 |
---|
[12398] | 403 | Requires(pre): /usr/sbin/useradd, coreutils |
---|
| 404 | Requires(postun): /usr/sbin/userdel |
---|
| 405 | %if %{with systemd} |
---|
| 406 | Requires(post): systemd |
---|
| 407 | Requires(preun): systemd |
---|
| 408 | Requires(postun): systemd |
---|
| 409 | %else |
---|
| 410 | Requires(pre): /sbin/chkconfig |
---|
| 411 | %endif |
---|
[521] | 412 | |
---|
| 413 | %description -n nscd |
---|
| 414 | Nscd caches name service lookups and can dramatically improve |
---|
| 415 | performance with NIS+, and may help with DNS as well. |
---|
| 416 | |
---|
| 417 | %description -n nscd -l ja |
---|
| 418 | nscd はネームサービス参照をキャッシュし、NIS+ のパフォーマンスを |
---|
| 419 | 劇的にに改善することができます。DNS のパフォーマンス向上にも同様に寄与します。 |
---|
| 420 | |
---|
[12525] | 421 | |
---|
[521] | 422 | %package utils |
---|
| 423 | Summary: Development utilities from GNU C library |
---|
| 424 | Summary(ja): GNU C ライブラリの開発ユーティリティ |
---|
[12525] | 425 | Group: programming,admin-tools |
---|
[521] | 426 | Requires: %{name} = %{version}-%{release} |
---|
| 427 | |
---|
| 428 | %description utils |
---|
| 429 | The glibc-utils package contains memusage, a memory usage profiler, |
---|
| 430 | mtrace, a memory leak tracer and xtrace, a function call tracer |
---|
| 431 | which can be helpful during program debugging. |
---|
| 432 | |
---|
| 433 | If unsure if you need this, don't install this package. |
---|
| 434 | |
---|
| 435 | %description utils -l ja |
---|
| 436 | glibc-utils にはプログラムのデバッグに便利な以下のツールが収録されています: |
---|
| 437 | memusage (メモリ使用量プロファイラ)、mtrace (メモリリークトレーサ)、 |
---|
| 438 | xtrace (関数呼出しトレーサ)。 |
---|
| 439 | |
---|
| 440 | これらが必要かどうか分からない場合は、インストールする必要はありません。 |
---|
| 441 | |
---|
[12525] | 442 | |
---|
[521] | 443 | %if 0%{?_enable_debug_packages} |
---|
| 444 | %define debug_package %{nil} |
---|
| 445 | %define __debug_install_post %{nil} |
---|
| 446 | %global __debug_package 1 |
---|
| 447 | |
---|
| 448 | %package debuginfo |
---|
| 449 | Summary: Debug information for package %{name} |
---|
| 450 | Group: Development/Debug |
---|
| 451 | AutoReqProv: no |
---|
| 452 | %ifarch %{debuginfocommonarches} |
---|
| 453 | Requires: glibc-debuginfo-common = %{version}-%{release} |
---|
| 454 | %else |
---|
| 455 | %ifarch %{ix86} |
---|
| 456 | Obsoletes: glibc-debuginfo-common |
---|
| 457 | %endif |
---|
| 458 | %endif |
---|
| 459 | |
---|
| 460 | %description debuginfo |
---|
| 461 | This package provides debug information for package %{name}. |
---|
| 462 | Debug information is useful when developing applications that use this |
---|
| 463 | package or when debugging this package. |
---|
| 464 | |
---|
| 465 | This package also contains static standard C libraries with |
---|
| 466 | debugging information. You need this only if you want to step into |
---|
| 467 | C library routines during debugging programs statically linked against |
---|
| 468 | one or more of the standard C libraries. |
---|
| 469 | To use this debugging information, you need to link binaries |
---|
| 470 | with -static -L%{_prefix}/lib/debug%{_prefix}/%{_lib} compiler options. |
---|
| 471 | |
---|
| 472 | %ifarch %{debuginfocommonarches} |
---|
| 473 | |
---|
| 474 | %package debuginfo-common |
---|
| 475 | Summary: Debug information for package %{name} |
---|
| 476 | Group: Development/Debug |
---|
| 477 | AutoReqProv: no |
---|
| 478 | |
---|
| 479 | %description debuginfo-common |
---|
| 480 | This package provides debug information for package %{name}. |
---|
| 481 | Debug information is useful when developing applications that use this |
---|
| 482 | package or when debugging this package. |
---|
| 483 | |
---|
| 484 | %endif |
---|
| 485 | %endif |
---|
| 486 | |
---|
| 487 | %prep |
---|
[12020] | 488 | %autosetup -n %{glibcsrcdir} -p1 |
---|
[7961] | 489 | |
---|
[12020] | 490 | # Make benchmark scripts executable |
---|
| 491 | chmod +x benchtests/scripts/*.py scripts/pylint |
---|
[521] | 492 | |
---|
[12020] | 493 | # Remove all files generated from patching. |
---|
[521] | 494 | find . -type f -size 0 -o -name "*.orig" -exec rm -f {} \; |
---|
[12020] | 495 | |
---|
| 496 | # Ensure timestamps on configure files are current to prevent |
---|
| 497 | # regenerating them. |
---|
[521] | 498 | touch `find . -name configure` |
---|
[12020] | 499 | |
---|
| 500 | # Ensure *-kw.h files are current to prevent regenerating them. |
---|
[521] | 501 | touch locale/programs/*-kw.h |
---|
| 502 | |
---|
[12020] | 503 | # Verify that our copy of localedata/SUPPORTED matches the glibc |
---|
| 504 | # version. |
---|
| 505 | # |
---|
| 506 | # The separate file copy is used by the Lua parser above. |
---|
| 507 | # Patches or new upstream versions may change the list of locales, |
---|
| 508 | # which changes the set of langpacks we need to build. Verify the |
---|
| 509 | # differences then update the copy of SUPPORTED. This approach has |
---|
| 510 | # two purposes: (a) avoid spurious changes to the set of langpacks, |
---|
| 511 | # and (b) the Lua snippet can use a fully patched-up version |
---|
| 512 | # of the localedata/SUPPORTED file. |
---|
| 513 | diff -u %{SOURCE11} localedata/SUPPORTED |
---|
| 514 | |
---|
| 515 | cp -f %{SOURCE1000} ./ |
---|
| 516 | |
---|
[521] | 517 | %build |
---|
[12020] | 518 | |
---|
| 519 | # We build using the native system compilers. |
---|
[521] | 520 | GCC=gcc |
---|
| 521 | GXX=g++ |
---|
[12020] | 522 | |
---|
| 523 | # Part of rpm_inherit_flags. Is overridden below. |
---|
| 524 | rpm_append_flag () |
---|
| 525 | { |
---|
| 526 | BuildFlags="$BuildFlags $*" |
---|
| 527 | } |
---|
| 528 | |
---|
| 529 | # Propagates the listed flags to rpm_append_flag if supplied by |
---|
| 530 | # redhat-rpm-config. |
---|
| 531 | BuildFlags="-O2 -g" |
---|
| 532 | rpm_inherit_flags () |
---|
| 533 | { |
---|
| 534 | local reference=" $* " |
---|
| 535 | local flag |
---|
| 536 | for flag in $RPM_OPT_FLAGS $RPM_LD_FLAGS ; do |
---|
| 537 | if echo "$reference" | grep -q -F " $flag " ; then |
---|
| 538 | rpm_append_flag "$flag" |
---|
| 539 | fi |
---|
| 540 | done |
---|
| 541 | } |
---|
| 542 | |
---|
| 543 | # Propgate select compiler flags from redhat-rpm-config. These flags |
---|
| 544 | # are target-dependent, so we use only those which are specified in |
---|
| 545 | # redhat-rpm-config. We keep the -m32/-m32/-m64 flags to support |
---|
| 546 | # multilib builds. |
---|
| 547 | # |
---|
| 548 | # Note: For building alternative run-times, care is required to avoid |
---|
| 549 | # overriding the architecture flags which go into CC/CXX. The flags |
---|
| 550 | # below are passed in CFLAGS. |
---|
| 551 | |
---|
| 552 | rpm_inherit_flags \ |
---|
| 553 | "-Wp,-D_GLIBCXX_ASSERTIONS" \ |
---|
| 554 | "-fasynchronous-unwind-tables" \ |
---|
| 555 | %if %{without gcc5} |
---|
| 556 | "-fstack-clash-protection" \ |
---|
[521] | 557 | %endif |
---|
[12020] | 558 | "-funwind-tables" \ |
---|
| 559 | "-m31" \ |
---|
| 560 | "-m32" \ |
---|
| 561 | "-m64" \ |
---|
| 562 | "-march=i686" \ |
---|
| 563 | "-march=x86-64" \ |
---|
| 564 | "-march=z13" \ |
---|
| 565 | "-march=z14" \ |
---|
| 566 | "-march=zEC12" \ |
---|
| 567 | "-mfpmath=sse" \ |
---|
| 568 | "-msse2" \ |
---|
| 569 | "-mstackrealign" \ |
---|
| 570 | "-mtune=generic" \ |
---|
| 571 | "-mtune=z13" \ |
---|
| 572 | "-mtune=z14" \ |
---|
| 573 | "-mtune=zEC12" \ |
---|
| 574 | "-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1" \ |
---|
[521] | 575 | |
---|
[12020] | 576 | # Propagate additional build flags to BuildFlagsNonshared. This is |
---|
| 577 | # very special because some of these files are part of the startup |
---|
| 578 | # code. We essentially hope that these flags have little effect |
---|
| 579 | # there, and only specify the, for consistency, so that annobin |
---|
| 580 | # records the expected compiler flags. |
---|
| 581 | BuildFlagsNonshared= |
---|
| 582 | rpm_append_flag () { |
---|
| 583 | BuildFlagsNonshared="$BuildFlagsNonshared $*" |
---|
| 584 | } |
---|
| 585 | rpm_inherit_flags \ |
---|
| 586 | "-Wp,-D_FORTIFY_SOURCE=2" \ |
---|
| 587 | |
---|
| 588 | # Special flag to enable annobin annotations for statically linked |
---|
| 589 | # assembler code. Needs to be passed to make; not preserved by |
---|
| 590 | # configure. |
---|
| 591 | %define glibc_make_flags_as ASFLAGS="-g -Wa,--generate-missing-build-notes=yes" |
---|
| 592 | %define glibc_make_flags %{glibc_make_flags_as} |
---|
| 593 | |
---|
| 594 | ############################################################################## |
---|
| 595 | # %%build - Generic options. |
---|
| 596 | ############################################################################## |
---|
[521] | 597 | EnableKernel="--enable-kernel=%{enablekernel}" |
---|
[12020] | 598 | # Save the used compiler and options into the file "Gcc" for use later |
---|
| 599 | # by %%install. |
---|
[521] | 600 | echo "$GCC" > Gcc |
---|
| 601 | |
---|
[12020] | 602 | ############################################################################## |
---|
| 603 | # build() |
---|
| 604 | # Build glibc in `build-%{target}$1', passing the rest of the arguments |
---|
| 605 | # as CFLAGS to the build (not the same as configure CFLAGS). Several |
---|
| 606 | # global values are used to determine build flags, kernel version, |
---|
| 607 | # system tap support, etc. |
---|
| 608 | ############################################################################## |
---|
[7961] | 609 | build() |
---|
[521] | 610 | { |
---|
[12020] | 611 | local builddir=build-%{target}${1:+-$1} |
---|
| 612 | ${1+shift} |
---|
| 613 | rm -rf $builddir |
---|
| 614 | mkdir $builddir |
---|
| 615 | pushd $builddir |
---|
| 616 | ../configure CC="$GCC" CXX="$GXX" CFLAGS="$BuildFlags $*" \ |
---|
| 617 | --prefix=%{_prefix} \ |
---|
| 618 | --with-headers=%{_prefix}/include $EnableKernel \ |
---|
| 619 | --with-nonshared-cflags="$BuildFlagsNonshared" \ |
---|
| 620 | --enable-bind-now \ |
---|
| 621 | --build=%{target} \ |
---|
| 622 | --enable-stack-protector=strong \ |
---|
| 623 | %ifarch %{pie_arches} |
---|
| 624 | --enable-static-pie \ |
---|
[521] | 625 | %endif |
---|
[12020] | 626 | --enable-tunables \ |
---|
| 627 | %if 0 |
---|
| 628 | --enable-systemtap \ |
---|
| 629 | %endif |
---|
| 630 | ${core_with_options} \ |
---|
| 631 | %ifarch x86_64 %{ix86} |
---|
| 632 | %if %{without gcc5} |
---|
| 633 | --enable-cet \ |
---|
| 634 | %endif |
---|
| 635 | %endif |
---|
| 636 | %ifarch %{ix86} |
---|
| 637 | --disable-multi-arch \ |
---|
| 638 | %endif |
---|
| 639 | %if %{without werror} |
---|
| 640 | --disable-werror \ |
---|
| 641 | %endif |
---|
| 642 | --disable-profile \ |
---|
| 643 | --without-selinux \ |
---|
| 644 | --disable-crypt || |
---|
| 645 | { cat config.log; false; } |
---|
[521] | 646 | |
---|
[12020] | 647 | make %{?_smp_mflags} -O -r %{glibc_make_flags} |
---|
| 648 | popd |
---|
[521] | 649 | } |
---|
| 650 | |
---|
[12020] | 651 | # Default set of compiler options. |
---|
[7961] | 652 | build |
---|
[521] | 653 | |
---|
| 654 | |
---|
[12020] | 655 | %install |
---|
| 656 | rm -rf %{buildroot} |
---|
| 657 | # The built glibc is installed into a subdirectory of $RPM_BUILD_ROOT. |
---|
| 658 | # For a system glibc that subdirectory is "/" (the root of the filesystem). |
---|
| 659 | # This is called a sysroot (system root) and can be changed if we have a |
---|
| 660 | # distribution that supports multiple installed glibc versions. |
---|
| 661 | %define glibc_sysroot $RPM_BUILD_ROOT |
---|
[521] | 662 | |
---|
[12020] | 663 | # Remove existing file lists. |
---|
| 664 | find . -type f -name '*.filelist' -exec rm -rf {} \; |
---|
[521] | 665 | |
---|
[12020] | 666 | # Reload compiler and build options that were used during %%build. |
---|
[521] | 667 | GCC=`cat Gcc` |
---|
| 668 | |
---|
[12020] | 669 | # Build and install: |
---|
| 670 | make -j1 install_root=%{glibc_sysroot} install -C build-%{target} |
---|
| 671 | |
---|
| 672 | # If we are not building an auxiliary arch then install all of the supported |
---|
| 673 | # locales. |
---|
[521] | 674 | %ifnarch %{auxarches} |
---|
[12020] | 675 | pushd build-%{target} |
---|
| 676 | # Do not use a parallel make here because the hardlink optimization in |
---|
| 677 | # localedef is not fully reproducible when running concurrently. |
---|
| 678 | make install_root=%{glibc_sysroot} \ |
---|
| 679 | install-locales -C ../localedata objdir=`pwd` |
---|
| 680 | popd |
---|
[521] | 681 | %endif |
---|
| 682 | |
---|
[12020] | 683 | # install_different: |
---|
| 684 | # Install all core libraries into DESTDIR/SUBDIR. Either the file is |
---|
| 685 | # installed as a copy or a symlink to the default install (if it is the |
---|
| 686 | # same). The path SUBDIR_UP is the prefix used to go from |
---|
| 687 | # DESTDIR/SUBDIR to the default installed libraries e.g. |
---|
| 688 | # ln -s SUBDIR_UP/foo.so DESTDIR/SUBDIR/foo.so. |
---|
| 689 | # When you call this function it is expected that you are in the root |
---|
| 690 | # of the build directory, and that the default build directory is: |
---|
| 691 | # "../build-%{target}" (relatively). |
---|
| 692 | # The primary use of this function is to install alternate runtimes |
---|
| 693 | # into the build directory and avoid duplicating this code for each |
---|
| 694 | # runtime. |
---|
[7961] | 695 | install_different() |
---|
| 696 | { |
---|
[12020] | 697 | local lib libbase libbaseso dlib |
---|
| 698 | local destdir="$1" |
---|
| 699 | local subdir="$2" |
---|
| 700 | local subdir_up="$3" |
---|
| 701 | local libdestdir="$destdir/$subdir" |
---|
| 702 | # All three arguments must be non-zero paths. |
---|
| 703 | if ! [ "$destdir" \ |
---|
| 704 | -a "$subdir" \ |
---|
| 705 | -a "$subdir_up" ]; then |
---|
| 706 | echo "One of the arguments to install_different was emtpy." |
---|
| 707 | exit 1 |
---|
| 708 | fi |
---|
| 709 | # Create the destination directory and the multilib directory. |
---|
| 710 | mkdir -p "$destdir" |
---|
| 711 | mkdir -p "$libdestdir" |
---|
| 712 | # Walk all of the libraries we installed... |
---|
| 713 | for lib in libc math/libm nptl/libpthread rt/librt nptl_db/libthread_db |
---|
| 714 | do |
---|
| 715 | libbase=${lib#*/} |
---|
| 716 | # Take care that `libbaseso' has a * that needs expanding so |
---|
| 717 | # take care with quoting. |
---|
| 718 | libbaseso=$(basename %{glibc_sysroot}/%{_lib}/${libbase}-*.so) |
---|
| 719 | # Only install if different from default build library. |
---|
| 720 | if cmp -s ${lib}.so ../build-%{target}/${lib}.so; then |
---|
| 721 | ln -sf "$subdir_up"/$libbaseso $libdestdir/$libbaseso |
---|
| 722 | else |
---|
| 723 | cp -a ${lib}.so $libdestdir/$libbaseso |
---|
| 724 | fi |
---|
| 725 | dlib=$libdestdir/$(basename %{glibc_sysroot}/%{_lib}/${libbase}.so.*) |
---|
| 726 | ln -sf $libbaseso $dlib |
---|
| 727 | done |
---|
[7961] | 728 | } |
---|
| 729 | |
---|
[12020] | 730 | ############################################################################## |
---|
[521] | 731 | # Remove the files we don't want to distribute |
---|
[12020] | 732 | ############################################################################## |
---|
[521] | 733 | |
---|
[12020] | 734 | # Remove the libNoVersion files. |
---|
| 735 | # XXX: This looks like a bug in glibc that accidentally installed these |
---|
| 736 | # wrong files. We probably don't need this today. |
---|
| 737 | rm -f %{glibc_sysroot}/%{_libdir}/libNoVersion* |
---|
| 738 | rm -f %{glibc_sysroot}/%{_lib}/libNoVersion* |
---|
[521] | 739 | |
---|
[12020] | 740 | # Remove the old nss modules. |
---|
| 741 | rm -f %{glibc_sysroot}/%{_lib}/libnss1-* |
---|
| 742 | rm -f %{glibc_sysroot}/%{_lib}/libnss-*.so.1 |
---|
[521] | 743 | |
---|
[12020] | 744 | # This statically linked binary is no longer necessary in a world where |
---|
| 745 | # the default Fedora install uses an initramfs, and further we have rpm-ostree |
---|
| 746 | # which captures the whole userspace FS tree. |
---|
| 747 | # Further, see https://github.com/projectatomic/rpm-ostree/pull/1173#issuecomment-355014583 |
---|
| 748 | rm -f %{glibc_sysroot}/{usr/,}sbin/sln |
---|
[521] | 749 | |
---|
[12020] | 750 | ###################################################################### |
---|
| 751 | # Run ldconfig to create all the symbolic links we need |
---|
| 752 | ###################################################################### |
---|
[521] | 753 | |
---|
[12020] | 754 | # Note: This has to happen before creating /etc/ld.so.conf. |
---|
[521] | 755 | |
---|
[12020] | 756 | mkdir -p %{glibc_sysroot}/var/cache/ldconfig |
---|
| 757 | truncate -s 0 %{glibc_sysroot}/var/cache/ldconfig/aux-cache |
---|
[521] | 758 | |
---|
[12020] | 759 | # ldconfig is statically linked, so we can use the new version. |
---|
| 760 | %{glibc_sysroot}/sbin/ldconfig -N -r %{glibc_sysroot} |
---|
[521] | 761 | |
---|
[12020] | 762 | ############################################################################## |
---|
| 763 | # Install info files |
---|
| 764 | ############################################################################## |
---|
[521] | 765 | |
---|
[12020] | 766 | %if %{with docs} |
---|
| 767 | # Move the info files if glibc installed them into the wrong location. |
---|
| 768 | if [ -d %{glibc_sysroot}%{_prefix}/info -a "%{_infodir}" != "%{_prefix}/info" ]; then |
---|
| 769 | mkdir -p %{glibc_sysroot}%{_infodir} |
---|
| 770 | mv -f %{glibc_sysroot}%{_prefix}/info/* %{glibc_sysroot}%{_infodir} |
---|
| 771 | rm -rf %{glibc_sysroot}%{_prefix}/info |
---|
| 772 | fi |
---|
[521] | 773 | |
---|
[12020] | 774 | # Compress all of the info files. |
---|
| 775 | gzip -9nvf %{glibc_sysroot}%{_infodir}/libc* |
---|
[521] | 776 | |
---|
[12020] | 777 | %else |
---|
| 778 | rm -f %{glibc_sysroot}%{_infodir}/dir |
---|
| 779 | rm -f %{glibc_sysroot}%{_infodir}/libc.info* |
---|
| 780 | %endif |
---|
[521] | 781 | |
---|
[12020] | 782 | ############################################################################## |
---|
| 783 | # Create locale sub-package file lists |
---|
| 784 | ############################################################################## |
---|
[521] | 785 | |
---|
[12020] | 786 | rm -f %{glibc_sysroot}/etc/localtime |
---|
| 787 | cp -f %{_datadir}/zoneinfo/Asia/Tokyo %{glibc_sysroot}/etc/localtime |
---|
[521] | 788 | |
---|
| 789 | %ifnarch %{auxarches} |
---|
| 790 | olddir=`pwd` |
---|
[12020] | 791 | pushd %{glibc_sysroot}%{_prefix}/lib/locale |
---|
| 792 | rm -f locale-archive |
---|
[521] | 793 | # Intentionally we do not pass --alias-file=, aliases will be added |
---|
| 794 | # by build-locale-archive. |
---|
[7961] | 795 | $olddir/build-%{target}/elf/ld.so \ |
---|
| 796 | --library-path $olddir/build-%{target}/ \ |
---|
[12020] | 797 | $olddir/build-%{target}/locale/localedef \ |
---|
| 798 | --prefix %{glibc_sysroot} --add-to-archive \ |
---|
| 799 | eo *_* |
---|
| 800 | # Setup the locale-archive template for use by glibc-all-langpacks. |
---|
[521] | 801 | mv locale-archive{,-extra.tmpl} |
---|
[7961] | 802 | $olddir/build-%{target}/elf/ld.so \ |
---|
| 803 | --library-path $olddir/build-%{target}/ \ |
---|
[12020] | 804 | $olddir/build-%{target}/locale/localedef \ |
---|
| 805 | --prefix %{glibc_sysroot} --add-to-archive \ |
---|
| 806 | ja_JP* en_US* |
---|
[521] | 807 | mv locale-archive{,.tmpl} |
---|
| 808 | cp -a locale-archive{.tmpl,-ja.tmpl} |
---|
[12020] | 809 | # Create the file lists for the language specific sub-packages: |
---|
| 810 | for i in eo *_* |
---|
| 811 | do |
---|
| 812 | lang=${i%%_*} |
---|
| 813 | # if [ ! -e langpack-${lang}.filelist ]; then |
---|
| 814 | # echo "%dir %{_prefix}/lib/locale" >> locales.filelist |
---|
| 815 | # fi |
---|
| 816 | echo "%dir %{_prefix}/lib/locale/$i" >> locales.filelist |
---|
| 817 | echo "%{_prefix}/lib/locale/$i/*" >> locales.filelist |
---|
| 818 | done |
---|
[521] | 819 | popd |
---|
[12020] | 820 | pushd %{glibc_sysroot}%{_prefix}/share/locale |
---|
| 821 | for i in */LC_MESSAGES/libc.mo |
---|
| 822 | do |
---|
| 823 | locale=${i%%%%/*} |
---|
| 824 | lang=${locale%%%%_*} |
---|
| 825 | echo "%lang($lang) %{_prefix}/share/locale/${i}" \ |
---|
| 826 | >> %{glibc_sysroot}%{_prefix}/lib/locale/locales.filelist |
---|
| 827 | done |
---|
| 828 | popd |
---|
| 829 | mv %{glibc_sysroot}%{_prefix}/lib/locale/*.filelist . |
---|
[521] | 830 | %endif |
---|
| 831 | |
---|
[12020] | 832 | ############################################################################## |
---|
| 833 | # Install configuration files for services |
---|
| 834 | ############################################################################## |
---|
[521] | 835 | |
---|
[12020] | 836 | install -p -m 644 %{SOURCE7} %{glibc_sysroot}/etc/nsswitch.conf |
---|
[521] | 837 | |
---|
[12020] | 838 | %ifnarch %{auxarches} |
---|
| 839 | # This is for ncsd - in glibc 2.2 |
---|
| 840 | install -m 644 nscd/nscd.conf %{glibc_sysroot}/etc |
---|
| 841 | %if %{with systemd} |
---|
| 842 | mkdir -p %{glibc_sysroot}%{_tmpfilesdir} |
---|
| 843 | install -m 644 %{SOURCE4} %{buildroot}%{_tmpfilesdir} |
---|
[12398] | 844 | mkdir -p %{glibc_sysroot}%{_unitdir} |
---|
| 845 | install -m 644 nscd/nscd.service nscd/nscd.socket %{glibc_sysroot}%{_unitdir}/ |
---|
[12020] | 846 | %else |
---|
| 847 | mkdir -p %{glibc_sysroot}/etc/rc.d/init.d |
---|
| 848 | install -m 755 nscd/nscd.init %{glibc_sysroot}/etc/rc.d/init.d/nscd |
---|
| 849 | %endif |
---|
| 850 | %endif |
---|
[521] | 851 | |
---|
[12020] | 852 | # Include ld.so.conf |
---|
| 853 | echo 'include ld.so.conf.d/*.conf' > %{glibc_sysroot}/etc/ld.so.conf |
---|
| 854 | truncate -s 0 %{glibc_sysroot}/etc/ld.so.cache |
---|
| 855 | chmod 644 %{glibc_sysroot}/etc/ld.so.conf |
---|
| 856 | mkdir -p %{glibc_sysroot}/etc/ld.so.conf.d |
---|
| 857 | %ifnarch %{auxarches} |
---|
| 858 | mkdir -p %{glibc_sysroot}/etc/sysconfig |
---|
| 859 | truncate -s 0 %{glibc_sysroot}/etc/sysconfig/nscd |
---|
| 860 | truncate -s 0 %{glibc_sysroot}/etc/gai.conf |
---|
| 861 | %endif |
---|
[521] | 862 | |
---|
[12020] | 863 | # Include %{_libdir}/gconv/gconv-modules.cache |
---|
| 864 | truncate -s 0 %{glibc_sysroot}%{_libdir}/gconv/gconv-modules.cache |
---|
| 865 | chmod 644 %{glibc_sysroot}%{_libdir}/gconv/gconv-modules.cache |
---|
[521] | 866 | |
---|
[12020] | 867 | ############################################################################## |
---|
| 868 | # Install debug copies of unstripped static libraries |
---|
| 869 | # - This step must be last in order to capture any additional static |
---|
| 870 | # archives we might have added. |
---|
| 871 | ############################################################################## |
---|
[521] | 872 | |
---|
[12020] | 873 | # If we are building a debug package then copy all of the static archives |
---|
| 874 | # into the debug directory to keep them as unstripped copies. |
---|
| 875 | %if 0%{?_enable_debug_packages} |
---|
| 876 | mkdir -p %{glibc_sysroot}%{_prefix}/lib/debug%{_libdir} |
---|
| 877 | cp -a %{glibc_sysroot}%{_libdir}/*.a \ |
---|
| 878 | %{glibc_sysroot}%{_prefix}/lib/debug%{_libdir}/ |
---|
| 879 | rm -f %{glibc_sysroot}%{_prefix}/lib/debug%{_libdir}/*_p.a |
---|
[521] | 880 | %endif |
---|
| 881 | |
---|
[12020] | 882 | # Remove any zoneinfo files; they are maintained by tzdata. |
---|
| 883 | rm -rf %{glibc_sysroot}%{_prefix}/share/zoneinfo |
---|
[521] | 884 | |
---|
[12020] | 885 | # Make sure %config files have the same timestamp across multilib packages. |
---|
| 886 | # |
---|
| 887 | # XXX: Ideally ld.so.conf should have the timestamp of the spec file, but there |
---|
| 888 | # doesn't seem to be any macro to give us that. So we do the next best thing, |
---|
| 889 | # which is to at least keep the timestamp consistent. The choice of using |
---|
| 890 | # glibc_post_upgrade.c is arbitrary. |
---|
| 891 | touch -r %{SOURCE0} %{glibc_sysroot}/etc/ld.so.conf |
---|
[12525] | 892 | touch -r inet/etc.rpc %{glibc_sysroot}/etc/rpc |
---|
[521] | 893 | |
---|
[7961] | 894 | pushd build-%{target} |
---|
[12020] | 895 | $GCC -Os -g -static -o build-locale-archive %{SOURCE1} \ |
---|
[7961] | 896 | ../build-%{target}/locale/locarchive.o \ |
---|
| 897 | ../build-%{target}/locale/md5.o \ |
---|
[12020] | 898 | ../build-%{target}/locale/record-status.o \ |
---|
[7961] | 899 | -I. -DDATADIR=\"%{_datadir}\" -DPREFIX=\"%{_prefix}\" \ |
---|
| 900 | -L../build-%{target} \ |
---|
| 901 | -B../build-%{target}/csu/ -lc -lc_nonshared |
---|
[12020] | 902 | install -m 700 build-locale-archive %{glibc_sysroot}%{_prefix}/sbin/build-locale-archive |
---|
[7961] | 903 | popd |
---|
[521] | 904 | |
---|
[12020] | 905 | # Lastly copy some additional documentation for the packages. |
---|
[521] | 906 | rm -rf documentation |
---|
| 907 | mkdir documentation |
---|
| 908 | cp timezone/README documentation/README.timezone |
---|
| 909 | cp posix/gai.conf documentation/ |
---|
| 910 | |
---|
| 911 | %ifarch s390x |
---|
| 912 | # Compatibility symlink |
---|
[12020] | 913 | mkdir -p %{glibc_sysroot}/lib |
---|
| 914 | ln -sf /%{_lib}/ld64.so.1 %{glibc_sysroot}/lib/ld64.so.1 |
---|
[521] | 915 | %endif |
---|
| 916 | |
---|
[12020] | 917 | %if %{with benchtests} |
---|
| 918 | # Build benchmark binaries. Ignore the output of the benchmark runs. |
---|
[7961] | 919 | pushd build-%{target} |
---|
[12020] | 920 | make BENCH_DURATION=1 bench-build |
---|
[7961] | 921 | popd |
---|
| 922 | |
---|
[12020] | 923 | # Copy over benchmark binaries. |
---|
| 924 | mkdir -p %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests |
---|
| 925 | cp $(find build-%{target}/benchtests -type f -executable) %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/ |
---|
| 926 | # ... and the makefile. |
---|
| 927 | for b in %{SOURCE9} %{SOURCE10}; do |
---|
| 928 | cp $b %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/ |
---|
| 929 | done |
---|
| 930 | # .. and finally, the comparison scripts. |
---|
| 931 | cp benchtests/scripts/benchout.schema.json %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/ |
---|
| 932 | cp benchtests/scripts/compare_bench.py %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/ |
---|
| 933 | cp benchtests/scripts/import_bench.py %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/ |
---|
| 934 | cp benchtests/scripts/validate_benchout.py %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/ |
---|
[521] | 935 | %endif |
---|
[7961] | 936 | |
---|
[12020] | 937 | %if 0%{?_enable_debug_packages} |
---|
| 938 | # The #line directives gperf generates do not give the proper |
---|
| 939 | # file name relative to the build directory. |
---|
| 940 | pushd locale |
---|
[12525] | 941 | ln -sf programs/*.gperf . |
---|
[7961] | 942 | popd |
---|
[12020] | 943 | pushd iconv |
---|
[12525] | 944 | ln -sf ../locale/programs/charmap-kw.gperf . |
---|
[12020] | 945 | popd |
---|
| 946 | %endif # %{?_enable_debug_packages} |
---|
| 947 | |
---|
| 948 | %if %{with docs} |
---|
| 949 | # Remove the `dir' info-heirarchy file which will be maintained |
---|
| 950 | # by the system as it adds info files to the install. |
---|
| 951 | rm -f %{glibc_sysroot}%{_infodir}/dir |
---|
[521] | 952 | %endif |
---|
| 953 | |
---|
[12020] | 954 | %ifnarch %{auxarches} |
---|
| 955 | truncate -s 0 %{glibc_sysroot}/%{_prefix}/lib/locale/locale-archive |
---|
| 956 | mkdir -p %{glibc_sysroot}/var/{db,run}/nscd |
---|
| 957 | touch %{glibc_sysroot}/var/{db,run}/nscd/{passwd,group,hosts,services} |
---|
| 958 | touch %{glibc_sysroot}/var/run/nscd/{socket,nscd.pid} |
---|
[521] | 959 | %endif |
---|
| 960 | |
---|
[12020] | 961 | # Move libpcprofile.so and libmemusage.so into the proper library directory. |
---|
| 962 | # They can be moved without any real consequences because users would not use |
---|
| 963 | # them directly. |
---|
| 964 | mkdir -p %{glibc_sysroot}%{_libdir} |
---|
| 965 | mv -f %{glibc_sysroot}/%{_lib}/lib{pcprofile,memusage}.so \ |
---|
| 966 | %{glibc_sysroot}%{_libdir} |
---|
| 967 | |
---|
| 968 | # Strip all of the installed object files. |
---|
| 969 | strip -g %{glibc_sysroot}%{_libdir}/*.o |
---|
| 970 | |
---|
[7961] | 971 | ############################################################################### |
---|
| 972 | # Rebuild libpthread.a using --whole-archive to ensure all of libpthread |
---|
| 973 | # is included in a static link. This prevents any problems when linking |
---|
| 974 | # statically, using parts of libpthread, and other necessary parts not |
---|
| 975 | # being included. Upstream has decided that this is the wrong approach to |
---|
| 976 | # this problem and that the full set of dependencies should be resolved |
---|
| 977 | # such that static linking works and produces the most minimally sized |
---|
| 978 | # static application possible. |
---|
| 979 | ############################################################################### |
---|
[12020] | 980 | pushd %{glibc_sysroot}%{_prefix}/%{_lib}/ |
---|
[521] | 981 | $GCC -r -nostdlib -o libpthread.o -Wl,--whole-archive ./libpthread.a |
---|
| 982 | rm libpthread.a |
---|
| 983 | ar rcs libpthread.a libpthread.o |
---|
| 984 | rm libpthread.o |
---|
| 985 | popd |
---|
[12020] | 986 | |
---|
| 987 | # The xtrace and memusage scripts have hard-coded paths that need to be |
---|
| 988 | # translated to a correct set of paths using the $LIB token which is |
---|
| 989 | # dynamically translated by ld.so as the default lib directory. |
---|
| 990 | for i in %{glibc_sysroot}%{_prefix}/bin/{xtrace,memusage}; do |
---|
| 991 | %if %{with bootstrap} |
---|
| 992 | test -w $i || continue |
---|
| 993 | %endif |
---|
| 994 | sed -e 's~=/%{_lib}/libpcprofile.so~=%{_libdir}/libpcprofile.so~' \ |
---|
| 995 | -e 's~=/%{_lib}/libmemusage.so~=%{_libdir}/libmemusage.so~' \ |
---|
| 996 | -e 's~='\''/\\\$LIB/libpcprofile.so~='\''%{_prefix}/\\$LIB/libpcprofile.so~' \ |
---|
| 997 | -e 's~='\''/\\\$LIB/libmemusage.so~='\''%{_prefix}/\\$LIB/libmemusage.so~' \ |
---|
| 998 | -i $i |
---|
| 999 | done |
---|
| 1000 | |
---|
| 1001 | ############################################################################## |
---|
| 1002 | # Build an empty libpthread_nonshared.a for compatiliby with applications |
---|
| 1003 | # that have old linker scripts that reference this file. We ship this only |
---|
| 1004 | # in compat-libpthread-nonshared sub-package. |
---|
| 1005 | ############################################################################## |
---|
| 1006 | ar cr %{glibc_sysroot}%{_prefix}/%{_lib}/libpthread_nonshared.a |
---|
| 1007 | |
---|
| 1008 | ############################################################################## |
---|
| 1009 | # Beyond this point in the install process we no longer modify the set of |
---|
| 1010 | # installed files, with one exception, for auxarches we cleanup the file list |
---|
| 1011 | # at the end and remove files which we don't intend to ship. We need the file |
---|
| 1012 | # list to effect a proper cleanup, and so it happens last. |
---|
| 1013 | ############################################################################## |
---|
| 1014 | |
---|
| 1015 | ############################################################################## |
---|
| 1016 | # Build the file lists used for describing the package and subpackages. |
---|
| 1017 | ############################################################################## |
---|
| 1018 | # There are several main file lists (and many more for |
---|
| 1019 | # the langpack sub-packages (langpack-${lang}.filelist)): |
---|
| 1020 | # * master.filelist |
---|
| 1021 | # - Master file list from which all other lists are built. |
---|
| 1022 | # * glibc.filelist |
---|
| 1023 | # - Files for the glibc packages. |
---|
| 1024 | # * common.filelist |
---|
| 1025 | # - Flies for the common subpackage. |
---|
| 1026 | # * utils.filelist |
---|
| 1027 | # - Files for the utils subpackage. |
---|
| 1028 | # * nscd.filelist |
---|
| 1029 | # - Files for the nscd subpackage. |
---|
| 1030 | # * devel.filelist |
---|
| 1031 | # - Files for the devel subpackage. |
---|
| 1032 | # * headers.filelist |
---|
| 1033 | # - Files for the headers subpackage. |
---|
| 1034 | # * static.filelist |
---|
| 1035 | # - Files for the static subpackage. |
---|
| 1036 | # * libnsl.filelist |
---|
| 1037 | # - Files for the libnsl subpackage |
---|
| 1038 | # * nss_db.filelist |
---|
| 1039 | # * nss_hesiod.filelist |
---|
| 1040 | # - File lists for nss_* NSS module subpackages. |
---|
| 1041 | # * nss-devel.filelist |
---|
| 1042 | # - File list with the .so symbolic links for NSS packages. |
---|
| 1043 | # * compat-libpthread-nonshared.filelist. |
---|
| 1044 | # - File list for compat-libpthread-nonshared subpackage. |
---|
| 1045 | # * debuginfo.filelist |
---|
| 1046 | # - Files for the glibc debuginfo package. |
---|
| 1047 | # * debuginfocommon.filelist |
---|
| 1048 | # - Files for the glibc common debuginfo package. |
---|
| 1049 | # |
---|
| 1050 | |
---|
| 1051 | # Create the main file lists. This way we can append to any one of them later |
---|
| 1052 | # wihtout having to create it. Note these are removed at the start of the |
---|
| 1053 | # install phase. |
---|
| 1054 | touch master.filelist |
---|
| 1055 | touch glibc.filelist |
---|
| 1056 | touch common.filelist |
---|
| 1057 | touch utils.filelist |
---|
| 1058 | touch nscd.filelist |
---|
| 1059 | touch devel.filelist |
---|
| 1060 | touch headers.filelist |
---|
| 1061 | touch static.filelist |
---|
| 1062 | touch libnsl.filelist |
---|
| 1063 | touch nss_db.filelist |
---|
| 1064 | touch nss_hesiod.filelist |
---|
| 1065 | touch nss-devel.filelist |
---|
| 1066 | touch compat-libpthread-nonshared.filelist |
---|
| 1067 | touch debuginfo.filelist |
---|
| 1068 | touch debuginfocommon.filelist |
---|
| 1069 | |
---|
[7961] | 1070 | ############################################################################### |
---|
[12020] | 1071 | # Master file list, excluding a few things. |
---|
| 1072 | ############################################################################### |
---|
| 1073 | { |
---|
| 1074 | # List all files or links that we have created during install. |
---|
| 1075 | # Files with 'etc' are configuration files, likewise 'gconv-modules' |
---|
| 1076 | # and 'gconv-modules.cache' are caches, and we exclude them. |
---|
| 1077 | find %{glibc_sysroot} \( -type f -o -type l \) \ |
---|
| 1078 | \( \ |
---|
| 1079 | -name etc -printf "%%%%config " -o \ |
---|
| 1080 | -name gconv-modules \ |
---|
| 1081 | -printf "%%%%verify(not md5 size mtime) %%%%config(noreplace) " -o \ |
---|
| 1082 | -name gconv-modules.cache \ |
---|
| 1083 | -printf "%%%%verify(not md5 size mtime) " \ |
---|
| 1084 | , \ |
---|
| 1085 | ! -path "*/lib/debug/*" -printf "/%%P\n" \) |
---|
| 1086 | # List all directories with a %%dir prefix. We omit the info directory and |
---|
| 1087 | # all directories in (and including) /usr/share/locale. |
---|
| 1088 | find %{glibc_sysroot} -type d \ |
---|
| 1089 | \( -path '*%{_prefix}/share/locale' -prune -o \ |
---|
| 1090 | \( -path '*%{_prefix}/share/*' \ |
---|
| 1091 | %if %{with docs} |
---|
| 1092 | ! -path '*%{_infodir}' -o \ |
---|
| 1093 | %endif |
---|
| 1094 | -path "*%{_prefix}/include/*" \ |
---|
| 1095 | \) -printf "%%%%dir /%%P\n" \) |
---|
| 1096 | } | { |
---|
| 1097 | # Also remove the *.mo entries. We will add them to the |
---|
| 1098 | # language specific sub-packages. |
---|
| 1099 | # libnss_ files go into subpackages related to NSS modules. |
---|
| 1100 | # and .*/share/i18n/charmaps/.*), they go into the sub-package |
---|
| 1101 | # "locale-source": |
---|
| 1102 | sed -e '\,.*/share/locale/\([^/_]\+\).*/LC_MESSAGES/.*\.mo,d' \ |
---|
| 1103 | -e '\,.*/share/i18n/locales/.*,d' \ |
---|
| 1104 | -e '\,.*/share/i18n/charmaps/.*,d' \ |
---|
| 1105 | -e '\,.*/etc/\(localtime\|nsswitch.conf\|ld\.so\.conf\|ld\.so\.cache\|default\|rpc\|gai\.conf\),d' \ |
---|
| 1106 | -e '\,.*/%{_libdir}/lib\(pcprofile\|memusage\)\.so,d' \ |
---|
| 1107 | -e '\,.*/bin/\(memusage\|mtrace\|xtrace\|pcprofiledump\),d' |
---|
| 1108 | } | sort > master.filelist |
---|
[521] | 1109 | |
---|
[12020] | 1110 | # The master file list is now used by each subpackage to list their own |
---|
| 1111 | # files. We go through each package and subpackage now and create their lists. |
---|
| 1112 | # Each subpackage picks the files from the master list that they need. |
---|
| 1113 | # The order of the subpackage list generation does not matter. |
---|
[521] | 1114 | |
---|
[12020] | 1115 | # Make the master file list read-only after this point to avoid accidental |
---|
| 1116 | # modification. |
---|
| 1117 | chmod 0444 master.filelist |
---|
[521] | 1118 | |
---|
[12020] | 1119 | ############################################################################### |
---|
| 1120 | # glibc |
---|
| 1121 | ############################################################################### |
---|
[521] | 1122 | |
---|
[12020] | 1123 | # Add all files with the following exceptions: |
---|
| 1124 | # - The info files '%{_infodir}/dir' |
---|
| 1125 | # - The partial (lib*_p.a) static libraries, include files. |
---|
| 1126 | # - The static files, objects, unversioned DSOs, and nscd. |
---|
| 1127 | # - The bin, locale, some sbin, and share. |
---|
| 1128 | # - The use of [^gi] is meant to exclude all files except glibc_post_upgrade, |
---|
| 1129 | # and iconvconfig, which we want in the main packages. |
---|
| 1130 | # - All the libnss files (we add back the ones we want later). |
---|
| 1131 | # - All bench test binaries. |
---|
| 1132 | # - The aux-cache, since it's handled specially in the files section. |
---|
| 1133 | # - The build-locale-archive binary since it's in the common package. |
---|
| 1134 | cat master.filelist \ |
---|
| 1135 | | grep -v \ |
---|
| 1136 | -e '%{_infodir}' \ |
---|
| 1137 | -e '%{_libdir}/lib.*_p.a' \ |
---|
| 1138 | -e '%{_prefix}/include' \ |
---|
| 1139 | -e '%{_libdir}/lib.*\.a' \ |
---|
| 1140 | -e '%{_libdir}/.*\.o' \ |
---|
| 1141 | -e '%{_libdir}/lib.*\.so' \ |
---|
| 1142 | -e 'nscd' \ |
---|
| 1143 | -e '%{_prefix}/bin' \ |
---|
| 1144 | -e '%{_prefix}/lib/locale' \ |
---|
| 1145 | -e '%{_prefix}/sbin/[^gi]' \ |
---|
| 1146 | -e '%{_prefix}/share' \ |
---|
| 1147 | -e '/var/db/Makefile' \ |
---|
| 1148 | -e '/libnss_.*\.so[0-9.]*$' \ |
---|
| 1149 | -e '/libnsl' \ |
---|
| 1150 | -e 'glibc-benchtests' \ |
---|
| 1151 | -e 'aux-cache' \ |
---|
| 1152 | -e 'build-locale-archive' \ |
---|
| 1153 | > glibc.filelist |
---|
| 1154 | |
---|
| 1155 | # Add specific files: |
---|
| 1156 | # - The nss_files, nss_compat, and nss_db files. |
---|
| 1157 | # - The libmemusage.so and libpcprofile.so used by utils. |
---|
| 1158 | for module in compat files db dns hesiod; do |
---|
| 1159 | cat master.filelist \ |
---|
| 1160 | | grep -E \ |
---|
| 1161 | -e "/libnss_$module(\.so\.[0-9.]+|-[0-9.]+\.so)$" \ |
---|
| 1162 | >> glibc.filelist |
---|
| 1163 | done |
---|
| 1164 | grep -e "libmemusage.so" -e "libpcprofile.so" master.filelist >> glibc.filelist |
---|
| 1165 | |
---|
[12398] | 1166 | cat glibc.filelist \ |
---|
| 1167 | | grep -v \ |
---|
| 1168 | -e '/sbin/ldconfig' \ |
---|
| 1169 | > compat32-glibc.filelist |
---|
| 1170 | |
---|
[12020] | 1171 | ############################################################################### |
---|
| 1172 | # glibc-devel |
---|
| 1173 | ############################################################################### |
---|
| 1174 | |
---|
| 1175 | %if %{with docs} |
---|
| 1176 | # Put the info files into the devel file list, but exclude the generated dir. |
---|
| 1177 | grep '%{_infodir}' master.filelist | grep -v '%{_infodir}/dir' > devel.filelist |
---|
| 1178 | %endif |
---|
| 1179 | |
---|
| 1180 | # Put some static files into the devel package. |
---|
| 1181 | grep '%{_libdir}/lib.*\.a' master.filelist \ |
---|
| 1182 | | grep '/lib\(\(c\|pthread\|nldbl\|mvec\)_nonshared\|g\|ieee\|mcheck\)\.a$' \ |
---|
| 1183 | >> devel.filelist |
---|
| 1184 | |
---|
| 1185 | # Put all of the object files and *.so (not the versioned ones) into the |
---|
| 1186 | # devel package. |
---|
| 1187 | grep '%{_libdir}/.*\.o' < master.filelist >> devel.filelist |
---|
| 1188 | grep '%{_libdir}/lib.*\.so' < master.filelist >> devel.filelist |
---|
| 1189 | # The exceptions are: |
---|
| 1190 | # - libmemusage.so and libpcprofile.so in glibc used by utils. |
---|
| 1191 | # - libnss_*.so which are in nss-devel. |
---|
| 1192 | sed -i -e '\,libmemusage.so,d' \ |
---|
| 1193 | -e '\,libpcprofile.so,d' \ |
---|
| 1194 | -e '\,/libnss_[a-z]*\.so$,d' \ |
---|
| 1195 | devel.filelist |
---|
| 1196 | |
---|
| 1197 | ############################################################################### |
---|
| 1198 | # glibc-headers |
---|
| 1199 | ############################################################################### |
---|
| 1200 | |
---|
| 1201 | # The glibc-headers package includes only common files which are identical |
---|
| 1202 | # across all multilib packages. We must keep gnu/stubs.h and gnu/lib-names.h |
---|
| 1203 | # in the glibc-headers package, but the -32, -64, -64-v1, and -64-v2 versions |
---|
| 1204 | # go into the development packages. |
---|
| 1205 | grep '%{_prefix}/include/gnu/stubs-.*\.h$' < master.filelist >> devel.filelist || : |
---|
| 1206 | grep '%{_prefix}/include/gnu/lib-names-.*\.h$' < master.filelist >> devel.filelist || : |
---|
| 1207 | # Put the include files into headers file list. |
---|
| 1208 | grep '%{_prefix}/include' < master.filelist \ |
---|
| 1209 | | egrep -v '%{_prefix}/include/gnu/stubs-.*\.h$' \ |
---|
| 1210 | | egrep -v '%{_prefix}/include/gnu/lib-names-.*\.h$' \ |
---|
| 1211 | > headers.filelist |
---|
| 1212 | |
---|
| 1213 | ############################################################################### |
---|
| 1214 | # glibc-static |
---|
| 1215 | ############################################################################### |
---|
| 1216 | |
---|
| 1217 | # Put the rest of the static files into the static package. |
---|
| 1218 | grep '%{_libdir}/lib.*\.a' < master.filelist \ |
---|
| 1219 | | grep -v '/lib\(\(c\|pthread\|nldbl\|mvec\)_nonshared\|g\|ieee\|mcheck\)\.a$' \ |
---|
| 1220 | > static.filelist |
---|
| 1221 | |
---|
| 1222 | ############################################################################### |
---|
| 1223 | # glibc-common |
---|
| 1224 | ############################################################################### |
---|
| 1225 | |
---|
| 1226 | # All of the bin and certain sbin files go into the common package except |
---|
| 1227 | # glibc_post_upgrade.* and iconvconfig which need to go in glibc. Likewise |
---|
| 1228 | # nscd is excluded because it goes in nscd. |
---|
| 1229 | grep '%{_prefix}/bin' master.filelist >> common.filelist |
---|
| 1230 | grep '%{_prefix}/sbin/[^gi]' master.filelist \ |
---|
| 1231 | | grep -v 'nscd' >> common.filelist |
---|
| 1232 | # All of the files under share go into the common package since they should be |
---|
| 1233 | # multilib-independent. |
---|
| 1234 | # Exceptions: |
---|
| 1235 | # - The actual share directory, not owned by us. |
---|
| 1236 | # - The info files which go in devel, and the info directory. |
---|
| 1237 | grep '%{_prefix}/share' master.filelist \ |
---|
| 1238 | | grep -v \ |
---|
| 1239 | -e '%{_prefix}/share/info/libc.info.*' \ |
---|
| 1240 | -e '%%dir %{_prefix}/share/info' \ |
---|
| 1241 | -e '%%dir %{_prefix}/share' \ |
---|
| 1242 | >> common.filelist |
---|
| 1243 | |
---|
| 1244 | # Add the binary to build locales to the common subpackage. |
---|
| 1245 | #echo '%{_prefix}/sbin/build-locale-archive' >> common.filelist |
---|
| 1246 | grep -e "/en_US/" -e "/ja_JP" -e "/ja/" locales.filelist >> common.filelist |
---|
| 1247 | grep -v -e "/en_US/" -e "/ja_JP" -e "/ja/" locales.filelist >> common-extra.filelist |
---|
| 1248 | |
---|
| 1249 | ############################################################################### |
---|
| 1250 | # nscd |
---|
| 1251 | ############################################################################### |
---|
| 1252 | |
---|
| 1253 | # The nscd binary must go into the nscd subpackage. |
---|
| 1254 | echo '%{_prefix}/sbin/nscd' > nscd.filelist |
---|
| 1255 | |
---|
| 1256 | ############################################################################### |
---|
| 1257 | # glibc-utils |
---|
| 1258 | ############################################################################### |
---|
| 1259 | |
---|
| 1260 | # Add the utils scripts and programs to the utils subpackage. |
---|
| 1261 | cat > utils.filelist <<EOF |
---|
| 1262 | %if %{without bootstrap} |
---|
| 1263 | %{_prefix}/bin/memusage |
---|
| 1264 | %{_prefix}/bin/memusagestat |
---|
| 1265 | %endif |
---|
| 1266 | %{_prefix}/bin/mtrace |
---|
| 1267 | %{_prefix}/bin/pcprofiledump |
---|
| 1268 | %{_prefix}/bin/xtrace |
---|
| 1269 | EOF |
---|
| 1270 | |
---|
| 1271 | ############################################################################### |
---|
| 1272 | # nss_db, nss_hesiod |
---|
| 1273 | ############################################################################### |
---|
| 1274 | |
---|
| 1275 | # Move the NSS-related files to the NSS subpackages. Be careful not |
---|
| 1276 | # to pick up .debug files, and the -devel symbolic links. |
---|
| 1277 | for module in db hesiod; do |
---|
| 1278 | grep -E "/libnss_$module(\.so\.[0-9.]+|-[0-9.]+\.so)$" \ |
---|
| 1279 | master.filelist > nss_$module.filelist |
---|
| 1280 | done |
---|
| 1281 | |
---|
| 1282 | ############################################################################### |
---|
| 1283 | # nss-devel |
---|
| 1284 | ############################################################################### |
---|
| 1285 | |
---|
| 1286 | # Symlinks go into the nss-devel package (instead of the main devel |
---|
| 1287 | # package). |
---|
| 1288 | grep '/libnss_[a-z]*\.so$' master.filelist > nss-devel.filelist |
---|
| 1289 | grep '/libnss_[a-z]*\.so$' master.filelist >> devel.filelist |
---|
| 1290 | |
---|
| 1291 | ############################################################################### |
---|
| 1292 | # libnsl |
---|
| 1293 | ############################################################################### |
---|
| 1294 | |
---|
| 1295 | # Prepare the libnsl-related file lists. |
---|
| 1296 | grep '/libnsl-[0-9.]*.so$' master.filelist > libnsl.filelist |
---|
| 1297 | test $(wc -l < libnsl.filelist) -eq 1 |
---|
| 1298 | grep '/libnsl-[0-9.]*.so$' master.filelist >> devel.filelist |
---|
| 1299 | |
---|
| 1300 | ############################################################################### |
---|
| 1301 | # glibc-benchtests |
---|
| 1302 | ############################################################################### |
---|
| 1303 | %if %{with benchtests} |
---|
| 1304 | |
---|
| 1305 | # List of benchmarks. |
---|
| 1306 | find build-%{target}/benchtests -type f -executable | while read b; do |
---|
| 1307 | echo "%{_prefix}/libexec/glibc-benchtests/$(basename $b)" |
---|
| 1308 | done >> benchtests.filelist |
---|
| 1309 | # ... and the makefile. |
---|
| 1310 | for b in %{SOURCE9} %{SOURCE10}; do |
---|
| 1311 | echo "%{_prefix}/libexec/glibc-benchtests/$(basename $b)" >> benchtests.filelist |
---|
| 1312 | done |
---|
| 1313 | # ... and finally, the comparison scripts. |
---|
| 1314 | echo "%{_prefix}/libexec/glibc-benchtests/benchout.schema.json" >> benchtests.filelist |
---|
| 1315 | echo "%{_prefix}/libexec/glibc-benchtests/compare_bench.py*" >> benchtests.filelist |
---|
| 1316 | echo "%{_prefix}/libexec/glibc-benchtests/import_bench.py*" >> benchtests.filelist |
---|
| 1317 | echo "%{_prefix}/libexec/glibc-benchtests/validate_benchout.py*" >> benchtests.filelist |
---|
| 1318 | %endif |
---|
| 1319 | |
---|
| 1320 | ############################################################################### |
---|
| 1321 | # compat-libpthread-nonshared |
---|
| 1322 | ############################################################################### |
---|
| 1323 | echo "%{_libdir}/libpthread_nonshared.a" >> compat-libpthread-nonshared.filelist |
---|
| 1324 | |
---|
| 1325 | ############################################################################### |
---|
| 1326 | # glibc-debuginfocommon, and glibc-debuginfo |
---|
| 1327 | ############################################################################### |
---|
| 1328 | %if 0%{?_enable_debug_packages} |
---|
| 1329 | |
---|
[521] | 1330 | find_debuginfo_args='--strict-build-id -g' |
---|
| 1331 | %ifarch %{debuginfocommonarches} |
---|
| 1332 | find_debuginfo_args="$find_debuginfo_args \ |
---|
[12020] | 1333 | -l common.filelist \ |
---|
| 1334 | -l utils.filelist \ |
---|
| 1335 | -l nscd.filelist \ |
---|
| 1336 | -p '.*/(sbin|libexec)/.*' \ |
---|
| 1337 | -o debuginfocommon.filelist \ |
---|
| 1338 | -l nss_db.filelist -l nss_hesiod.filelist \ |
---|
| 1339 | -l libnsl.filelist -l glibc.filelist \ |
---|
| 1340 | %if %{with benchtests} |
---|
| 1341 | -l benchtests.filelist |
---|
[521] | 1342 | %endif |
---|
[12020] | 1343 | " |
---|
| 1344 | %endif |
---|
[521] | 1345 | |
---|
[12020] | 1346 | /usr/lib/rpm/find-debuginfo.sh $find_debuginfo_args -o debuginfo.filelist |
---|
| 1347 | |
---|
| 1348 | # List all of the *.a archives in the debug directory. |
---|
[521] | 1349 | list_debug_archives() |
---|
| 1350 | { |
---|
[12020] | 1351 | local dir=%{_prefix}/lib/debug%{_libdir} |
---|
| 1352 | find %{glibc_sysroot}$dir -name "*.a" -printf "$dir/%%P\n" |
---|
[521] | 1353 | } |
---|
| 1354 | |
---|
| 1355 | %ifarch %{debuginfocommonarches} |
---|
| 1356 | |
---|
[12020] | 1357 | # Remove the source files from the common package debuginfo. |
---|
| 1358 | sed -i '\#^%{glibc_sysroot}%{_prefix}/src/debug/#d' debuginfocommon.filelist |
---|
| 1359 | |
---|
| 1360 | # Create a list of all of the source files we copied to the debug directory. |
---|
| 1361 | find %{glibc_sysroot}%{_prefix}/src/debug \ |
---|
| 1362 | \( -type d -printf '%%%%dir ' \) , \ |
---|
| 1363 | -printf '%{_prefix}/src/debug/%%P\n' > debuginfocommon.sources |
---|
| 1364 | |
---|
| 1365 | %ifarch %{biarcharches} |
---|
| 1366 | |
---|
| 1367 | # Add the source files to the core debuginfo package. |
---|
| 1368 | cat debuginfocommon.sources >> debuginfo.filelist |
---|
| 1369 | |
---|
| 1370 | %else |
---|
| 1371 | |
---|
[521] | 1372 | %ifarch %{ix86} |
---|
| 1373 | %define basearch i686 |
---|
| 1374 | %endif |
---|
| 1375 | %ifarch sparc sparcv9 |
---|
| 1376 | %define basearch sparc |
---|
| 1377 | %endif |
---|
| 1378 | |
---|
[7961] | 1379 | # The auxarches get only these few source files. |
---|
[521] | 1380 | auxarches_debugsources=\ |
---|
| 1381 | '/(generic|linux|%{basearch}|nptl(_db)?)/|/%{glibcsrcdir}/build|/dl-osinfo\.h' |
---|
| 1382 | |
---|
[7961] | 1383 | # Place the source files into the core debuginfo pakcage. |
---|
[521] | 1384 | egrep "$auxarches_debugsources" debuginfocommon.sources >> debuginfo.filelist |
---|
| 1385 | |
---|
[7961] | 1386 | # Remove the source files from the common debuginfo package. |
---|
[521] | 1387 | egrep -v "$auxarches_debugsources" \ |
---|
| 1388 | debuginfocommon.sources >> debuginfocommon.filelist |
---|
[5290] | 1389 | |
---|
[7961] | 1390 | %endif # %{biarcharches} |
---|
[521] | 1391 | |
---|
[7961] | 1392 | # Add the list of *.a archives in the debug directory to |
---|
| 1393 | # the common debuginfo package. |
---|
[521] | 1394 | list_debug_archives >> debuginfocommon.filelist |
---|
| 1395 | |
---|
[12020] | 1396 | %endif # %{debuginfocommonarches} |
---|
[521] | 1397 | |
---|
[12020] | 1398 | # Remove some common directories from the common package debuginfo so that we |
---|
| 1399 | # don't end up owning them. |
---|
| 1400 | exclude_common_dirs() |
---|
| 1401 | { |
---|
| 1402 | exclude_dirs="%{_prefix}/src/debug" |
---|
| 1403 | exclude_dirs="$exclude_dirs $(echo %{_prefix}/lib/debug{,/%{_lib},/bin,/sbin})" |
---|
| 1404 | exclude_dirs="$exclude_dirs $(echo %{_prefix}/lib/debug%{_prefix}{,/%{_lib},/libexec,/bin,/sbin})" |
---|
[7961] | 1405 | |
---|
[12020] | 1406 | for d in $(echo $exclude_dirs | sed 's/ /\n/g'); do |
---|
| 1407 | sed -i "\|^%%dir $d/\?$|d" $1 |
---|
| 1408 | done |
---|
| 1409 | } |
---|
[521] | 1410 | |
---|
[12020] | 1411 | %ifarch %{debuginfocommonarches} |
---|
| 1412 | exclude_common_dirs debuginfocommon.filelist |
---|
| 1413 | %endif |
---|
| 1414 | exclude_common_dirs debuginfo.filelist |
---|
[7961] | 1415 | |
---|
[12020] | 1416 | ############################################################################## |
---|
| 1417 | # Delete files that we do not intended to ship with the auxarch. |
---|
| 1418 | # This is the only place where we touch the installed files after generating |
---|
| 1419 | # the file lists. |
---|
| 1420 | ############################################################################## |
---|
[521] | 1421 | %ifarch %{auxarches} |
---|
| 1422 | echo Cutting down the list of unpackaged files |
---|
| 1423 | sed -e '/%%dir/d;/%%config/d;/%%verify/d;s/%%lang([^)]*) //;s#^/*##' \ |
---|
[12020] | 1424 | common.filelist devel.filelist static.filelist headers.filelist \ |
---|
| 1425 | utils.filelist nscd.filelist \ |
---|
| 1426 | %ifarch %{debuginfocommonarches} |
---|
| 1427 | debuginfocommon.filelist \ |
---|
| 1428 | %endif |
---|
| 1429 | | (cd %{glibc_sysroot}; xargs --no-run-if-empty rm -f 2> /dev/null || :) |
---|
| 1430 | %endif # %{auxarches} |
---|
[521] | 1431 | |
---|
[12020] | 1432 | %endif # %{?_enable_debug_packages} |
---|
[521] | 1433 | |
---|
[12020] | 1434 | %check |
---|
| 1435 | %if %{with testsuite} |
---|
[521] | 1436 | |
---|
[12020] | 1437 | # Run the glibc tests. If any tests fail to build we exit %check with |
---|
| 1438 | # an error, otherwise we print the test failure list and the failed |
---|
| 1439 | # test output and continue. Write to standard error to avoid |
---|
| 1440 | # synchronization issues with make and shell tracing output if |
---|
| 1441 | # standard output and standard error are different pipes. |
---|
| 1442 | run_tests () { |
---|
| 1443 | # This hides a test suite build failure, which should be fatal. We |
---|
| 1444 | # check "Summary of test results:" below to verify that all tests |
---|
| 1445 | # were built and run. |
---|
| 1446 | make %{?_smp_mflags} -O check |& tee rpmbuild.check.log >&2 |
---|
| 1447 | test -n tests.sum |
---|
| 1448 | if ! grep -q '^Summary of test results:$' rpmbuild.check.log ; then |
---|
| 1449 | echo "FAIL: test suite build of target: $(basename "$(pwd)")" >& 2 |
---|
| 1450 | exit 1 |
---|
| 1451 | fi |
---|
| 1452 | set +x |
---|
| 1453 | grep -v ^PASS: tests.sum > rpmbuild.tests.sum.not-passing || true |
---|
| 1454 | if test -n rpmbuild.tests.sum.not-passing ; then |
---|
| 1455 | echo ===================FAILED TESTS===================== >&2 |
---|
| 1456 | echo "Target: $(basename "$(pwd)")" >& 2 |
---|
| 1457 | cat rpmbuild.tests.sum.not-passing >&2 |
---|
| 1458 | while read failed_code failed_test ; do |
---|
| 1459 | for suffix in out test-result ; do |
---|
| 1460 | if test -e "$failed_test.$suffix"; then |
---|
| 1461 | echo >&2 |
---|
| 1462 | echo "=====$failed_code $failed_test.$suffix=====" >&2 |
---|
| 1463 | cat -- "$failed_test.$suffix" >&2 |
---|
| 1464 | echo >&2 |
---|
| 1465 | fi |
---|
| 1466 | done |
---|
| 1467 | done <rpmbuild.tests.sum.not-passing |
---|
| 1468 | fi |
---|
| 1469 | |
---|
| 1470 | # Unconditonally dump differences in the system call list. |
---|
| 1471 | echo "* System call consistency checks:" >&2 |
---|
| 1472 | cat misc/tst-syscall-list.out >&2 |
---|
| 1473 | set -x |
---|
| 1474 | } |
---|
| 1475 | |
---|
| 1476 | # Increase timeouts |
---|
| 1477 | export TIMEOUTFACTOR=16 |
---|
| 1478 | parent=$$ |
---|
| 1479 | echo ====================TESTING========================= |
---|
| 1480 | |
---|
| 1481 | # Default libraries. |
---|
| 1482 | pushd build-%{target} |
---|
| 1483 | run_tests |
---|
| 1484 | popd |
---|
| 1485 | |
---|
| 1486 | |
---|
| 1487 | echo ====================TESTING END===================== |
---|
| 1488 | PLTCMD='/^Relocation section .*\(\.rela\?\.plt\|\.rela\.IA_64\.pltoff\)/,/^$/p' |
---|
| 1489 | echo ====================PLT RELOCS LD.SO================ |
---|
| 1490 | readelf -Wr %{glibc_sysroot}/%{_lib}/ld-*.so | sed -n -e "$PLTCMD" |
---|
| 1491 | echo ====================PLT RELOCS LIBC.SO============== |
---|
| 1492 | readelf -Wr %{glibc_sysroot}/%{_lib}/libc-*.so | sed -n -e "$PLTCMD" |
---|
| 1493 | echo ====================PLT RELOCS END================== |
---|
| 1494 | |
---|
| 1495 | # Finally, check if valgrind runs with the new glibc. |
---|
| 1496 | # We want to fail building if valgrind is not able to run with this glibc so |
---|
| 1497 | # that we can then coordinate with valgrind to get it fixed before we update |
---|
| 1498 | # glibc. |
---|
| 1499 | pushd build-%{target} |
---|
| 1500 | |
---|
| 1501 | # Show the auxiliary vector as seen by the new library |
---|
| 1502 | # (even if we do not perform the valgrind test). |
---|
| 1503 | LD_SHOW_AUXV=1 elf/ld.so --library-path .:elf:nptl:dlfcn /bin/true |
---|
| 1504 | |
---|
| 1505 | %if %{with valgrind} |
---|
| 1506 | elf/ld.so --library-path .:elf:nptl:dlfcn \ |
---|
| 1507 | /usr/bin/valgrind --error-exitcode=1 \ |
---|
| 1508 | elf/ld.so --library-path .:elf:nptl:dlfcn /usr/bin/true |
---|
[521] | 1509 | %endif |
---|
[12020] | 1510 | popd |
---|
[521] | 1511 | |
---|
[12020] | 1512 | %endif # %{run_glibc_tests} |
---|
[521] | 1513 | |
---|
[12020] | 1514 | |
---|
[5290] | 1515 | %pre -p <lua> |
---|
| 1516 | -- Check that the running kernel is new enough |
---|
| 1517 | required = '%{enablekernel}' |
---|
| 1518 | rel = posix.uname("%r") |
---|
| 1519 | if rpm.vercmp(rel, required) < 0 then |
---|
| 1520 | error("FATAL: kernel too old", 0) |
---|
| 1521 | end |
---|
| 1522 | |
---|
[12525] | 1523 | %post -p <lua> |
---|
| 1524 | -- We use lua's posix.exec because there may be no shell that we can |
---|
| 1525 | -- run during glibc upgrade. We used to implement much of %%post as a |
---|
| 1526 | -- C program, but from an overall maintenance perspective the lua in |
---|
| 1527 | -- the spec file was simpler and safer given the operations required. |
---|
| 1528 | -- All lua code will be ignored by rpm-ostree; see: |
---|
| 1529 | -- https://github.com/projectatomic/rpm-ostree/pull/1869 |
---|
| 1530 | -- If we add new lua actions to the %%post code we should coordinate |
---|
| 1531 | -- with rpm-ostree and ensure that their glibc install is functional. |
---|
| 1532 | function post_exec (program, ...) |
---|
| 1533 | local pid = posix.fork () |
---|
| 1534 | if pid == 0 then |
---|
| 1535 | assert (posix.exec (program, ...)) |
---|
| 1536 | elseif pid > 0 then |
---|
| 1537 | posix.wait (pid) |
---|
| 1538 | end |
---|
| 1539 | end |
---|
[521] | 1540 | |
---|
[12525] | 1541 | -- (1) Remove multilib libraries from previous installs. |
---|
| 1542 | -- In order to support in-place upgrades, we must immediately remove |
---|
| 1543 | -- obsolete platform directories after installing a new glibc |
---|
| 1544 | -- version. RPM only deletes files removed by updates near the end |
---|
| 1545 | -- of the transaction. If we did not remove the obsolete platform |
---|
| 1546 | -- directories here, they may be preferred by the dynamic linker |
---|
| 1547 | -- during the execution of subsequent RPM scriptlets, likely |
---|
| 1548 | -- resulting in process startup failures. |
---|
| 1549 | |
---|
| 1550 | -- Full set of libraries glibc may install. |
---|
| 1551 | install_libs = { "anl", "BrokenLocale", "c", "dl", "m", "mvec", |
---|
| 1552 | "nss_compat", "nss_db", "nss_dns", "nss_files", |
---|
| 1553 | "nss_hesiod", "pthread", "resolv", "rt", "SegFault", |
---|
| 1554 | "thread_db", "util" } |
---|
| 1555 | |
---|
| 1556 | -- We are going to remove these libraries. Generally speaking we remove |
---|
| 1557 | -- all core libraries in the multilib directory. |
---|
| 1558 | -- We employ a tight match where X.Y is in [2.0,9.9*], so we would |
---|
| 1559 | -- match "libc-2.0.so" and so on up to "libc-9.9*". |
---|
| 1560 | remove_regexps = {} |
---|
| 1561 | for i = 1, #install_libs do |
---|
| 1562 | remove_regexps[i] = ("lib" .. install_libs[i] |
---|
| 1563 | .. "%%-[2-9]%%.[0-9]+%%.so$") |
---|
| 1564 | end |
---|
| 1565 | |
---|
| 1566 | -- Two exceptions: |
---|
| 1567 | remove_regexps[#install_libs + 1] = "libthread_db%%-1%%.0%%.so" |
---|
| 1568 | remove_regexps[#install_libs + 2] = "libSegFault%%.so" |
---|
| 1569 | |
---|
| 1570 | -- We are going to search these directories. |
---|
| 1571 | local remove_dirs = { "%{_libdir}/i686", |
---|
| 1572 | "%{_libdir}/i686/nosegneg", |
---|
| 1573 | "%{_libdir}/power6", |
---|
| 1574 | "%{_libdir}/power7", |
---|
| 1575 | "%{_libdir}/power8" } |
---|
| 1576 | |
---|
| 1577 | -- Walk all the directories with files we need to remove... |
---|
| 1578 | for _, rdir in ipairs (remove_dirs) do |
---|
| 1579 | if posix.access (rdir) then |
---|
| 1580 | -- If the directory exists we look at all the files... |
---|
| 1581 | local remove_files = posix.files (rdir) |
---|
| 1582 | for rfile in remove_files do |
---|
| 1583 | for _, rregexp in ipairs (remove_regexps) do |
---|
| 1584 | -- Does it match the regexp? |
---|
| 1585 | local dso = string.match (rfile, rregexp) |
---|
| 1586 | if (dso ~= nil) then |
---|
| 1587 | -- Removing file... |
---|
| 1588 | os.remove (rdir .. '/' .. rfile) |
---|
| 1589 | end |
---|
| 1590 | end |
---|
| 1591 | end |
---|
| 1592 | end |
---|
| 1593 | end |
---|
| 1594 | |
---|
| 1595 | -- (2) Update /etc/ld.so.conf |
---|
| 1596 | -- Next we update /etc/ld.so.conf to ensure that it starts with |
---|
| 1597 | -- a literal "include ld.so.conf.d/*.conf". |
---|
| 1598 | |
---|
| 1599 | local ldsoconf = "/etc/ld.so.conf" |
---|
| 1600 | local ldsoconf_tmp = "/etc/glibc_post_upgrade.ld.so.conf" |
---|
| 1601 | |
---|
| 1602 | if posix.access (ldsoconf) then |
---|
| 1603 | |
---|
| 1604 | -- We must have a "include ld.so.conf.d/*.conf" line. |
---|
| 1605 | local have_include = false |
---|
| 1606 | for line in io.lines (ldsoconf) do |
---|
| 1607 | -- This must match, and we don't ignore whitespace. |
---|
| 1608 | if string.match (line, "^include ld.so.conf.d/%%*%%.conf$") ~= nil then |
---|
| 1609 | have_include = true |
---|
| 1610 | end |
---|
| 1611 | end |
---|
| 1612 | |
---|
| 1613 | if not have_include then |
---|
| 1614 | -- Insert "include ld.so.conf.d/*.conf" line at the start of the |
---|
| 1615 | -- file. We only support one of these post upgrades running at |
---|
| 1616 | -- a time (temporary file name is fixed). |
---|
| 1617 | local tmp_fd = io.open (ldsoconf_tmp, "w") |
---|
| 1618 | if tmp_fd ~= nil then |
---|
| 1619 | tmp_fd:write ("include ld.so.conf.d/*.conf\n") |
---|
| 1620 | for line in io.lines (ldsoconf) do |
---|
| 1621 | tmp_fd:write (line .. "\n") |
---|
| 1622 | end |
---|
| 1623 | tmp_fd:close () |
---|
| 1624 | local res = os.rename (ldsoconf_tmp, ldsoconf) |
---|
| 1625 | if res == nil then |
---|
| 1626 | io.stdout:write ("Error: Unable to update configuration file (rename).\n") |
---|
| 1627 | end |
---|
| 1628 | else |
---|
| 1629 | io.stdout:write ("Error: Unable to update configuration file (open).\n") |
---|
| 1630 | end |
---|
| 1631 | end |
---|
| 1632 | end |
---|
| 1633 | |
---|
| 1634 | -- (3) Rebuild ld.so.cache early. |
---|
| 1635 | -- If the format of the cache changes then we need to rebuild |
---|
| 1636 | -- the cache early to avoid any problems running binaries with |
---|
| 1637 | -- the new glibc. |
---|
| 1638 | |
---|
| 1639 | -- Note: We use _prefix because Fedora's UsrMove says so. |
---|
| 1640 | post_exec ("/sbin/ldconfig") |
---|
| 1641 | |
---|
| 1642 | -- (4) Update gconv modules cache. |
---|
| 1643 | -- If the /usr/lib/gconv/gconv-modules.cache exists, then update it |
---|
| 1644 | -- with the latest set of modules that were just installed. |
---|
| 1645 | -- We assume that the cache is in _libdir/gconv and called |
---|
| 1646 | -- "gconv-modules.cache". |
---|
| 1647 | |
---|
| 1648 | local iconv_dir = "%{_libdir}/gconv" |
---|
| 1649 | local iconv_cache = iconv_dir .. "/gconv-modules.cache" |
---|
| 1650 | if (posix.utime (iconv_cache) == 0) then |
---|
| 1651 | post_exec ("%{_prefix}/sbin/iconvconfig", |
---|
| 1652 | "-o", iconv_cache, |
---|
| 1653 | "--nostdlib", |
---|
| 1654 | iconv_dir) |
---|
| 1655 | else |
---|
| 1656 | io.stdout:write ("Error: Missing " .. iconv_cache .. " file.\n") |
---|
| 1657 | end |
---|
| 1658 | |
---|
[521] | 1659 | %postun -p /sbin/ldconfig |
---|
| 1660 | |
---|
| 1661 | %post -n compat32-%{name} -p /sbin/ldconfig |
---|
| 1662 | %postun -n compat32-%{name} -p /sbin/ldconfig |
---|
| 1663 | |
---|
[5290] | 1664 | %triggerin common -p <lua> -- glibc |
---|
| 1665 | if posix.stat("%{_prefix}/lib/locale/locale-archive.tmpl", "size") > 0 then |
---|
| 1666 | pid = posix.fork() |
---|
| 1667 | if pid == 0 then |
---|
| 1668 | posix.exec("%{_prefix}/sbin/build-locale-archive") |
---|
| 1669 | elseif pid > 0 then |
---|
| 1670 | posix.wait(pid) |
---|
| 1671 | end |
---|
| 1672 | end |
---|
[521] | 1673 | |
---|
[5290] | 1674 | %post common -p <lua> |
---|
| 1675 | if posix.access("/etc/ld.so.cache") then |
---|
| 1676 | if posix.stat("%{_prefix}/lib/locale/locale-archive.tmpl", "size") > 0 then |
---|
| 1677 | pid = posix.fork() |
---|
| 1678 | if pid == 0 then |
---|
| 1679 | posix.exec("%{_prefix}/sbin/build-locale-archive") |
---|
| 1680 | elseif pid > 0 then |
---|
| 1681 | posix.wait(pid) |
---|
| 1682 | end |
---|
| 1683 | end |
---|
| 1684 | end |
---|
[521] | 1685 | |
---|
[12398] | 1686 | %if %{without systemd} |
---|
[5290] | 1687 | %triggerin common -p <lua> -- tzdata |
---|
| 1688 | function update (filename, new_data) |
---|
| 1689 | local fd = io.open(filename) |
---|
| 1690 | if not fd then return end |
---|
| 1691 | local data = fd:read("*a") |
---|
| 1692 | fd:close() |
---|
| 1693 | if not data then return end |
---|
| 1694 | -- Don't update the file unnecessarily. |
---|
| 1695 | if data == new_data then return end |
---|
| 1696 | local tempfilename = filename .. ".tzupdate" |
---|
| 1697 | fd = io.open(tempfilename, "w") |
---|
| 1698 | if not fd then return end |
---|
| 1699 | fd:write(new_data) |
---|
| 1700 | fd:close() |
---|
| 1701 | posix.chmod(tempfilename, 0644) |
---|
| 1702 | if not os.rename(tempfilename, filename) then |
---|
| 1703 | os.remove(tempfilename) |
---|
| 1704 | end |
---|
| 1705 | end |
---|
| 1706 | fd = io.open("/etc/sysconfig/clock") |
---|
| 1707 | if not fd then return end |
---|
| 1708 | zonename = nil |
---|
| 1709 | for l in fd:lines() do |
---|
| 1710 | zone = string.match(l, "^[ \t]*ZONE[ \t]*=[ \t]*\"?([^ \t\n\"]*)"); |
---|
| 1711 | if zone then |
---|
| 1712 | zonename = "/usr/share/zoneinfo/" .. zone |
---|
| 1713 | break |
---|
| 1714 | end |
---|
| 1715 | end |
---|
| 1716 | fd:close() |
---|
| 1717 | if not zonename then return end |
---|
| 1718 | fd = io.open(zonename) |
---|
| 1719 | if not fd then return end |
---|
| 1720 | data = fd:read("*a") |
---|
| 1721 | fd:close() |
---|
| 1722 | if not data then return end |
---|
| 1723 | update("/etc/localtime", data) |
---|
| 1724 | update("/var/spool/postfix/etc/localtime", data) |
---|
[12398] | 1725 | %endif |
---|
[521] | 1726 | |
---|
[5290] | 1727 | %post common-extra -p <lua> |
---|
| 1728 | -- cp -f /usr/lib/locale/locale-archive-extra.tmpl /usr/lib/locale/locale-archive.tmpl |
---|
| 1729 | if posix.access("/etc/ld.so.cache") then |
---|
| 1730 | if posix.stat("%{_prefix}/lib/locale/locale-archive.tmpl", "size") > 0 then |
---|
| 1731 | pid = posix.fork() |
---|
| 1732 | if pid == 0 then |
---|
| 1733 | posix.exec("%{_prefix}/sbin/build-locale-archive") |
---|
| 1734 | elseif pid > 0 then |
---|
| 1735 | posix.wait(pid) |
---|
| 1736 | end |
---|
| 1737 | end |
---|
| 1738 | end |
---|
[521] | 1739 | |
---|
[5290] | 1740 | %postun common-extra -p <lua> |
---|
| 1741 | posix.exec("cp -f /usr/lib/locale/locale-archive-ja.tmpl /usr/lib/locale/locale-archive.tmpl") |
---|
| 1742 | if posix.access("/etc/ld.so.cache") then |
---|
| 1743 | if posix.stat("%{_prefix}/lib/locale/locale-archive.tmpl", "size") > 0 then |
---|
| 1744 | pid = posix.fork() |
---|
| 1745 | if pid == 0 then |
---|
| 1746 | posix.exec("%{_prefix}/sbin/build-locale-archive") |
---|
| 1747 | elseif pid > 0 then |
---|
| 1748 | posix.wait(pid) |
---|
| 1749 | end |
---|
| 1750 | end |
---|
| 1751 | end |
---|
| 1752 | |
---|
[521] | 1753 | %triggerun -- common-extra |
---|
[5290] | 1754 | posix.exec("cp -f /usr/lib/locale/locale-archive-ja.tmpl /usr/lib/locale/locale-archive.tmpl") |
---|
| 1755 | if posix.access("/etc/ld.so.cache") then |
---|
| 1756 | if posix.stat("%{_prefix}/lib/locale/locale-archive.tmpl", "size") > 0 then |
---|
| 1757 | pid = posix.fork() |
---|
| 1758 | if pid == 0 then |
---|
| 1759 | posix.exec("%{_prefix}/sbin/build-locale-archive") |
---|
| 1760 | elseif pid > 0 then |
---|
| 1761 | posix.wait(pid) |
---|
| 1762 | end |
---|
| 1763 | end |
---|
| 1764 | end |
---|
[521] | 1765 | |
---|
[7961] | 1766 | |
---|
[521] | 1767 | %post devel |
---|
| 1768 | /sbin/install-info %{_infodir}/libc.info.gz %{_infodir}/dir > /dev/null 2>&1 || : |
---|
| 1769 | |
---|
| 1770 | %pre headers |
---|
| 1771 | # this used to be a link and it is causing nightmares now |
---|
| 1772 | if [ -L %{_prefix}/include/scsi ] ; then |
---|
| 1773 | rm -f %{_prefix}/include/scsi |
---|
| 1774 | fi |
---|
| 1775 | |
---|
| 1776 | %preun devel |
---|
| 1777 | if [ "$1" = 0 ]; then |
---|
| 1778 | /sbin/install-info --delete %{_infodir}/libc.info.gz %{_infodir}/dir > /dev/null 2>&1 || : |
---|
| 1779 | fi |
---|
| 1780 | |
---|
| 1781 | %post utils -p /sbin/ldconfig |
---|
| 1782 | |
---|
| 1783 | %postun utils -p /sbin/ldconfig |
---|
| 1784 | |
---|
| 1785 | %pre -n nscd |
---|
[5290] | 1786 | getent group nscd >/dev/null || /usr/sbin/groupadd -g 28 -r nscd |
---|
| 1787 | getent passwd nscd >/dev/null || |
---|
| 1788 | /usr/sbin/useradd -M -o -r -d / -s /sbin/nologin \ |
---|
| 1789 | -c "NSCD Daemon" -u 28 -g nscd nscd |
---|
[521] | 1790 | |
---|
| 1791 | %post -n nscd |
---|
[12398] | 1792 | %if %{with systemd} |
---|
| 1793 | %systemd_post nscd.service |
---|
| 1794 | %else |
---|
[521] | 1795 | /sbin/chkconfig --add nscd |
---|
[12398] | 1796 | %endif |
---|
[521] | 1797 | |
---|
| 1798 | %preun -n nscd |
---|
[12398] | 1799 | %if %{with systemd} |
---|
| 1800 | %systemd_preun nscd.service |
---|
| 1801 | %else |
---|
| 1802 | if [ $1 = 0 -o -x /bin/systemctl ] ; then |
---|
[5290] | 1803 | /sbin/service nscd stop > /dev/null 2>&1 |
---|
[521] | 1804 | /sbin/chkconfig --del nscd |
---|
| 1805 | fi |
---|
[12398] | 1806 | %endif |
---|
[521] | 1807 | |
---|
| 1808 | %postun -n nscd |
---|
| 1809 | if [ $1 = 0 ] ; then |
---|
| 1810 | /usr/sbin/userdel nscd > /dev/null 2>&1 || : |
---|
| 1811 | fi |
---|
[12398] | 1812 | %if %{with systemd} |
---|
| 1813 | %systemd_postun_with_restart nscd.service |
---|
| 1814 | %else |
---|
[521] | 1815 | if [ "$1" -ge "1" ]; then |
---|
| 1816 | service nscd condrestart > /dev/null 2>&1 || : |
---|
| 1817 | fi |
---|
[12398] | 1818 | %endif |
---|
[521] | 1819 | |
---|
| 1820 | %if %{xenpackage} |
---|
| 1821 | %post xen -p /sbin/ldconfig |
---|
| 1822 | %postun xen -p /sbin/ldconfig |
---|
| 1823 | %endif |
---|
| 1824 | |
---|
| 1825 | %clean |
---|
| 1826 | rm -rf "$RPM_BUILD_ROOT" |
---|
| 1827 | rm -f *.filelist* |
---|
| 1828 | |
---|
[12020] | 1829 | %files -f glibc.filelist |
---|
[521] | 1830 | %defattr(-,root,root) |
---|
[12398] | 1831 | /sbin/ldconfig |
---|
[12020] | 1832 | /%{_lib}/libnsl.so.* |
---|
| 1833 | %dir %{_prefix}/%{_lib}/audit |
---|
[12398] | 1834 | %if %{with systemd} |
---|
| 1835 | %exclude /etc/localtime |
---|
| 1836 | %else |
---|
[521] | 1837 | %verify(not md5 size mtime) %config(noreplace) /etc/localtime |
---|
[12020] | 1838 | %endif |
---|
[521] | 1839 | %verify(not md5 size mtime) %config(noreplace) /etc/nsswitch.conf |
---|
| 1840 | %verify(not md5 size mtime) %config(noreplace) /etc/ld.so.conf |
---|
[5290] | 1841 | %verify(not md5 size mtime) %config(noreplace) /etc/rpc |
---|
[521] | 1842 | %dir /etc/ld.so.conf.d |
---|
| 1843 | %dir %{_prefix}/libexec/getconf |
---|
| 1844 | %dir %{_prefix}/%{_lib}/gconv |
---|
[12020] | 1845 | %dir %{_localstatedir}/db |
---|
| 1846 | %{_localstatedir}/db/Makefile |
---|
[521] | 1847 | %dir %attr(0700,root,root) /var/cache/ldconfig |
---|
| 1848 | %attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/cache/ldconfig/aux-cache |
---|
| 1849 | %attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/ld.so.cache |
---|
[5290] | 1850 | %attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/gai.conf |
---|
[12020] | 1851 | %doc rpm-old-changelog.txt |
---|
| 1852 | %doc README NEWS INSTALL elf/rtld-debugger-interface.txt |
---|
[12342] | 1853 | %license COPYING COPYING.LIB LICENSES |
---|
[521] | 1854 | |
---|
| 1855 | %if %{build_compat32} |
---|
[12398] | 1856 | %files -f compat32-glibc.filelist -n compat32-%{name} |
---|
[12020] | 1857 | /%{_lib}/libnsl.so.* |
---|
[521] | 1858 | %endif |
---|
| 1859 | |
---|
| 1860 | %ifnarch %{auxarches} |
---|
| 1861 | %files -f common.filelist common |
---|
| 1862 | %defattr(-,root,root) |
---|
[12020] | 1863 | %dir %{_datadir}/locale |
---|
[521] | 1864 | %dir %{_prefix}/lib/locale |
---|
[12020] | 1865 | %dir %{_prefix}/lib/locale/C.utf8 |
---|
| 1866 | %{_prefix}/lib/locale/C.utf8/* |
---|
[521] | 1867 | %attr(0644,root,root) %verify(not md5 size mtime) %{_prefix}/lib/locale/locale-archive-ja.tmpl |
---|
| 1868 | %attr(0644,root,root) %verify(not md5 size mtime) %{_prefix}/lib/locale/locale-archive.tmpl |
---|
| 1869 | %attr(0644,root,root) %verify(not md5 size mtime mode) %ghost %config(missingok,noreplace) %{_prefix}/lib/locale/locale-archive |
---|
[12020] | 1870 | %dir %{_prefix}/share/locale |
---|
| 1871 | %dir %{_prefix}/share/locale/ja |
---|
| 1872 | %doc documentation/README.timezone |
---|
| 1873 | %doc documentation/gai.conf |
---|
[521] | 1874 | |
---|
[12020] | 1875 | %files common-extra -f common-extra.filelist |
---|
[521] | 1876 | %defattr(-,root,root) |
---|
| 1877 | %attr(0644,root,root) %verify(not md5 size mtime) %{_prefix}/lib/locale/locale-archive-extra.tmpl |
---|
| 1878 | |
---|
[12020] | 1879 | %files locale-source |
---|
| 1880 | %defattr(-,root,root) |
---|
| 1881 | %dir %{_prefix}/share/i18n/locales |
---|
| 1882 | %{_prefix}/share/i18n/locales/* |
---|
| 1883 | %dir %{_prefix}/share/i18n/charmaps |
---|
| 1884 | %{_prefix}/share/i18n/charmaps/* |
---|
| 1885 | |
---|
[521] | 1886 | %files -f devel.filelist devel |
---|
| 1887 | %defattr(-,root,root) |
---|
| 1888 | |
---|
[3081] | 1889 | %files -f static.filelist static |
---|
| 1890 | %defattr(-,root,root) |
---|
| 1891 | |
---|
[521] | 1892 | %if %{build_compat32} |
---|
| 1893 | %files -f devel.filelist -n compat32-%{name}-devel |
---|
| 1894 | %defattr(-,root,root) |
---|
| 1895 | %exclude %{_prefix}/share |
---|
| 1896 | |
---|
[3081] | 1897 | %files -f static.filelist -n compat32-%{name}-static |
---|
[521] | 1898 | %defattr(-,root,root) |
---|
[3081] | 1899 | %endif |
---|
[521] | 1900 | |
---|
| 1901 | %files -f headers.filelist headers |
---|
| 1902 | %defattr(-,root,root) |
---|
| 1903 | |
---|
| 1904 | %files -f utils.filelist utils |
---|
| 1905 | %defattr(-,root,root) |
---|
| 1906 | |
---|
| 1907 | %files -f nscd.filelist -n nscd |
---|
| 1908 | %defattr(-,root,root) |
---|
| 1909 | %config(noreplace) /etc/nscd.conf |
---|
[12398] | 1910 | %if %{with systemd} |
---|
| 1911 | %{_unitdir}/* |
---|
| 1912 | %{_tmpfilesdir}/* |
---|
| 1913 | %else |
---|
[521] | 1914 | %config /etc/rc.d/init.d/nscd |
---|
[12020] | 1915 | %endif |
---|
[521] | 1916 | %dir %attr(0755,root,root) /var/run/nscd |
---|
| 1917 | %dir %attr(0755,root,root) /var/db/nscd |
---|
| 1918 | %attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/nscd.pid |
---|
| 1919 | %attr(0666,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/socket |
---|
| 1920 | %attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/passwd |
---|
| 1921 | %attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/group |
---|
| 1922 | %attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/hosts |
---|
| 1923 | %attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/services |
---|
| 1924 | %attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/db/nscd/passwd |
---|
| 1925 | %attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/db/nscd/group |
---|
| 1926 | %attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/db/nscd/hosts |
---|
| 1927 | %attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/db/nscd/services |
---|
| 1928 | %ghost %config(missingok,noreplace) /etc/sysconfig/nscd |
---|
| 1929 | %endif |
---|
| 1930 | |
---|
| 1931 | %if 0%{?_enable_debug_packages} |
---|
| 1932 | %files debuginfo -f debuginfo.filelist |
---|
| 1933 | %defattr(-,root,root) |
---|
| 1934 | %ifarch %{debuginfocommonarches} |
---|
| 1935 | %ifnarch %{auxarches} |
---|
| 1936 | %files debuginfo-common -f debuginfocommon.filelist |
---|
| 1937 | %defattr(-,root,root) |
---|
| 1938 | %endif |
---|
| 1939 | %endif |
---|
| 1940 | %endif |
---|
| 1941 | |
---|
| 1942 | %changelog |
---|
[12525] | 1943 | * Tue Feb 09 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.33-1 |
---|
| 1944 | - updated to 2.33. |
---|
| 1945 | - updated Patch0. |
---|
| 1946 | - dropped Patch1, 5, 7 and 14. |
---|
| 1947 | - updated Source11. |
---|
| 1948 | - updated Source1. |
---|
| 1949 | |
---|
[12398] | 1950 | * Sat May 09 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.31-2 |
---|
| 1951 | - updated Patch0. |
---|
| 1952 | - added systemd support (disabled as default). |
---|
| 1953 | - dropped /sbin/ldconfig from compat32. |
---|
| 1954 | |
---|
[12342] | 1955 | * Thu Mar 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.31-1 |
---|
| 1956 | - updated to 2.31. |
---|
| 1957 | - updated Patch0. |
---|
| 1958 | - dropped Patch28. |
---|
| 1959 | - imported Patch29 from rawhide. |
---|
| 1960 | - updated Patch5 and 23. |
---|
| 1961 | - updated Source11. |
---|
| 1962 | |
---|
[12225] | 1963 | * Sun Sep 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.30-1 |
---|
| 1964 | - updated to 2.30. |
---|
| 1965 | - updated Patch0. |
---|
| 1966 | - dropped Patch11, 24 and 25. |
---|
| 1967 | |
---|
[12020] | 1968 | * Sun Jan 20 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.28-1 |
---|
| 1969 | - updated to 2.28. |
---|
| 1970 | - dropped Source2, 3, 10 and 11. |
---|
| 1971 | - imported Source8-11 from rawhide. |
---|
| 1972 | - dropped Patch11-13. |
---|
| 1973 | - imported Patch1-28 from rawhide. |
---|
| 1974 | - dropped Patch10000. |
---|
| 1975 | - trimmed %%changelog: old logs are rpm-old-changelog.txt. |
---|
| 1976 | |
---|
[11690] | 1977 | * Tue Jun 20 2017 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 2.23-5 |
---|
| 1978 | - add patch20005 for fix CVE-2017-1000366 |
---|
| 1979 | |
---|
[10738] | 1980 | * Mon Aug 1 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.23-4 |
---|
| 1981 | - added Patch20000-20004 to fix vulnerabilities. |
---|
| 1982 | - CVE-2016-1234 |
---|
| 1983 | - CVE-2016-3075 |
---|
| 1984 | - CVE-2016-3706 |
---|
| 1985 | - CVE-2016-4429 |
---|
| 1986 | |
---|
[10405] | 1987 | * Sun Jun 26 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.23-3 |
---|
| 1988 | - rebuilt with gcc-5.4.0 |
---|
| 1989 | |
---|
[10331] | 1990 | * Tue May 24 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.23-2 |
---|
| 1991 | - rebuilt with new binutils. |
---|
| 1992 | |
---|
[10250] | 1993 | * Sat May 07 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.23-1 |
---|
| 1994 | - update to 2.23 |
---|
| 1995 | - remove Patch14-18 |
---|
| 1996 | - update SOURCE1 from fedora |
---|