recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / tools / xfsprogs / recipe
blob8a6cd40894be3ed18e380ed720d3b5bb73e6a59a
1 # Build recipe for xfsprogs.
3 # Copyright (c) 2019-2022 Matias Fonzo, <selk@dragora.org>.
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
9 #    http://www.apache.org/licenses/LICENSE-2.0
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.
17 # Exit immediately on any error
18 set -e
20 program=xfsprogs
21 version=5.14.2
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=tools
27 tarname=${program}-${version}.tar.gz
29 # Remote source(s)
30 fetch=https://mirrors.edge.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/$tarname
32 description="
33 A high-performance journaling filesystem.
35 XFS combines advanced journaling technology with full 64-bit addressing
36 and scalable structures and algorithms.  This combination delivers the
37 most scalable high-performance filesystem ever conceived.
40 homepage=https://xfs.org
41 license="GPLv2+, LGPLv2.1"
43 # Source documentation
44 docs="README VERSION LICENSES/*"
45 docsdir="${docdir}/${program}-${version}"
47 # Limit parallel jobs for this build
48 jobs=1
50 build()
52     unpack "${tardir}/$tarname"
54     cd "$srcdir"
56     # Set sane permissions
57     chmod -R u+w,go-w,a+rX-s .
59     ./configure LDFLAGS="$QILDFLAGS" \
60     OPTIMIZER="$QICFLAGS -O3" DEBUG="-DNDEBUG" \
61      $configure_args \
62      --libdir=/usr/lib${libSuffix} \
63      --libexecdir=/usr/libexec/xfsprogs \
64      --mandir=$mandir \
65      --docdir=$docsdir \
66      --enable-static=yes \
67      --enable-shared=yes \
68      --enable-blkid=yes \
69      --enable-gettext=yes \
70      --enable-libicu=yes \
71      --enable-lto=yes \
72      --build="$(gcc -dumpmachine)"
74     make -j${jobs} V=1
76     make -j${jobs} V=1 \
77      DIST_ROOT="$destdir" \
78      PKG_ROOT_SBIN_DIR="/usr/sbin" \
79      PKG_ROOT_LIB_DIR="/usr/lib${libSuffix}" \
80      install install-dev
82     # Remove cron job for the experimental xfs_scrub utility
83     rm -f "${destdir}/usr/lib${libSuffix}/xfsprogs/xfs_scrub_all.cron"
84     rmdir "${destdir}/usr/lib${libSuffix}/xfsprogs"
86     # Compress and link man pages (if needed)
87     if test -d "${destdir}/$mandir"
88     then
89         (
90             cd "${destdir}/$mandir"
91             find . -type f -exec lzip -9 {} +
92             find . -type l | while read -r file
93             do
94                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
95                 rm -- "$file"
96             done
97         )
98     fi
100     # Copy documentation
102     # Remove non-versioned location
103     rm -rf "${destdir}/usr/share/doc/xfsprogs"
105     mkdir -p "${destdir}/$docsdir"
106     cp -p $docs "${destdir}/$docsdir"