recipes: Replace 'outdir' with package hash tags
[dragora.git] / recipes / devel / m4 / recipe
blobe63c3dcde6196d44d30f3db86d30fb5a2a9a9d0d
1 # Build recipe for m4.
3 # Copyright (c) 2015-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=m4
18 version=1.4.18
19 release=2
21 # Define hash tag to categorize the package name output
22 pkghashtag=devel
24 tarname=${program}-${version}.tar.bz2
26 # Remote source(s)
27 fetch=http://ftp.gnu.org/gnu/m4/$tarname
29 description="
30 Traditional Unix macro processor.
32 GNU M4 is an implementation of the traditional Unix macro processor.
33 It is mostly SVR4 compatible although it has some extensions (for
34 example, handling more than 9 positional parameters to macros).
36 GNU M4 also has built-in functions for including files, running shell
37 commands, doing arithmetic, etc.
39 GNU M4 is a macro processor in the sense that it copies its input
40 to the output expanding macros as it goes.
43 homepage=http://www.gnu.org/software/m4
44 license=GPLv3+
46 # Source documentation
47 docs="AUTHORS BACKLOG COPYING ChangeLog NEWS README THANKS TODO"
48 docsdir="${docdir}/${program}-${version}"
50 build()
52     set -e
54     unpack "${tardir}/$tarname"
56     cd "$srcdir"
58     # Set sane permissions
59     chmod -R u+w,go-w,a+rX-s .
61     patch -Np1 -i "${worktree}/patches/m4/update-freadahead"
63     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
64      $configure_args \
65      --libdir=/usr/lib${libSuffix} \
66      --infodir=$infodir \
67      --mandir=$mandir \
68      --docdir=$docsdir \
69      --build="$(cc -dumpmachine)"
71     make -j${jobs} V=1
72     make -j${jobs} install DESTDIR="$destdir"
74     # This look wrong since m4 does not support any encoding translation
75     rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
76     rmdir "${destdir}/usr/lib${libSuffix}/" 2> /dev/null || true
78     # Compress info documents deleting index file for the package
79     if test -d "${destdir}/$infodir"
80     then
81         rm -f "${destdir}/${infodir}/dir"
82         lzip -9 "${destdir}/${infodir}"/*
83     fi
85     # Compress man pages
86     lzip -9 "${destdir}/${mandir}/man1/m4.1"
88     # Copy documentation
89     mkdir -p "${destdir}${docsdir}"
90     for file in $docs
91     do
92         cp -p $file "${destdir}${docsdir}"
93     done