glibc-vl.spec 63 KB

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