This repo contains software to build linux from scratch and package it into rpm files.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

168 lines
6.0 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. # %%global _default_patch_fuzz 2
  2. %define GCC_INCDIR GCC_INCDIR=/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/include
  3. #TARBALL: http://ftp.gnu.org/gnu/glibc/glibc-2.31.tar.xz
  4. #MD5SUM: 78a720f17412f3c3282be5a6f3363ec6;SOURCES/glibc-2.31.tar.xz
  5. #TARBALL: http://www.linuxfromscratch.org/patches/lfs/9.1/glibc-2.29-fhs-1.patch
  6. #MD5SUM: 9a5997c3452909b1769918c759eff8a2;SOURCES/glibc-2.31-fhs-1.patch
  7. #-----------------------------------------------------------------------------
  8. Summary: Main C library
  9. Name: glibc
  10. Version: 2.31
  11. Release: 1
  12. License: GPLv2
  13. URL: http://www.gnu.org/software/libc
  14. Group: LFS/Base
  15. Source0: http://ftp.gnu.org/gnu/glibc/%{name}-%{version}.tar.xz
  16. Source1: locale-gen
  17. Patch0: glibc-%{version}-fhs-1.patch
  18. Requires: filesystem
  19. %description
  20. This library provides the basic routines for allocating memory,
  21. searching directories, opening and closing files, reading and
  22. writing files, string handling, pattern matching, arithmetic,
  23. and so on.
  24. #-----------------------------------------------------------------------------
  25. %prep
  26. %setup -q _T -b 0 -n %{NAME}-%{VERSION}
  27. %patch0 -p1
  28. mkdir -v build
  29. %build
  30. cd build
  31. CC="gcc -ffile-prefix-map=/tools=/usr" \
  32. ../configure --prefix=%{_prefix} \
  33. --disable-werror \
  34. --enable-kernel=3.2 \
  35. --enable-stack-protector=strong \
  36. --with-headers=/usr/include \
  37. libc_cv_slibdir=/lib
  38. make PARALLELMFLAGS=" %{_smp_mflags} "
  39. # make %{_smp_mflags}
  40. %install
  41. cd build
  42. # touch /etc/ld.so.conf - already installed by filesystem
  43. # sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile - not needed
  44. make install_root=%{buildroot} install
  45. # add symlinks
  46. install -vdm 755 %{buildroot}/lib64
  47. ln -sfv ../lib/ld-linux-x86-64.so.2 %{buildroot}/lib64
  48. ln -sfv ../lib/ld-linux-x86-64.so.2 %{buildroot}/lib64/ld-lsb-x86-64.so.3
  49. # Create directories
  50. install -vdm 755 %{buildroot}/etc
  51. install -vdm 755 %{buildroot}/sbin
  52. # Install the configuration file and runtime directory for nscd:
  53. install -vDm 644 ../nscd/nscd.conf %{buildroot}/etc/nscd.conf
  54. install -vdm 755 %{buildroot}/var/cache/nscd
  55. cd -
  56. #-----------------------------------------------------------------------------
  57. # 6.9.2.1. Adding nsswitch.conf
  58. #-----------------------------------------------------------------------------
  59. cat > %{buildroot}/etc/nsswitch.conf <<- EOF
  60. # Begin /etc/nsswitch.conf
  61. passwd: files
  62. group: files
  63. shadow: files
  64. hosts: files dns
  65. networks: files
  66. protocols: files
  67. services: files
  68. ethers: files
  69. rpc: files
  70. # End /etc/nsswitch.conf
  71. EOF
  72. #-----------------------------------------------------------------------------
  73. # 6.9.2.3. Configuring the Dynamic Loader
  74. #-----------------------------------------------------------------------------
  75. cat > %{buildroot}/etc/ld.so.conf <<- EOF
  76. # Begin /etc/ld.so.conf
  77. /usr/local/lib
  78. /opt/lib
  79. # Add an include directory
  80. include /etc/ld.so.conf.d/*.conf
  81. EOF
  82. #-----------------------------------------------------------------------------
  83. # Install locale generation script and config file
  84. #-----------------------------------------------------------------------------
  85. install -vdm 755 %{buildroot}/sbin
  86. install -vdm 755 %{buildroot}/usr/lib/locale
  87. cp %{SOURCE1} %{buildroot}/sbin/locale-gen
  88. chmod 755 %{buildroot}/sbin/locale-gen
  89. cat > %{buildroot}/etc/locale-gen.conf << EOF
  90. # Configuration file for locale-gen
  91. #
  92. # lists of locales that are to be generated by the locale-gen command.
  93. #
  94. # Each line is of the form:
  95. #
  96. # #<inputfile> <charmap> <outputpath>
  97. #
  98. # where <inputfile> is one of the locales given in /usr/share/i18n/locales
  99. # and <charmap> is one of the character sets listed in /usr/share/i18n/charmaps
  100. # and <outputpath> is tyhe name of the resulting locale
  101. #
  102. # The locale-gen command will generate all the locales,
  103. # placing them in /usr/lib/locale.
  104. #
  105. # A list of supported locales is included in this file.
  106. #
  107. # localedef -i POSIX -f UTF-8 C.UTF-8 2> /dev/null || true
  108. # localedef [-f charmapfile] [-i inputfile] [--force] [--verbose] [--posix] [--quiet] outputpath
  109. #
  110. # Each line is of the form:
  111. #<inputfile> <charmap> <outputpath>
  112. POSIX UTF-8 C.UTF-8
  113. cs_CZ UTF-8 cs_CZ.UTF-8
  114. de_DE ISO-8859-1 de_DE
  115. de_DE@euro ISO-8859-15 de_DE@euro
  116. de_DE UTF-8 de_DE.UTF-8
  117. el_GR ISO-8859-7 el_GR
  118. en_GB UTF-8 en_GB.UTF-8
  119. en_HK ISO-8859-1 en_HK
  120. en_PH ISO-8859-1 en_PH
  121. en_US ISO-8859-1 en_US
  122. en_US UTF-8 en_US.UTF-8
  123. es_MX ISO-8859-1 es_MX
  124. fa_IR UTF-8 fa_IR
  125. fr_FR ISO-8859-1 fr_FR
  126. fr_FR@euro ISO-8859-15 fr_FR@euro
  127. fr_FR UTF-8 fr_FR.UTF-8
  128. it_IT ISO-8859-1 it_IT
  129. it_IT UTF-8 it_IT.UTF-8
  130. ja_JP EUC-JP ja_JP
  131. ja_JP SHIFT_JIS ja_JP.SIJS
  132. ja_JP UTF-8 ja_JP.UTF-8
  133. ru_RU KOI8-R ru_RU.KOI8-R
  134. ru_RU UTF-8 ru_RU.UTF-8
  135. tr_TR UTF-8 tr_TR.UTF-8
  136. zh_CN GB18030 zh_CN.GB18030
  137. zh_HK BIG5-HKSCS zh_HK.BIG5-HKSCS
  138. EOF
  139. #-----------------------------------------------------------------------------
  140. # Copy license/copying file
  141. install -D -m644 LICENSES %{buildroot}/usr/share/licenses/%{name}/LICENSE
  142. #-----------------------------------------------------------------------------
  143. # Create file list
  144. rm %{buildroot}%{_infodir}/dir
  145. find %{buildroot} -name '*.la' -delete
  146. find "${RPM_BUILD_ROOT}" -not -type d -print > filelist.list
  147. sed -i "s|^${RPM_BUILD_ROOT}||" filelist.list
  148. sed -i '/man\/man/d' filelist.list
  149. sed -i '/\/usr\/share\/info/d' filelist.list
  150. #-----------------------------------------------------------------------------
  151. %files -f filelist.list
  152. %defattr(-,root,root)
  153. %{_infodir}/libc.*
  154. #-----------------------------------------------------------------------------
  155. %changelog
  156. * Sun May 31 2020 Chris Cromer <chris@cromer.cl> 2.31-1
  157. * Fri Mar 15 2019 baho-utot <baho-utot@columbus.rr.com> 2.29-1
  158. * Mon Mar 19 2018 baho-utot <baho-utot@columbus.rr.com> 2.27-1
  159. * Wed Dec 20 2017 baho-utot <baho-utot@columbus.rr.com> 2.26-1
  160. * Sat Mar 22 2014 baho-utot <baho-utot@columbus.rr.com> 2.19-1
  161. * Sun Sep 01 2013 baho-utot <baho-utot@columbus.rr.com> 2.18-2
  162. * Sat Aug 24 2013 baho-utot <baho-utot@columbus.rr.com> 2.18-1
  163. * Sun Mar 24 2013 baho-utot <baho-utot@columbus.rr.com> 2.17-1
  164. * Wed Jan 30 2013 baho-utot <baho-utot@columbus.rr.com> 2.16-1
  165. - Initial version