recipes: tools/*: Tune up file system utilities
[dragora.git] / recipes / tools / jfsutils / recipe
blobc18c8c0f172f027c0ca31d405c5149ce0e6e7513
1 # Build recipe for jfsutils.
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=jfsutils
18 version=1.1.15
19 release=3
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://jfs.sourceforge.net/project/pub/$tarname
29 description="
30 A Journaled File System developed by IBM.
32 IBM's journaled file system technology, currently used in IBM enterprise
33 servers, is designed for high-throughput server environments, key to
34 running intranet and other high-performance e-business file servers.
37 homepage=http://jfs.sourceforge.net
38 license=GPLv3+
40 # Source documentation
41 docs="AUTHORS COPYING ChangeLog NEWS README"
42 docsdir="${docdir}/${program}-${version}"
44 build()
46     set -e
48     unpack "${tardir}/$tarname"
50     cd "$srcdir"
52     # Apply patches against Musl
53     # Thanks to "Debian GNU/Linux", and thanks to "Alpine Linux"
54     for file in "${worktree}"/patches/jfsutils/*.patch
55     do
56         patch -Np1 -i "$file"
57     done
58     unset file
60     # Set sane permissions
61     chmod -R u+w,go-w,a+rX-s .
63     ./configure CFLAGS="$QICFLAGS -O3" LDFLAGS="$QILDFLAGS" \
64      $configure_args \
65      --libdir=/usr/lib${libSuffix} \
66      --mandir=$mandir \
67      --docdir=$docsdir \
68      --disable-dependency-tracking \
69      --build="$(gcc -dumpmachine)"
71     make -j${jobs} V=1
72     make -j${jobs} V=1 DESTDIR="$destdir" install
74     # Replace hard-links at usr/sbin
75     (
76         cd "${destdir}/usr/sbin"
77         ln -sf jfs_fsck fsck.jfs
78         ln -sf jfs_mkfs mkfs.jfs
79     )
81     # Compress and link man pages (if needed)
82     if test -d "${destdir}/$mandir"
83     then
84         (
85             cd "${destdir}/$mandir"
86             find . -type f -exec lzip -9 '{}' +
87             find . -type l | while read -r file
88             do
89                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
90                 rm -- "$file"
91             done
92         )
93     fi
95     # Replace hard-links at usr/share/man/man8
96     (
97         cd "${destdir}/usr/share/man/man8"
98         ln -sf jfs_fsck.8.gz fsck.jfs.8.gz
99         ln -sf jfs_mkfs.8.gz mkfs.jfs.8.gz
100     )
103     # Copy documentation
104     mkdir -p "${destdir}${docsdir}"
105     cp -p $docs "${destdir}${docsdir}/"