gcc upgraded to version 8-20190222
[dragora.git] / recipes / devel / flex / recipe
blobe9bce0d774ac53d1e21bcda221f93e7342b932b9
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 program=flex
18 version=2.6.4
19 release=1
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/devel"
24 tarname=${program}-${version}.tar.lz
26 # Remote source(s)
27 fetch=http://github.com/westes/flex/releases/download/v${version}/$tarname
29 description="
30 The fast lexical analyser generator.
32 Flex is a fast lexical analyser generator.  It is a tool for
33 generating programs that perform pattern-matching on text.
36 homepage=http://flex.sourceforge.net
37 license=Custom
39 # Source documentation.
41 # The documentation files are installed by Flex.
43 docsdir="${docdir}/${program}-${version}"
45 build()
47     set -e
49     unpack "${tardir}/$tarname"
51     cd "$srcdir"
53     # Set sane permissions
54     chmod -R u+w,go-w,a+rX-s .
56     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
57      $configure_args \
58      --libdir=/usr/lib${libSuffix} \
59      --infodir=$infodir \
60      --mandir=$mandir \
61      --docdir=$docsdir \
62      --enable-static \
63      --enable-shared \
64      --enable-nls \
65      --build="$(cc -dumpmachine)"
67     make -j${jobs}
68     make -j${jobs} DESTDIR="$destdir" install-strip
70     # Compress info documents deleting index file for the package
71     if test -d "${destdir}/$infodir"
72     then
73         rm -f "${destdir}/${infodir}/dir"
74         lzip -9 "${destdir}/${infodir}"/*
75     fi
77     # Compress man pages
78     lzip -9 "${destdir}/${mandir}"/man?/*
80     # Provide compatibility with flex's predecessor, lex
81     if test -f "${worktree}/archive/flex/usr/bin/lex"
82     then
83         cp -p "${worktree}/archive/flex/usr/bin/lex" \
84               "${destdir}/usr/bin"
85         chmod 755 "${destdir}/usr/bin/lex"
87         ln -sf libfl.a "${destdir}/usr/lib${libSuffix}/libl.a"
88     fi