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
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.tar.bz2
30 fetch=https://ftp.gnu.org/gnu/m4/$tarname
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
49 # Source documentation
50 docs="AUTHORS BACKLOG COPYING ChangeLog NEWS README THANKS TODO"
51 docsdir="${docdir}/${program}-${version}"
55 unpack "${tardir}/$tarname"
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" \
67 --libdir=/usr/lib${libSuffix} \
71 --build="$(gcc -dumpmachine)"
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"
83 rm -f "${destdir}/${infodir}/dir"
84 lzip -9 "${destdir}/${infodir}"/*
88 lzip -9 "${destdir}/${mandir}/man1/m4.1"
91 mkdir -p "${destdir}/$docsdir"
92 cp -p $docs "${destdir}/$docsdir"