glibc-vl.spec 70 KB

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