stages: 2/04-iso: Do not include kernel build/source tree in the LiveCD
[dragora.git] / recipes / devel / flex / recipe
blob70a4cb7022478960b6097d48469a8a5938fc782c
1 # Build recipe for flex.
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 # Exit immediately on any error
18 set -e
20 program=flex
21 version=2.6.4
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=https://github.com/westes/flex/releases/download/v${version}/$tarname
32 description="
33 The fast lexical analyser generator.
35 Flex is a fast lexical analyser generator.  It is a tool for
36 generating programs that perform pattern-matching on text.
39 homepage=https://flex.sourceforge.net
40 license=Custom
42 # Source documentation.
44 # The documentation files are installed by Flex.
46 docsdir="${docdir}/${program}-${version}"
48 build()
50     unpack "${tardir}/$tarname"
52     cd "$srcdir"
54     # Set sane permissions
55     chmod -R u+w,go-w,a+rX-s .
57     ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
58      $configure_args \
59      --libdir=/usr/lib${libSuffix} \
60      --infodir=$infodir \
61      --mandir=$mandir \
62      --docdir=$docsdir \
63      --enable-static \
64      --enable-shared \
65      --enable-nls \
66      --build="$(gcc -dumpmachine)"
68     make -j${jobs}
69     make -j${jobs} DESTDIR="$destdir" install-strip
71     # Compress info documents deleting index file for the package
72     if test -d "${destdir}/$infodir"
73     then
74         rm -f "${destdir}/${infodir}/dir"
75         lzip -9 "${destdir}/${infodir}"/*
76     fi
78     # Compress man pages
79     lzip -9 "${destdir}/${mandir}"/man?/*
81     # Provide compatibility with flex's predecessor, lex
82     if test -f "${worktree}/archive/flex/usr/bin/lex"
83     then
84         cp -p "${worktree}/archive/flex/usr/bin/lex" \
85               "${destdir}/usr/bin"
86         chmod 755 "${destdir}/usr/bin/lex"
88         ln -sf libfl.a "${destdir}/usr/lib${libSuffix}/libl.a"
89     fi