glibc-vl.spec 70 KB

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