glibc-vl.spec 70 KB

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