recipe 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # Recipe file for efivar.
  2. #
  3. # Copyright (c) 2022 DustDFG, <dfgdust@gmail.com>.
  4. # Copyright (c) 2022 Matias Fonzo, <selk@dragora.org>.
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License");
  7. # you may not use this file except in compliance with the License.
  8. # You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. # Exit immediately on any error
  18. set -e
  19. program=efivar
  20. version=20220418_6be2cb1
  21. release=4
  22. # Define a category for the output of the package name
  23. pkgcategory=boot
  24. description="
  25. Tools and libraries to work with EFI variables.
  26. The efivar package provides a simple command-line interface to
  27. the UEFI variable facility.
  28. "
  29. homepage=https://github.com/rhboot/efivar/
  30. license=LGPLv2.1+
  31. tarname=${program}-${version}.tar.lz
  32. # Remote source(s)
  33. #fetch=https://github.com/rhboot/efivar/releases/download/${version}/$tarname
  34. fetch="
  35. https://dragora.mirror.garr.it/current/sources/$tarname
  36. rsync://rsync.dragora.org/current/sources/$tarname
  37. "
  38. # Source documentation
  39. docs="COPYING TODO README.md"
  40. docsdir="${docdir}/${program}-${version}"
  41. build() {
  42. unpack "${tardir}/$tarname"
  43. cd "$srcdir"
  44. # Set sane permissions
  45. chmod -R u+w,go-w,a+rX-s .
  46. # Apply patches
  47. # patch -Np1 -i "${worktree}/patches/efivar/efivar-efisecdb-atexit.patch"
  48. patch -Np1 -i "${worktree}/patches/efivar/efivar-mandoc-groff.patch"
  49. make -j${jobs} V=1 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" LIBDIR="/usr/lib${libSuffix}" MANDIR="$mandir"
  50. make -j${jobs} DESTDIR="$destdir" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" LIBDIR="/usr/lib${libSuffix}" MANDIR="$mandir" install
  51. # Compress and link man pages (if needed)
  52. if test -d "${destdir}/$mandir"
  53. then
  54. (
  55. cd "${destdir}/$mandir"
  56. find . -type f -exec lzip -9 {} +
  57. find . -type l | while read -r file
  58. do
  59. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  60. rm -- "$file"
  61. done
  62. )
  63. fi
  64. # Copy documentation
  65. mkdir -p "${destdir}/$docsdir"
  66. cp -p $docs "${destdir}/$docsdir"
  67. }