recipe 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Build recipe for xfsprogs.
  2. #
  3. # Copyright (c) 2019-2021 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=xfsprogs
  19. version=5.9.0
  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://mirrors.edge.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/$tarname
  26. description="
  27. A high-performance journaling filesystem.
  28. XFS combines advanced journaling technology with full 64-bit addressing
  29. and scalable structures and algorithms. This combination delivers the
  30. most scalable high-performance filesystem ever conceived.
  31. "
  32. homepage=https://xfs.org
  33. license="GPLv2+, LGPLv2.1"
  34. # Source documentation
  35. docs="README VERSION LICENSES/*"
  36. docsdir="${docdir}/${program}-${version}"
  37. # Limit parallel jobs for this build
  38. jobs=1
  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 LDFLAGS="$QILDFLAGS" \
  46. OPTIMIZER="$QICFLAGS -O3" DEBUG="-DNDEBUG" \
  47. $configure_args \
  48. --libdir=/usr/lib${libSuffix} \
  49. --libexecdir=/usr/libexec/xfsprogs \
  50. --mandir=$mandir \
  51. --docdir=$docsdir \
  52. --enable-static=yes \
  53. --enable-shared=yes \
  54. --enable-blkid=yes \
  55. --enable-gettext=yes \
  56. --enable-libicu=yes \
  57. --enable-lto=yes \
  58. --build="$(gcc -dumpmachine)"
  59. make -j${jobs} V=1
  60. make -j${jobs} V=1 \
  61. DIST_ROOT="$destdir" \
  62. PKG_ROOT_SBIN_DIR="/usr/sbin" \
  63. PKG_ROOT_LIB_DIR="/usr/lib${libSuffix}" \
  64. install install-dev
  65. # Remove cron job for the experimental xfs_scrub utility
  66. rm -f "${destdir}/usr/lib${libSuffix}/xfsprogs/xfs_scrub_all.cron"
  67. rmdir "${destdir}/usr/lib${libSuffix}/xfsprogs"
  68. # Compress and link man pages (if needed)
  69. if test -d "${destdir}/$mandir"
  70. then
  71. (
  72. cd "${destdir}/$mandir"
  73. find . -type f -exec lzip -9 {} +
  74. find . -type l | while read -r file
  75. do
  76. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  77. rm -- "$file"
  78. done
  79. )
  80. fi
  81. # Copy documentation
  82. # Remove non-versioned location
  83. rm -rf "${destdir}/usr/share/doc/xfsprogs"
  84. mkdir -p "${destdir}${docsdir}"
  85. cp -p $docs "${destdir}${docsdir}/"
  86. }