recipes: Honor CPPFLAGS (through QICPPFLAGS) whenever is possible
[dragora.git] / recipes / tools / e2fsprogs / recipe
blobf3a6fabbde5e6b002786933ba2b534b2d6175616
1 # Build recipe for e2fsprogs.
3 # Copyright (c) 2016-2021 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=e2fsprogs
21 version=1.45.7
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=http://downloads.sourceforge.net/e2fsprogs/$tarname
32 description="
33 Ext2 file system utilities.
35 The e2fsprogs package contains the utilities for handling the ext2 file
36 system.  It also supports the ext3 and ext4 journaling file systems.
39 homepage=http://e2fsprogs.sourceforge.net
40 license="GPLv2+, LGPLv2, MIT-style licenses"
42 # Source documentation
43 docs="NOTICE README RELEASE-NOTES SUBMITTING-PATCHES"
44 docsdir="${docdir}/${program}-${version}"
46 build()
48     unpack "${tardir}/$tarname"
50     cd "$srcdir"
52     # Set sane permissions
53     chmod -R u+w,go-w,a+rX-s .
55     ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS -O3" LDFLAGS="$QILDFLAGS" \
56      $configure_args \
57      --libdir=/usr/lib${libSuffix} \
58      --infodir=$infodir \
59      --mandir=$mandir \
60      --docdir=$docsdir \
61      --enable-symlink-install \
62      --enable-threads=posix \
63      --enable-elf-shlibs \
64      --disable-libblkid \
65      --disable-libuuid \
66      --disable-fsck \
67      --disable-uuidd \
68      --with-root-prefix=/usr \
69      --build="$(gcc -dumpmachine)"
71     make -j${jobs} V=1
73     make -j${jobs} MKDIR_P="mkdir -p" DESTDIR="$destdir" install
74     make -j${jobs} MKDIR_P="mkdir -p" DESTDIR="$destdir" install-libs
76     # Remove generated charset.alias and generated locale.alias
77     rm -f "${destdir}/usr/lib${libSuffix}/charset.alias" \
78           "${destdir}/usr/share/locale/locale.alias"
80     # To handle config file(s)
81     touch "${destdir}/etc/.graft-config"
83     # Compress info documents deleting index file for the package
84     if test -d "${destdir}/$infodir"
85     then
86         rm -f "${destdir}/${infodir}/dir"
87         lzip -9 "${destdir}/${infodir}"/* || true
88     fi
90     # Compress and link man pages (if needed)
91     if test -d "${destdir}/$mandir"
92     then
93         (
94             cd "${destdir}/$mandir"
95             find . -type f -exec lzip -9 {} +
96             find . -type l | while read -r file
97             do
98                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
99                 rm -- "$file"
100             done
101         )
102     fi
104     # Copy documentation
105     mkdir -p "${destdir}${docsdir}"
106     cp -p $docs "${destdir}${docsdir}/"