| 1 | Summary: A tool for creating scanners (text pattern recognizers) | 
|---|
| 2 | Name: flex | 
|---|
| 3 | Version: 2.5.35 | 
|---|
| 4 | Release: 2%{?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 | export M4="/@unixroot/usr/bin/m4.exe" | 
|---|
| 64 | %configure \ | 
|---|
| 65 | --disable-dependency-tracking \ | 
|---|
| 66 | "--cache-file=%{_topdir}/cache/%{name}-%{_target_cpu}.cache" | 
|---|
| 67 |  | 
|---|
| 68 | make %{?_smp_mflags} | 
|---|
| 69 |  | 
|---|
| 70 | %install | 
|---|
| 71 | rm -rf $RPM_BUILD_ROOT | 
|---|
| 72 | make DESTDIR=$RPM_BUILD_ROOT install | 
|---|
| 73 | rm -f $RPM_BUILD_ROOT/%{_infodir}/dir | 
|---|
| 74 | rm -f $RPM_BUILD_ROOT/%{_libdir}/*.a | 
|---|
| 75 |  | 
|---|
| 76 | ( cd ${RPM_BUILD_ROOT} | 
|---|
| 77 | ln -sf flex .%{_bindir}/lex | 
|---|
| 78 | ln -sf flex .%{_bindir}/flex++ | 
|---|
| 79 | ln -s flex.1 .%{_mandir}/man1/lex.1 | 
|---|
| 80 | ln -s flex.1 .%{_mandir}/man1/flex++.1 | 
|---|
| 81 | ) | 
|---|
| 82 |  | 
|---|
| 83 | #%check | 
|---|
| 84 | #echo ============TESTING=============== | 
|---|
| 85 | #make check | 
|---|
| 86 | #echo ============END TESTING=========== | 
|---|
| 87 |  | 
|---|
| 88 | %clean | 
|---|
| 89 | rm -rf ${RPM_BUILD_ROOT} | 
|---|
| 90 |  | 
|---|
| 91 | %files | 
|---|
| 92 | %defattr(-,root,root) | 
|---|
| 93 | %doc COPYING NEWS README | 
|---|
| 94 | %{_bindir}/* | 
|---|
| 95 | %{_mandir}/man1/* | 
|---|
| 96 | %{_includedir}/FlexLexer.h | 
|---|
| 97 | %{_infodir}/flex.info* | 
|---|
| 98 | %{_usr}/share/locale/* | 
|---|
| 99 |  | 
|---|
| 100 | #%files static | 
|---|
| 101 | #%defattr(-,root,root) | 
|---|
| 102 | #%{_libdir}/*.a | 
|---|
| 103 |  | 
|---|
| 104 | %changelog | 
|---|
| 105 | * Tue Feb 28 2012 yd | 
|---|
| 106 | - fixed m4 executable location. | 
|---|
| 107 |  | 
|---|
| 108 | * Fri Jan 06 2012 yd | 
|---|
| 109 | - initial unixroot build. | 
|---|