glibc-vl.spec 64 KB

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