recipes: xfce/exo: upgraded to version 0.12.4
[dragora.git] / recipes / tools / quota / recipe
blobfc7bafb554aa071c43e745718c78211d5f128674
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.
17 program=quota
18 version=4.04
19 release=1
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/tools"
24 tarname=${program}-${version}.tar.gz
26 # Remote source(s)
27 fetch=http://downloads.sourceforge.net/project/linuxquota/quota-tools/${version}/$tarname
29 description="
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}"
42 build()
44     set -e
46     unpack "${tardir}/$tarname"
48     cd "$srcdir"
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" \
61      $configure_args \
62      --libdir=/usr/lib${libSuffix} \
63      --sysconfdir=/etc/quota \
64      --mandir=$mandir \
65      --docdir=$docsdir \
66      --disable-werror \
67      --enable-ldapmail=no \
68      --enable-rpc=no \
69      --build="$(cc -dumpmachine)"
71     make -j${jobs} V=1
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"
79     then
80         (
81             cd "${destdir}/$mandir"
82             find . -type f -exec lzip -9 '{}' +
83             find . -type l | while read -r file
84             do
85                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
86                 rm -- "$file"
87             done
88         )
89     fi
91     # Copy documentation
92     mkdir -p "${destdir}${docsdir}"
93     cp -p $docs "${destdir}${docsdir}"