-# NOTE: 2.5.35+ can't deal with "[[" "]]" strings in sources, needs workarounds like space separation
-# (or update of m4-quotes patch)
+# 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.37
+Version: 2.6.4
Release: 1
License: BSD-like
Group: Development/Tools
-Source0: http://downloads.sourceforge.net/flex/%{name}-%{version}.tar.bz2
-# Source0-md5: c75940e1fc25108f2a7b3ef42abdae06
+#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
-Patch1: %{name}-locale.patch
-Patch2: %{name}-gcc44.patch
-# patch #869230 (second version of bug #720983 fix - from flex BTS)
-# outdated as for 2.5.34+, but contains testcase
-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 >= 1:1.10
+BuildRequires: automake >= 1:1.14.1
BuildRequires: bison
# to rebuild scan.c from scan.l (m4-quotes patch)
#BuildRequires: flex
-BuildRequires: gettext-devel >= 0.12
+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)
%patch0 -p1
%patch1 -p1
%patch2 -p1
-#%patch3 -p1
# force regeneration (just in case make didn't want to)
-%{__rm} 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 \
cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+# no external dependencies
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.la
+
%find_lang %{name}
%clean
%files -f %{name}.lang
%defattr(644,root,root,755)
-%doc AUTHORS COPYING ChangeLog NEWS README THANKS TODO
+%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
%lang(pl) %{_mandir}/pl/man1/*
%{_infodir}/flex.info*
%{_libdir}/libfl.a
-%{_libdir}/libfl_pic.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)
%{_examplesdir}/%{name}-%{version}