recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / devel / make / recipe
blob31f1f681bcca5e7aef0633665f74e1763a5dba0c
1 # Build recipe for make.
3 # Copyright (c) 2016-2020 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=make
21 version=4.3
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=devel
27 tarname=${program}-${version}.tar.lz
29 # Remote source(s)
30 fetch=ftp://ftp.gnu.org/gnu/make/$tarname
32 description="
33 The weighted make.
35 GNU Make is a tool which controls the generation of executables and
36 other non-source files of a program from the program's source files.
38 Make gets its knowledge of how to build your program from a file
39 called the makefile, which lists each of the non-source files and
40 how to compute it from other files.  When you write a program, you
41 should write a makefile for it, so that it is possible to use Make
42 to build and install the program.
45 homepage=https://www.gnu.org/software/make
46 license=GPLv3+
48 # Source documentation
49 docs="AUTHORS COPYING ChangeLog NEWS README"
50 docsdir="${docdir}/${program}-${version}"
52 build()
54     unpack "${tardir}/$tarname"
56     cd "$srcdir"
58     # Set sane permissions
59     chmod -R u+w,go-w,a+rX-s .
61     ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
62      $configure_args \
63      --libdir=/usr/lib${libSuffix} \
64      --infodir=$infodir \
65      --mandir=$mandir \
66      --with-guile \
67      --build="$(gcc -dumpmachine)"
69     make -j${jobs} V=1
70     make -j${jobs} DESTDIR="$destdir" install-strip
72     # Make symlink for "GNU make"
73     ( cd "${destdir}/usr/bin" && ln -sf make gmake )
75     # Compress info documents deleting index file for the package
76     if test -d "${destdir}/$infodir"
77     then
78         rm -f "${destdir}/${infodir}/dir"
79         lzip -9 "${destdir}/${infodir}"/*
80     fi
82     # Compress and link man pages (if needed)
83     if test -d "${destdir}/$mandir"
84     then
85         (
86             cd "${destdir}/$mandir"
87             find . -type f -exec lzip -9 {} +
88             find . -type l | while read -r file
89             do
90                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
91                 rm -- "$file"
92             done
93         )
94     fi
96     # Copy documentation
97     mkdir -p "${destdir}/$docsdir"
99     for file in $docs
100     do
101         cp -p $file "${destdir}/$docsdir"
102     done