recipes: tools/*: Tune up file system utilities
[dragora.git] / recipes / tools / xfsprogs / recipe
blob78001335e36a049aa1f045b4712625aa462ff77c
1 # Build recipe for xfsprogs.
3 # Copyright (c) 2019-2020 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 program=xfsprogs
18 version=5.8.0
19 release=2
21 # Define a category for the output of the package name
22 pkgcategory=tools
24 tarname=${program}-${version}.tar.gz
26 # Remote source(s)
27 fetch=http://mirrors.edge.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/$tarname
29 description="
30 A high-performance journaling filesystem.
32 XFS combines advanced journaling technology with full 64-bit addressing
33 and scalable structures and algorithms.  This combination delivers the
34 most scalable high-performance filesystem ever conceived.
37 homepage=http://xfs.org
38 license="GPLv2+, LGPLv2.1"
40 # Source documentation
41 docs="README VERSION LICENSES/*"
42 docsdir="${docdir}/${program}-${version}"
44 # Limit parallel jobs for this build
45 jobs=1
47 build()
49     set -e
51     unpack "${tardir}/$tarname"
53     cd "$srcdir"
55     # Set sane permissions
56     chmod -R u+w,go-w,a+rX-s .
58     ./configure LDFLAGS="$QILDFLAGS" \
59     OPTIMIZER="$QICFLAGS -O3" DEBUG="-DNDEBUG" \
60      $configure_args \
61      --libdir=/usr/lib${libSuffix} \
62      --libexecdir=/usr/libexec/xfsprogs \
63      --mandir=$mandir \
64      --docdir=$docsdir \
65      --enable-static=yes \
66      --enable-shared=yes \
67      --enable-blkid=yes \
68      --enable-gettext=yes \
69      --enable-libicu=yes \
70      --enable-lto=yes \
71      --build="$(gcc -dumpmachine)"
73     make -j${jobs} V=1
75     make -j${jobs} V=1 \
76      DIST_ROOT="$destdir" \
77      PKG_ROOT_SBIN_DIR="/usr/sbin" \
78      PKG_ROOT_LIB_DIR="/usr/lib${libSuffix}" \
79      install install-dev
81     # Remove cron job for the experimental xfs_scrub utility
82     rm -f "${destdir}/usr/lib${libSuffix}/xfsprogs/xfs_scrub_all.cron"
83     rmdir "${destdir}/usr/lib${libSuffix}/xfsprogs"
85     # Compress and link man pages (if needed)
86     if test -d "${destdir}/$mandir"
87     then
88         (
89             cd "${destdir}/$mandir"
90             find . -type f -exec lzip -9 '{}' +
91             find . -type l | while read -r file
92             do
93                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
94                 rm -- "$file"
95             done
96         )
97     fi
99     # Copy documentation
101     # Remove non-versioned location
102     rm -rf "${destdir}/usr/share/doc/xfsprogs"
104     mkdir -p "${destdir}${docsdir}"
105     cp -p $docs "${destdir}${docsdir}/"