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.
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/devel"
24 tarname=${program}-${version}.tar.lz
27 fetch=http://github.com/westes/flex/releases/download/v${version}/$tarname
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
39 # Source documentation.
41 # The documentation files are installed by Flex.
43 docsdir="${docdir}/${program}-${version}"
49 unpack "${tardir}/$tarname"
53 # Set sane permissions
54 chmod -R u+w,go-w,a+rX-s .
56 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
58 --libdir=/usr/lib${libSuffix} \
65 --build="$(cc -dumpmachine)"
68 make -j${jobs} DESTDIR="$destdir" install-strip
70 # Compress info documents deleting index file for the package
71 if test -d "${destdir}/$infodir"
73 rm -f "${destdir}/${infodir}/dir"
74 lzip -9 "${destdir}/${infodir}"/*
78 lzip -9 "${destdir}/${mandir}"/man?/*
80 # Provide compatibility with flex's predecessor, lex
81 if test -f "${worktree}/archive/flex/usr/bin/lex"
83 cp -p "${worktree}/archive/flex/usr/bin/lex" \
85 chmod 755 "${destdir}/usr/bin/lex"
87 ln -sf libfl.a "${destdir}/usr/lib${libSuffix}/libl.a"