1 # Build recipe for flex.
3 # Copyright (c) 2015-2017 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.
21 tarname=${program}-${version}.tar.lz
24 fetch=http://github.com/westes/flex/releases/download/v${version}/$tarname
27 The fast lexical analyser generator.
29 Flex is a fast lexical analyser generator. It is a tool for
30 generating programs that perform pattern-matching on text.
33 homepage=http://flex.sourceforge.net
36 # Source documentation.
38 # The documentation files are installed by Flex.
40 docsdir="${docdir}/${program}-${version}"
46 unpack "${tardir}/$tarname"
50 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
52 --libdir=/usr/lib${libSuffix} \
59 --build="$(cc -dumpmachine)"
62 make -j${jobs} DESTDIR="$destdir" install-strip
64 # Compress info documents deleting index file for the package
65 if test -d "${destdir}/$infodir"
67 rm -f "${destdir}/${infodir}/dir"
68 lzip -9 "${destdir}/${infodir}"/*
72 lzip -9 "${destdir}/${mandir}"/man?/*
74 # Provide compatibility with flex's predecessor, lex
75 if test -f "${worktree}/archive/flex/usr/bin/lex"
77 cp -f "${worktree}/archive/flex/usr/bin/lex" \
79 chmod 755 "${destdir}/usr/bin/lex"
81 ln -sf libfl.a "${destdir}/usr/lib${libSuffix}/libl.a"