glibc-vl.spec 69 KB

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