glibc-vl.spec 64 KB

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