stages: 2/04-iso: Do not include kernel build/source tree in the LiveCD
[dragora.git] / recipes / devel / m4 / recipe
blob3ecefc67452d6b0d6c0a6bacd4b78722c8b0aed7
1 # Build recipe for m4.
3 # Copyright (c) 2015-2018, 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=m4
21 version=1.4.19
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=devel
27 tarname=${program}-${version}.tar.bz2
29 # Remote source(s)
30 fetch=https://ftp.gnu.org/gnu/m4/$tarname
32 description="
33 Traditional Unix macro processor.
35 GNU M4 is an implementation of the traditional Unix macro processor.
36 It is mostly SVR4 compatible although it has some extensions (for
37 example, handling more than 9 positional parameters to macros).
39 GNU M4 also has built-in functions for including files, running shell
40 commands, doing arithmetic, etc.
42 GNU M4 is a macro processor in the sense that it copies its input
43 to the output expanding macros as it goes.
46 homepage=https://www.gnu.org/software/m4
47 license=GPLv3+
49 # Source documentation
50 docs="AUTHORS BACKLOG COPYING ChangeLog NEWS README THANKS TODO"
51 docsdir="${docdir}/${program}-${version}"
53 build()
55     unpack "${tardir}/$tarname"
57     cd "$srcdir"
59     # Set sane permissions
60     chmod -R u+w,go-w,a+rX-s .
62     patch -Np1 -i "${worktree}/patches/m4/update-freadahead"
64     ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" \
65     LDFLAGS="$QILDFLAGS -static" \
66      $configure_args \
67      --libdir=/usr/lib${libSuffix} \
68      --infodir=$infodir \
69      --mandir=$mandir \
70      --docdir=$docsdir \
71      --build="$(gcc -dumpmachine)"
73     make -j${jobs} V=1
74     make -j${jobs} install DESTDIR="$destdir"
76     # This look wrong since m4 does not support any encoding translation
77     rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
78     rmdir "${destdir}/usr/lib${libSuffix}/" 2> /dev/null || true
80     # Compress info documents deleting index file for the package
81     if test -d "${destdir}/$infodir"
82     then
83         rm -f "${destdir}/${infodir}/dir"
84         lzip -9 "${destdir}/${infodir}"/*
85     fi
87     # Compress man pages
88     lzip -9 "${destdir}/${mandir}/man1/m4.1"
90     # Copy documentation
91     mkdir -p "${destdir}/$docsdir"
92     cp -p $docs "${destdir}/$docsdir"