glibc-vl.spec 65 KB

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