diff --git a/bison/bison.spec b/bison/bison.spec index 92d914e0ef..d37377dfd6 100644 --- a/bison/bison.spec +++ b/bison/bison.spec @@ -23,6 +23,15 @@ ## SUCH DAMAGE. ## +# package options +%ifndef with_beta +%define with_beta yes +%endif + +# package versions +%define V_release 1.35 +%define V_beta 1.50 + # package information Name: bison Summary: Yacc-compatible LALR(1) Parser Generator @@ -32,11 +41,12 @@ Packager: The OpenPKG Project Distribution: OpenPKG [CORE] Group: Language License: GPL -Version: 1.50 -Release: 20021008 +Version: %{V_release} +Release: 20021011 # list of sources -Source0: ftp://ftp.gnu.org/gnu/bison/bison-%{version}.tar.gz +Source0: ftp://ftp.gnu.org/gnu/bison/bison-%{V_release}.tar.gz +Source1: ftp://ftp.gnu.org/gnu/bison/bison-%{V_beta}.tar.gz Patch0: bison.patch # build information @@ -57,25 +67,56 @@ AutoReqProv: no with no change. Anyone familiar with yacc should be able to use bison with little trouble. + Options: + --define 'with_beta %{with_beta}' + %prep - %setup -q - %patch -p0 + %setup0 -q -c -n bison-%{V_release} +%if "%{with_beta}" == "yes" + %setup1 -q -T -D -a 1 +%endif + ( cd bison-%{V_beta} + %patch -p0 + ) %build - CC="%{l_cc}" \ - CFLAGS="%{l_cflags -O}" \ - CONFIG_SHELL=/bin/sh \ - ./configure \ - --prefix=%{l_prefix} - %{l_make} -f Makefile %{l_mflags} + ( cd bison-%{V_release} + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O}" \ + CONFIG_SHELL=/bin/sh \ + ./configure \ + --prefix=%{l_prefix} + %{l_make} -f Makefile %{l_mflags} + ) +%if "%{with_beta}" == "yes" + ( cd bison-%{V_beta} + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O}" \ + CONFIG_SHELL=/bin/sh \ + ./configure \ + --prefix=%{l_prefix} + %{l_make} -f Makefile %{l_mflags} + ) +%endif %install rm -rf $RPM_BUILD_ROOT - %{l_make} -f Makefile %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" - strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true +%if "%{with_beta}" == "yes" + ( cd bison-%{V_beta} + %{l_make} -f Makefile %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" + mv $RPM_BUILD_ROOT%{l_prefix}/bin/bison \ + $RPM_BUILD_ROOT%{l_prefix}/bin/bison-beta + mv $RPM_BUILD_ROOT%{l_prefix}/man/man1/bison.1 \ + $RPM_BUILD_ROOT%{l_prefix}/man/man1/bison-beta.1 + ) +%endif + ( cd bison-%{V_release} + %{l_make} -f Makefile %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" + ) + rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/charset.alias - rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} %files -f files