-# NOTE: don't use 2.5.34, it's too broken? is 2.5.35 ok? how to test?
+# NOTE on shared libfl:
+# It exports two functions, yywrap() and main();
+# - because of the latter, unnecessary linking with shared -lfl would harm,
+# so it would require large cleanup of other projects;
+# - when some code wants yywrap(), but no main(), using shared libfl is NOT POSSIBLE.
+# Thus, shared libfl would be of little use.
Summary: GNU fast lexical analyzer generator
Summary(de.UTF-8): GNU - schneller lexikalischer Analysegenerator
Summary(es.UTF-8): Generador rápido de analizadores léxicos de la GNU
Summary(tr.UTF-8): GNU sözdizim çözümleyici
Summary(uk.UTF-8): Швидкий генератор лексичних аналізаторів GNU
Name: flex
-Version: 2.5.35
-Release: 0.1
+Version: 2.6.4
+Release: 1
License: BSD-like
Group: Development/Tools
-Source0: http://downloads.sourceforge.net/flex/%{name}-%{version}.tar.bz2
-# Source0-md5: 10714e50cea54dc7a227e3eddcd44d57
+#Source0Download: https://github.com/westes/flex/releases
+# TODO: when upgrading, switch to
+#Source0: https://github.com/westes/flex/releases/download/v%{version}/%{name}-%{version}.tar.lz
+Source0: https://github.com/westes/flex/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 96828d1e36d18545b71a027caa6478dd
Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
# Source1-md5: fd79ee2834b290e74c626f0bbfc8942f
Patch0: %{name}-info.patch
-Patch2: %{name}-locale.patch
-# patch #869230 (second version of bug #720983 fix)
-#Patch3: %{name}-m4-quotes.diff
-URL: http://flex.sourceforge.net/
+Patch1: %{name}-build.patch
+Patch2: %{name}-rh1389575.patch
+URL: https://github.com/westes/flex
BuildRequires: autoconf >= 2.54
-BuildRequires: automake
+BuildRequires: automake >= 1:1.14.1
BuildRequires: bison
-# m4-quotes* patches require rebuilding *.c from scan.l
-BuildRequires: flex
-BuildRequires: gettext-devel >= 0.11.5
+# to rebuild scan.c from scan.l (m4-quotes patch)
+#BuildRequires: flex
+BuildRequires: gettext-tools >= 0.19
BuildRequires: help2man
+BuildRequires: libtool >= 2:2
+# to rebuild skel.c from patched flex.skl
+BuildRequires: m4
+BuildRequires: tar >= 1:1.22
BuildRequires: texinfo
+BuildRequires: texinfo-texi2dvi
+BuildRequires: texlive-fonts-cmsuper
+BuildRequires: texlive-pdftex
BuildRequires: util-linux
+BuildRequires: xz
Requires: m4
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define specflags_amd64 -fPIC
-%define specflags_ia32e -fPIC
-%define specflags_x86_64 -fPIC
-
%description
This is the GNU fast lexical analyzer generator. It generates lexical
tokenizing code based on a lexical (regular expression based)
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
%patch2 -p1
-#%patch3 -p1
# force regeneration (just in case make didn't want to)
-rm -f skel.c
+%{__rm} -f src/skel.c
%build
%{__gettextize}
+%{__libtoolize}
%{__aclocal} -I m4
%{__autoconf}
%{__autoheader}
%{__automake}
-%configure
+%configure \
+ --disable-shared
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-
install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
%{__make} install \
echo .so flex.1 > $RPM_BUILD_ROOT%{_mandir}/man1/lex.1
bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/README.flex-non-english-man-pages
+
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
-rm -f $RPM_BUILD_ROOT%{_mandir}/README.flex-non-english-man-pages
cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+# no external dependencies
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.la
+
%find_lang %{name}
%clean
rm -rf $RPM_BUILD_ROOT
-%post -p /sbin/postshell
+%post -p /sbin/postshell
-/usr/sbin/fix-info-dir -c %{_infodir}
-%postun -p /sbin/postshell
+%postun -p /sbin/postshell
-/usr/sbin/fix-info-dir -c %{_infodir}
%files -f %{name}.lang
%defattr(644,root,root,755)
-%doc AUTHORS COPYING ChangeLog NEWS README THANKS TODO
-%attr(755,root,root) %{_bindir}/*
-%{_mandir}/man1/*
+%doc AUTHORS COPYING NEWS README.md THANKS
+%attr(755,root,root) %{_bindir}/flex
+%attr(755,root,root) %{_bindir}/flex++
+%attr(755,root,root) %{_bindir}/lex
+%{_mandir}/man1/flex.1*
+%{_mandir}/man1/flex++.1*
+%{_mandir}/man1/lex.1*
%lang(es) %{_mandir}/es/man1/*
%lang(ja) %{_mandir}/ja/man1/*
%lang(pl) %{_mandir}/pl/man1/*
-%{_infodir}/flex*
-%{_libdir}/*.a
-%{_includedir}/*.h
+%{_infodir}/flex.info*
+%{_libdir}/libfl.a
+%{_includedir}/FlexLexer.h
+
+%if 0
+%files libs
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libfl.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libfl.so.2
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libfl.so
+%endif
%files examples
%defattr(644,root,root,755)