1 # Build recipe for quota.
3 # Copyright (c) 2018 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.
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/tools"
24 tarname=${program}-${version}.tar.gz
27 fetch=http://downloads.sourceforge.net/project/linuxquota/quota-tools/${version}/$tarname
30 User space tools to manage the disk quota system.
32 Tools for the disk quota system as part of the Linux Kernel.
35 homepage=http://sourceforge.net/projects/linuxquota
36 license="GPLv2+ | BSD"
38 # Source documentation
39 docs="COPYING Changelog README*"
40 docsdir="${docdir}/${program}-${version}"
46 unpack "${tardir}/$tarname"
50 # Set sane permissions
51 chmod -R u+w,go-w,a+rX-s .
53 # Apply patches to work under Musl (patches from Khem Raj)
55 patch -p1 < "${worktree}/patches/quota/fcntl.patch"
56 patch -p1 < "${worktree}/patches/quota/remove_non_posix_types.patch"
57 patch -p1 < "${worktree}/patches/quota/replace_getrpcbynumber_r.patch"
59 ./configure CPPFLAGS="-D_GNU_SOURCE -D_BSD_SOURCE" \
60 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
62 --libdir=/usr/lib${libSuffix} \
63 --sysconfdir=/etc/quota \
67 --enable-ldapmail=no \
69 --build="$(cc -dumpmachine)"
72 make -j${jobs} DESTDIR="$destdir" install-strip
74 # To manage dot (new) config files via graft(1)
75 touch "${destdir}/etc/quota/.graft-config"
77 # Compress and link man pages (if needed)
78 if test -d "${destdir}/$mandir"
81 cd "${destdir}/$mandir"
82 find . -type f -exec lzip -9 '{}' +
83 find . -type l | while read -r file
85 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
92 mkdir -p "${destdir}${docsdir}"
93 cp -p $docs "${destdir}${docsdir}"