recipe 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # Build recipe for coreutils.
  2. #
  3. # Copyright (c) 2016-2020 Matias Fonzo, <selk@dragora.org>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. # Exit immediately on any error
  17. set -e
  18. program=coreutils
  19. version=8.32
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=tools
  23. tarname=${program}-${version}.tar.gz
  24. # Remote source(s)
  25. fetch=https://ftpmirror.gnu.org/coreutils/$tarname
  26. description="
  27. The GNU core utilities.
  28. The GNU core utilities are the basic file, shell and text manipulation
  29. utilities of the GNU operating system. These are the core utilities
  30. which are expected to exist on every operating system.
  31. "
  32. homepage=https://www.gnu.org/software/coreutils
  33. license=GPLv3+
  34. # Source documentation
  35. docs="AUTHORS COPYING ChangeLog NEWS README THANKS THANKS-to-translators TODO"
  36. docsdir="${docdir}/${program}"
  37. # Limit package name to the program name
  38. full_pkgname=$program
  39. build()
  40. {
  41. unpack "${tardir}/$tarname"
  42. cd "$srcdir"
  43. # Set sane permissions
  44. chmod -R u+w,go-w,a+rX-s .
  45. ./configure FORCE_UNSAFE_CONFIGURE="1" DEFAULT_POSIX2_VERSION="199209" \
  46. CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
  47. $configure_args \
  48. --libdir=/usr/lib${libSuffix} \
  49. --infodir=$infodir \
  50. --mandir=$mandir \
  51. --docdir=$docsdir \
  52. --enable-install-program=arch \
  53. --enable-no-install-program=kill,uptime,hostname \
  54. --with-tty-group=tty \
  55. --without-gmp \
  56. --build="$(gcc -dumpmachine)"
  57. make -j${jobs} V=1
  58. make -j${jobs} DESTDIR="$destdir" install
  59. # Create link to "ginstall", since many sources relies on it
  60. ( cd "${destdir}/usr/bin" && ln -sf install ginstall )
  61. # Remove generated charset.alias
  62. rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
  63. rmdir "${destdir}/usr/lib${libSuffix}" || true
  64. # Add "DIR_COLORS" file
  65. mkdir -p "${destdir}/etc/profile.d"
  66. cat src/dircolors.hin > "${destdir}/etc/DIR_COLORS"
  67. # Include our custom dircolors file for profile.d
  68. cat "${worktree}/archive/coreutils/etc/profile.d/dircolors.sh" \
  69. > "${destdir}/etc/profile.d/dircolors.sh"
  70. # To handle config file(s)
  71. touch "${destdir}/etc/profile.d/.graft-config" \
  72. "${destdir}/etc/.graft-config"
  73. # Compress info documents deleting index file for the package
  74. if test -d "${destdir}/$infodir"
  75. then
  76. rm -f "${destdir}/${infodir}/dir"
  77. lzip -9 "${destdir}/${infodir}"/*
  78. fi
  79. # Compress and link man pages (if needed)
  80. if test -d "${destdir}/$mandir"
  81. then
  82. (
  83. cd "${destdir}/$mandir"
  84. find . -type f -exec lzip -9 {} +
  85. find . -type l | while read -r file
  86. do
  87. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  88. rm -- "$file"
  89. done
  90. )
  91. fi
  92. # Copy documentation
  93. mkdir -p "${destdir}${docsdir}"
  94. cp -p $docs "${destdir}${docsdir}"
  95. }