recipe 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Build recipe for gptfdisk.
  2. #
  3. # Copyright (c) 2022 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=gptfdisk
  19. version=1.0.9
  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://sourceforge.net/projects/gptfdisk/files/gptfdisk/${version}/$tarname
  26. description="
  27. GPT partitioning and MBR repair software.
  28. GPT fdisk is a disk partitioning tool loosely modeled on Linux fdisk,
  29. but used for modifying GUID Partition Table (GPT) disks. The related
  30. FixParts utility fixes some common problems on Master Boot Record (MBR)
  31. disks.
  32. "
  33. homepage=https://www.rodsbooks.com/gdisk/
  34. license=GPLv2+
  35. # Source documentation
  36. docs="COPYING NEWS README"
  37. docsdir="${docdir}/${program}-${version}"
  38. build()
  39. {
  40. unpack "${tardir}/$tarname"
  41. cd "$srcdir"
  42. patch -Np1 -i "${worktree}/patches/gptfdisk/util-linux-2.38.patch"
  43. # This patch modifies the Makefile file
  44. # so that it provides an install target.
  45. # Thanks to "Beyond Linux From Scratch"
  46. patch -Np1 -i \
  47. "${worktree}/patches/gptfdisk/gptfdisk-1.0.9-convenience-1.patch"
  48. # Build with ICU support
  49. patch -Np1 -i "${worktree}/patches/gptfdisk/Makefile-ICU.diff"
  50. # Set sane permissions
  51. chmod -R u+w,go-w,a+rX-s .
  52. sed -i 's|ncursesw/||' gptcurses.cc
  53. sed -i 's|sbin|usr/sbin|' Makefile
  54. make -j${jobs} V=1 CPPFLAGS="$QICPPFLAGS" \
  55. CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS"
  56. make -j${jobs} DESTDIR="$destdir" install
  57. # Compress and link man pages (if needed)
  58. if test -d "${destdir}/$mandir"
  59. then
  60. (
  61. cd "${destdir}/$mandir"
  62. find . -type f -exec lzip -9 {} +
  63. find . -type l | while read -r file
  64. do
  65. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  66. rm -- "$file"
  67. done
  68. )
  69. fi
  70. # Copy documentation
  71. mkdir -p "${destdir}/$docsdir"
  72. cp -p $docs "${destdir}/$docsdir"
  73. }