glibc-vl.spec 63 KB

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