| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- ##
- ## flex.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- # package versions
- %define V_new 2.5.35
- %define V_old 2.5.4a
- %define V_old_maj 2.5.4
- %define V_reflex 20090902
- # package information
- Name: flex
- Summary: Fast Lexical Analyzer Generator
- URL: http://www.gnu.org/software/flex/
- Vendor: Free Software Foundation
- Packager: OpenPKG Foundation e.V.
- Distribution: OpenPKG Community
- Class: CORE
- Group: CompilerCompiler
- License: BSD
- Version: %{V_new}
- Release: 20090903
- # package options
- %option with_old no
- # list of sources
- Source0: http://switch.dl.sourceforge.net/sourceforge/flex/flex-%{V_new}.tar.gz
- Source1: http://switch.dl.sourceforge.net/sourceforge/flex/flex-%{V_old}.tar.gz
- Source2: ftp://invisible-island.net/reflex/reflex-%{V_reflex}.tgz
- Patch0: flex.patch
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20040212, bison, make
- PreReq: OpenPKG, openpkg >= 20040212, m4
- AutoReq: no
- AutoReqProv: no
- %description
- Flex is a tool for generating scanners: programs which recognize
- lexical patterns in text. Flex reads the given input files for a
- description of a scanner to generate. The description is in the
- form of pairs of regular expressions and C code, called rules.
- Flex generates as output a C source file, lex.yy.c, which defines
- a C function yylex(). This file is compiled and linked with the
- -lfl library to produce an executable. When the executable is run,
- it analyzes its input for occurrences of the regular expressions.
- Whenever it finds one, it executes the corresponding C code.
- %track
- prog flex:new = {
- version = %{V_new}
- url = http://sourceforge.net/projects/flex/files/
- regex = flex-(__VER__)\.tar\.gz
- }
- prog flex:old = {
- disabled
- comment = "cs: 'old' actually refers to the completely discontinued version of flex"
- version = %{V_old}
- url = http://flex.sourceforge.net/
- regex = flex-(__VER__)\.tar\.gz
- }
- prog flex:reflex = {
- version = %{V_reflex}
- url = ftp://invisible-island.net/reflex/
- regex = reflex-(__VER__)\.tgz
- }
- %prep
- %setup -q -c
- %setup -q -T -D -a 1
- %setup -q -T -D -a 2
- %patch -p0 -d flex-%{V_new}
- sleep 1; touch flex-%{V_new}/scan.c
- %{l_shtool} subst \
- -e '1,/^@copying/!{ /^@end copying/,/^@copying/!H }' \
- -e '/^@insertcopying/g' \
- -e '/^@copying/,/^@end copying/d' \
- flex-%{V_new}/doc/flex.texi
- %build
- # configure and build Flex (new version)
- ( cd flex-%{V_new}
- CC="%{l_cc}" \
- CFLAGS="%{l_cflags -O}" \
- HELP2MAN=`type -P true` \
- ./configure \
- --prefix=%{l_prefix} \
- --disable-nls
- cp -p doc/flex.1 doc/flex.1.saved
- %{l_shtool} subst \
- -e 's;"m4";"%{l_prefix}/bin/m4";' \
- main.c
- %{l_make} %{l_mflags}
- ) || exit $?
- %if "%{with_old}" == "yes"
- # configure and build Flex (old version)
- ( cd flex-%{V_old_maj}
- CC="%{l_cc}" \
- CFLAGS="%{l_cflags -O}" \
- ./configure \
- --prefix=$RPM_BUILD_ROOT%{l_prefix}
- %{l_make} %{l_mflags}
- ) || exit $?
- # configure and build Reflex (alternative old version)
- ( cd reflex-%{V_reflex}
- CC="%{l_cc}" \
- CFLAGS="%{l_cflags -O}" \
- ./configure \
- --prefix=%{l_prefix}
- %{l_make} %{l_mflags}
- ) || exit $?
- %endif
- %install
- rm -rf $RPM_BUILD_ROOT
- %if "%{with_old}" == "yes"
- # install Flex (old version)
- ( cd flex-%{V_old_maj}
- %{l_make} %{l_mflags} install
- rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/flex++
- mv $RPM_BUILD_ROOT%{l_prefix}/bin/flex \
- $RPM_BUILD_ROOT%{l_prefix}/bin/flex-old
- mv $RPM_BUILD_ROOT%{l_prefix}/include/FlexLexer.h \
- $RPM_BUILD_ROOT%{l_prefix}/include/FlexLexer-old.h
- mv $RPM_BUILD_ROOT%{l_prefix}/lib/libfl.a \
- $RPM_BUILD_ROOT%{l_prefix}/lib/libfl-old.a
- mv $RPM_BUILD_ROOT%{l_prefix}/man/man1/flex.1 \
- $RPM_BUILD_ROOT%{l_prefix}/man/man1/flex-old.1
- ) || exit $?
- # install Reflex (alternative old version)
- ( cd reflex-%{V_reflex}
- %{l_make} %{l_mflags} install \
- prefix=$RPM_BUILD_ROOT%{l_prefix} \
- exec_prefix=$RPM_BUILD_ROOT%{l_prefix}
- ) || exit $?
- %endif
- # install Flex (new version)
- ( cd flex-%{V_new}
- %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
- %{l_shtool} install -c -m 644 \
- doc/flex.1.saved \
- $RPM_BUILD_ROOT%{l_prefix}/man/man1/flex.1
- ) || exit $?
- # strip down installation
- rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
- strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
|