recipe 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # Build recipe for xfsprogs.
  2. #
  3. # Copyright (c) 2019 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=xfsprogs
  17. version=5.2.1
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/tools"
  21. tarname=${program}-${version}.tar.gz
  22. # Remote source(s)
  23. fetch=http://mirrors.edge.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/$tarname
  24. description="
  25. A high-performance journaling filesystem.
  26. XFS combines advanced journaling technology with full 64-bit addressing
  27. and scalable structures and algorithms. This combination delivers the
  28. most scalable high-performance filesystem ever conceived.
  29. "
  30. homepage=http://xfs.org
  31. license="GPLv2+, LGPLv2.1"
  32. # Source documentation
  33. docs="README VERSION LICENSES/*"
  34. docsdir="${docdir}/${program}-${version}"
  35. build()
  36. {
  37. set -e
  38. unpack "${tardir}/$tarname"
  39. cd "$srcdir"
  40. # Apply patches against Musl (Thanks to "Alpine Linux")
  41. for file in "${worktree}"/patches/xfsprogs/*.patch
  42. do
  43. patch -Np1 -i "$file"
  44. done
  45. unset file
  46. # Set sane permissions
  47. chmod -R u+w,go-w,a+rX-s .
  48. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  49. OPTIMIZER="$QICFLAGS" DEBUG="-DNDEBUG" \
  50. $configure_args \
  51. --libdir=/usr/lib${libSuffix} \
  52. --libexecdir=/usr/libexec/xfsprogs \
  53. --mandir=$mandir \
  54. --docdir=$docsdir \
  55. --enable-static=yes \
  56. --enable-shared=yes \
  57. --enable-blkid=yes \
  58. --enable-gettext=yes \
  59. --enable-readline=yes \
  60. --enable-lto=no \
  61. --build="$(cc -dumpmachine)"
  62. make -j${jobs} V=1
  63. make -j${jobs} V=1 \
  64. DIST_ROOT="$destdir" \
  65. PKG_ROOT_SBIN_DIR="/usr/sbin" \
  66. PKG_ROOT_LIB_DIR="/usr/lib${libSuffix}" \
  67. install install-dev
  68. # Remove cron job for the experimental xfs_scrub utility
  69. rm -f "${destdir}/usr/lib${libSuffix}/xfsprogs/xfs_scrub_all.cron"
  70. rmdir "${destdir}/usr/lib${libSuffix}/xfsprogs"
  71. # Compress and link man pages (if needed)
  72. if test -d "${destdir}/$mandir"
  73. then
  74. (
  75. cd "${destdir}/$mandir"
  76. find . -type f -exec lzip -9 '{}' +
  77. find . -type l | while read -r file
  78. do
  79. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  80. rm -- "$file"
  81. done
  82. )
  83. fi
  84. # Copy documentation
  85. # Remove non-versioned location
  86. rm -rf "${destdir}/usr/share/doc/xfsprogs"
  87. mkdir -p "${destdir}${docsdir}"
  88. cp -p $docs "${destdir}${docsdir}/"
  89. }