glibc-vl.spec 64 KB

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