recipe 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. # Build recipe for grub.
  2. #
  3. # Copyright (c) 2017-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. program=grub
  17. version=2.04
  18. release=3
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/boot"
  21. tarname=${program}-${version}.tar.gz
  22. # Remote source(s)
  23. fetch=http://ftp.gnu.org/gnu/grub/$tarname
  24. description="
  25. A multiboot boot loader.
  26. GNU GRUB is a Multiboot boot loader. It was derived from GRUB,
  27. the GRand Unified Bootloader, which was originally designed and
  28. implemented by Erich Stefan Boleyn.
  29. "
  30. homepage=http://www.gnu.org/software/grub
  31. license=GPLv3+
  32. # Source documentation
  33. docs="AUTHORS BUGS COPYING NEWS README THANKS TODO"
  34. docsdir="${docdir}/${program}-${pkgversion}"
  35. build()
  36. {
  37. set -e
  38. unpack "${tardir}/$tarname"
  39. cd "$srcdir"
  40. # Set sane permissions
  41. chmod -R u+w,go-w,a+rX-s .
  42. ./configure \
  43. $configure_args \
  44. --libdir=/usr/lib${libSuffix} \
  45. --infodir=$infodir \
  46. --mandir=$mandir \
  47. --docdir=$docsdir \
  48. --enable-device-mapper \
  49. --enable-grub-mount \
  50. --disable-grub-mkfont \
  51. --disable-werror \
  52. --disable-liblzma \
  53. --disable-efiemu \
  54. --build="$(cc -dumpmachine)"
  55. make -j${jobs} V=1
  56. make -j${jobs} DESTDIR="$destdir" \
  57. bashcompletiondir=/usr/share/bash-completion/completions \
  58. install-strip
  59. # Remove generated charset.alias
  60. rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
  61. # Make required directories
  62. mkdir -p "${destdir}/boot/grub/" "${destdir}/etc/default"
  63. # Insert file for default settings
  64. cp -p "${worktree}/archive/grub/etc/default/grub" "${destdir}/etc/default/"
  65. chmod 644 "${destdir}/etc/default/grub"
  66. # Manage config (.new) file(s)
  67. touch "${destdir}/etc/default/.graft-config" \
  68. "${destdir}/etc/grub.d/.graft-config" \
  69. "${destdir}/usr/share/bash-completion/completions/.graft-config"
  70. # Compress info documents deleting index file for the package
  71. if test -d "${destdir}/$infodir"
  72. then
  73. rm -f "${destdir}/${infodir}/dir"
  74. lzip -9 "${destdir}/${infodir}"/*
  75. fi
  76. # Compress and link man pages (if needed)
  77. if test -d "${destdir}/$mandir"
  78. then
  79. (
  80. cd "${destdir}/$mandir"
  81. find . -type f -exec lzip -9 '{}' +
  82. find . -type l | while read -r file
  83. do
  84. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  85. rm -- "$file"
  86. done
  87. )
  88. fi
  89. # Copy documentation
  90. mkdir -p "${destdir}${docsdir}"
  91. cp -p $docs "${destdir}${docsdir}"
  92. }