# Source0-md5: 26e76218c2a50a0dd307286d42eb0af9
Source1: %{name}.1.pl
Patch0: %{name}-info.patch
+Patch1: no_libtextstyle.patch
URL: http://www.gnu.org/software/bison/
BuildRequires: flex
BuildRequires: gcc >= 5:3.2
BuildRequires: tar >= 1:1.22
BuildRequires: texinfo >= 4.0
Requires: %{name}-runtime = %{version}-%{release}
-Requires: libtextstyle >= 0.20.5
+%{?with_libtextstyle:Requires: libtextstyle >= 0.20.5}
Requires: m4 >= 1.4.6
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%prep
%setup -q
%patch0 -p1
+%{!?with_libtextstyle:%patch1 -p1}
%{__rm} po/stamp-po
%build
+%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
%configure \
--disable-silent-rules
%{__make}
--- /dev/null
+diff -ur bison-3.8.2.orig/m4/libtextstyle-optional.m4 bison-3.8.2/m4/libtextstyle-optional.m4
+--- bison-3.8.2.orig/m4/libtextstyle-optional.m4 2021-03-10 06:41:25.000000000 +0100
++++ bison-3.8.2/m4/libtextstyle-optional.m4 2022-08-28 12:38:58.097300031 +0200
+@@ -21,14 +21,9 @@
+
+ AC_DEFUN([gl_LIBTEXTSTYLE_OPTIONAL],
+ [
+- gl_LIBTEXTSTYLE([$1])
+- if test $HAVE_LIBTEXTSTYLE = yes; then
+- TEXTSTYLE_H=
+- else
+- TEXTSTYLE_H=textstyle.h
+- AC_REQUIRE([AC_C_INLINE])
+- AC_CHECK_FUNCS_ONCE([tcdrain])
+- fi
++ TEXTSTYLE_H=textstyle.h
++ AC_REQUIRE([AC_C_INLINE])
++ AC_CHECK_FUNCS_ONCE([tcdrain])
+ AC_SUBST([TEXTSTYLE_H])
+ AM_CONDITIONAL([GL_GENERATE_TEXTSTYLE_H], [test -n "$TEXTSTYLE_H"])
+ ])