414718b
Summary: Legacy version of flex, a tool for creating scanners
414718b
Name: compat-flex
414718b
Version: 2.5.4a
414718b
Release: 1%{?dist}
414718b
License: BSD
414718b
Group: Development/Tools
414718b
URL: http://www.gnu.org/software/flex/
414718b
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
414718b
Source: ftp://ftp.gnu.org/non-gnu/flex/flex-2.5.4a.tar.gz
414718b
Source2: README.fedora
414718b
Patch0: flex-2.5.4a-skel.patch
414718b
Patch1: flex-2.5.4-glibc22.patch
414718b
Patch2: flex-2.5.4a-gcc3.patch
414718b
Patch3: flex-2.5.4a-gcc31.patch
414718b
Patch4: flex-2.5.4a2.patch
414718b
Patch5: flex-pic.patch
414718b
Patch6: flex-2.5.4a2-std.patch
414718b
Patch7: flex-2.5.4a2-warn.patch
414718b
Patch8: flex-2.5.4a2-shapwarn.patch
414718b
Patch9: flex-2.5.4a2-iniscan.patch
414718b
Patch10: flex-2.5.4a-Makefile.in.patch
414718b
BuildRequires: autoconf byacc texinfo info
414718b
414718b
%description
414718b
414718b
This is legacy version of flex, a program that generates scanners.
414718b
Scanners are programs which can recognize lexical patterns in text.
414718b
Flex takes pairs of regular expressions and C code as input and
414718b
generates a C source file as output.  The output file is compiled and
414718b
linked with a library to produce an executable.  The executable
414718b
searches through its input for occurrences of the regular expressions.
414718b
When a match is found, it executes the corresponding C code.  Flex was
414718b
designed to work with both Yacc and Bison, and is used by many
414718b
programs as part of their build process.
414718b
414718b
You should install flex if you are going to use your system for
414718b
application development.
414718b
414718b
%prep
414718b
%setup -q -n flex-2.5.4
414718b
%patch0 -p1
414718b
%patch1 -p1
414718b
%patch2 -p1
414718b
%patch3 -p1
414718b
%patch4 -p1
414718b
%patch5 -p1
414718b
%patch6 -p1
414718b
%patch7 -p1
414718b
%patch8 -p1
414718b
%patch9 -p1
414718b
%patch10 -p1
414718b
cp %{SOURCE2} .
414718b
414718b
%build
414718b
autoconf
414718b
%configure
414718b
sed -i '/^START-INFO-DIR-ENTRY/,/^END-INFO-DIR-ENTRY/s/[Ff]lex/&-%{version}/g' ./MISC/texinfo/flex.texi
414718b
make FLEX=flex-%{version}
414718b
makeinfo MISC/texinfo/flex.texi -o MISC/texinfo/flex-%{version}.info
414718b
414718b
%install
414718b
rm -rf $RPM_BUILD_ROOT
414718b
%{makeinstall} FLEX=flex-%{version} libdir=$RPM_BUILD_ROOT/%{_libdir}/flex-%{version} mandir=$RPM_BUILD_ROOT/%{_mandir}/man1
414718b
./mkinstalldirs $RPM_BUILD_ROOT/%{_infodir} $RPM_BUILD_ROOT/%{_includedir}/flex-%{version}
414718b
install -m 644 MISC/texinfo/flex-%{version}.info $RPM_BUILD_ROOT/%{_infodir}/flex-%{version}.info
414718b
mv ${RPM_BUILD_ROOT}/%{_includedir}/FlexLexer.h ${RPM_BUILD_ROOT}/%{_includedir}/flex-%{version}/FlexLexer.h
414718b
ln -s flex-%{version}.1 ${RPM_BUILD_ROOT}/%{_mandir}/man1/flex-%{version}++.1
414718b
414718b
%check
414718b
echo ============TESTING===============
414718b
make FLEX=flex-%{version} bigcheck
414718b
echo ============END TESTING===========
414718b
414718b
%post
414718b
/sbin/install-info %{_infodir}/flex-%{version}.info --dir-file=%{_infodir}/dir ||:
414718b
414718b
%preun
414718b
if [ $1 = 0 ]; then
414718b
	/sbin/install-info --delete %{_infodir}/flex-%{version}.info %{_infodir}/dir ||:
414718b
fi
414718b
414718b
%clean
414718b
rm -rf ${RPM_BUILD_ROOT}
414718b
414718b
%files
414718b
%defattr(-,root,root)
414718b
%doc COPYING NEWS README README.fedora
414718b
%{_bindir}/*
414718b
%{_mandir}/man1/*
414718b
%{_libdir}/flex-%{version}
414718b
%{_includedir}/flex-%{version}
414718b
%{_infodir}/flex-%{version}.info*
414718b
414718b
%changelog
414718b
* Wed Jan 18 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-1
414718b
- Initial build.