| 1 | Summary: A tool for creating scanners (text pattern recognizers)
|
|---|
| 2 | Name: flex
|
|---|
| 3 | Version: 2.5.35
|
|---|
| 4 | Release: 1%{?dist}
|
|---|
| 5 | License: BSD
|
|---|
| 6 | Group: Development/Tools
|
|---|
| 7 | URL: http://flex.sourceforge.net/
|
|---|
| 8 | Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
|
|---|
| 9 | Patch0: flex-2.5.35-sign.patch
|
|---|
| 10 | Patch1: flex-2.5.35-hardening.patch
|
|---|
| 11 | Patch2: flex-2.5.35-gcc44.patch
|
|---|
| 12 | Patch3: flex-2.5.35-missing-prototypes.patch
|
|---|
| 13 | Patch4: flex-os2.patch
|
|---|
| 14 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|---|
| 15 | Requires: m4
|
|---|
| 16 | BuildRequires: gettext bison m4
|
|---|
| 17 |
|
|---|
| 18 | # We need to pull in the static library package. That's necessary so
|
|---|
| 19 | # that packages that just do BuildRequires: flex can still use -lfl.
|
|---|
| 20 | # I suspect that linking to -lfl is actually rare and those (few)
|
|---|
| 21 | # packages that do use it could be taught to require the sub-package
|
|---|
| 22 | # explicitly. So at some point in future, this dependency may be
|
|---|
| 23 | # dropped.
|
|---|
| 24 | #Requires: flex-static = %{version}
|
|---|
| 25 |
|
|---|
| 26 | %description
|
|---|
| 27 | The flex program generates scanners. Scanners are programs which can
|
|---|
| 28 | recognize lexical patterns in text. Flex takes pairs of regular
|
|---|
| 29 | expressions and C code as input and generates a C source file as
|
|---|
| 30 | output. The output file is compiled and linked with a library to
|
|---|
| 31 | produce an executable. The executable searches through its input for
|
|---|
| 32 | occurrences of the regular expressions. When a match is found, it
|
|---|
| 33 | executes the corresponding C code. Flex was designed to work with
|
|---|
| 34 | both Yacc and Bison, and is used by many programs as part of their
|
|---|
| 35 | build process.
|
|---|
| 36 |
|
|---|
| 37 | You should install flex if you are going to use your system for
|
|---|
| 38 | application development.
|
|---|
| 39 |
|
|---|
| 40 | # We keep the libraries in separate sub-package to allow for multilib
|
|---|
| 41 | # installations of flex.
|
|---|
| 42 | #%package static
|
|---|
| 43 | #Summary: Libraries for flex scanner generator
|
|---|
| 44 | #Group: Development/Tools
|
|---|
| 45 |
|
|---|
| 46 | #%description static
|
|---|
| 47 | #This package contains the library with default implementations of
|
|---|
| 48 | #`main' and `yywrap' functions that the client binary can choose to use
|
|---|
| 49 | #instead of implementing their own.
|
|---|
| 50 |
|
|---|
| 51 | %prep
|
|---|
| 52 | %setup -q
|
|---|
| 53 | %patch0 -p1
|
|---|
| 54 | %patch1 -p1
|
|---|
| 55 | %patch2 -p1
|
|---|
| 56 | %patch3 -p1
|
|---|
| 57 | %patch4 -p1
|
|---|
| 58 |
|
|---|
| 59 | %build
|
|---|
| 60 | export CONFIG_SHELL="/@unixroot/usr/bin/sh.exe"
|
|---|
| 61 | export LDFLAGS="-Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
|
|---|
| 62 | export LIBS="-lurpo -lmmap"
|
|---|
| 63 | %configure \
|
|---|
| 64 | --disable-dependency-tracking \
|
|---|
| 65 | "--cache-file=%{_topdir}/cache/%{name}-%{_target_cpu}.cache"
|
|---|
| 66 |
|
|---|
| 67 | make %{?_smp_mflags}
|
|---|
| 68 |
|
|---|
| 69 | %install
|
|---|
| 70 | rm -rf $RPM_BUILD_ROOT
|
|---|
| 71 | make DESTDIR=$RPM_BUILD_ROOT install
|
|---|
| 72 | rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
|
|---|
| 73 | rm -f $RPM_BUILD_ROOT/%{_libdir}/*.a
|
|---|
| 74 |
|
|---|
| 75 | ( cd ${RPM_BUILD_ROOT}
|
|---|
| 76 | ln -sf flex .%{_bindir}/lex
|
|---|
| 77 | ln -sf flex .%{_bindir}/flex++
|
|---|
| 78 | ln -s flex.1 .%{_mandir}/man1/lex.1
|
|---|
| 79 | ln -s flex.1 .%{_mandir}/man1/flex++.1
|
|---|
| 80 | )
|
|---|
| 81 |
|
|---|
| 82 | #%check
|
|---|
| 83 | #echo ============TESTING===============
|
|---|
| 84 | #make check
|
|---|
| 85 | #echo ============END TESTING===========
|
|---|
| 86 |
|
|---|
| 87 | %clean
|
|---|
| 88 | rm -rf ${RPM_BUILD_ROOT}
|
|---|
| 89 |
|
|---|
| 90 | %files
|
|---|
| 91 | %defattr(-,root,root)
|
|---|
| 92 | %doc COPYING NEWS README
|
|---|
| 93 | %{_bindir}/*
|
|---|
| 94 | %{_mandir}/man1/*
|
|---|
| 95 | %{_includedir}/FlexLexer.h
|
|---|
| 96 | %{_infodir}/flex.info*
|
|---|
| 97 | %{_usr}/share/locale/*
|
|---|
| 98 |
|
|---|
| 99 | #%files static
|
|---|
| 100 | #%defattr(-,root,root)
|
|---|
| 101 | #%{_libdir}/*.a
|
|---|
| 102 |
|
|---|
| 103 | %changelog
|
|---|
| 104 | * Fri Jan 06 2012 yd
|
|---|
| 105 | - initial unixroot build.
|
|---|