glibc-vl.spec 63 KB

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