glibc-vl.spec 64 KB

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