1Summary: public domain Berkeley LALR Yacc parser generator 2 3%global AppVersion 2.0 4%global AppPatched 20230201 5 6%global AltProgram byacc2 7%global UseProgram yacc 8 9# $Id: byacc.spec,v 1.70 2023/02/02 00:12:06 tom Exp $ 10Name: byacc 11Version: %{AppVersion}.%{AppPatched} 12Release: 1 13License: Public Domain, MIT 14URL: https://invisible-island.net/%{name}/ 15Source0: https://invisible-mirror.net/archives/%{name}/%{name}-%{AppPatched}.tgz 16 17%description 18This package provides a parser generator utility that reads a grammar 19specification from a file and generates an LR(1) parser for it. The 20parsers consist of a set of LALR(1) parsing tables and a driver 21routine written in the C programming language. It has a public domain 22license which includes the generated C. 23 24%package -n byacc2 25Summary: public domain Berkeley LALR Yacc parser generator with backtracking 26 27%description -n byacc2 28This package provides a parser generator utility that reads a grammar 29specification from a file and generates an LR(1) parser for it. The 30parsers consist of a set of LALR(1) parsing tables and a driver 31routine written in the C programming language. It has a public domain 32license which includes the generated C. 33 34This package has the backtracking extension. 35 36%prep 37 38%global debug_package %{nil} 39 40%setup -q -n %{name}-%{AppPatched} 41 42%build 43%define my_srcdir .. 44%define CFG_OPTS \\\ 45 --verbose \\\ 46 --disable-echo \\\ 47 --enable-stdnoreturn \\\ 48 --target %{_target_platform} \\\ 49 --prefix=%{_prefix} \\\ 50 --srcdir=%{my_srcdir} \\\ 51 --bindir=%{_bindir} \\\ 52 --libdir=%{_libdir} \\\ 53 --mandir=%{_mandir} 54 55%global _configure ../configure 56 57mkdir BUILD-byacc 58pushd BUILD-byacc 59CONFIGURE_TOP=%{my_srcdir} \ 60%configure %{CFG_OPTS} \ 61 --program-prefix=b \ 62make 63popd 64 65mkdir BUILD-byacc2 66pushd BUILD-byacc2 67CONFIGURE_TOP=%{my_srcdir} \ 68%configure %{CFG_OPTS} \ 69 --enable-btyacc \ 70 --program-transform-name='s,\<yacc,byacc2,g' \ 71 --with-max-table-size=123456 \ 72make 73popd 74 75%install 76[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT 77 78pushd BUILD-byacc 79make install DESTDIR=$RPM_BUILD_ROOT 80( cd $RPM_BUILD_ROOT%{_bindir} && ln -vs %{name} %{UseProgram} ) 81popd 82 83pushd BUILD-byacc2 84make install DESTDIR=$RPM_BUILD_ROOT 85popd 86 87%clean 88[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT 89 90%files 91%doc ACKNOWLEDGEMENTS CHANGES NEW_FEATURES NOTES NO_WARRANTY README 92%license LICENSE 93%{_bindir}/%{name} 94%{_bindir}/%{UseProgram} 95%{_mandir}/man1/%{name}.* 96 97%files -n byacc2 98%doc ACKNOWLEDGEMENTS CHANGES NEW_FEATURES NOTES NO_WARRANTY README README.BTYACC 99%license LICENSE 100%{_bindir}/%{AltProgram} 101%{_mandir}/man1/%{AltProgram}.* 102 103%changelog 104# each patch should add its ChangeLog entries here 105 106* Sun Jan 09 2022 Thomas Dickey 107- rpmlint 108 109* Sat Jan 01 2022 Thomas Dickey 110- rename btyacc package to byacc2 to co-exist with traditional btyacc 111 112* Fri May 25 2018 Thomas Dickey 113- add btyacc package 114 115* Sun Jul 09 2017 Thomas Dickey 116- use predefined "configure" 117 118* Sun Jun 06 2010 Thomas Dickey 119- initial version 120