glibc-vl.spec 65 KB

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