michael@22: ## michael@22: ## bison.spec -- OpenPKG RPM Package Specification michael@22: ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. michael@22: ## michael@22: ## Permission to use, copy, modify, and distribute this software for michael@22: ## any purpose with or without fee is hereby granted, provided that michael@22: ## the above copyright notice and this permission notice appear in all michael@22: ## copies. michael@22: ## michael@22: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@22: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@22: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@22: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@22: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@22: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@22: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@22: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@22: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@22: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@22: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@22: ## SUCH DAMAGE. michael@22: ## michael@22: michael@22: # package versions michael@22: %define V_new 2.4.1 michael@22: %define V_old 1.35 michael@22: michael@22: # package information michael@22: Name: bison michael@22: Summary: Yacc-compatible LALR(1) Parser Generator michael@22: URL: http://www.gnu.org/software/bison/ michael@22: Vendor: Free Software Foundation michael@22: Packager: OpenPKG Foundation e.V. michael@22: Distribution: OpenPKG Community michael@22: Class: CORE michael@22: Group: CompilerCompiler michael@22: License: GPL michael@22: Version: %{V_new} michael@24: Release: 20090106 michael@22: michael@22: # package options michael@22: %option with_old no michael@22: michael@22: # list of sources michael@22: Source0: ftp://ftp.gnu.org/gnu/bison/bison-%{V_new}.tar.gz michael@22: Source1: ftp://ftp.gnu.org/gnu/bison/bison-%{V_old}.tar.gz michael@22: Patch0: bison.patch michael@22: michael@22: # build information michael@22: Prefix: %{l_prefix} michael@22: BuildRoot: %{l_buildroot} michael@22: BuildPreReq: OpenPKG, openpkg >= 20040212, m4, make michael@22: PreReq: OpenPKG, openpkg >= 20040212, m4 michael@22: AutoReq: no michael@22: AutoReqProv: no michael@22: Conflicts: yacc michael@22: michael@22: %description michael@22: Bison is a general-purpose parser generator that converts a grammar michael@22: description for an LALR(1) context-free grammar into a C program michael@22: to parse that grammar. Once you are proficient with bison, you may michael@22: use it to develop a wide range of language parsers, from those used michael@22: in simple desk calculators to complex programming languages. Bison michael@22: is upward compatible with yacc: all properly-written yacc grammars michael@22: ought to work with bison with no change. Anyone familiar with yacc michael@22: should be able to use bison with little trouble. michael@22: michael@22: %track michael@22: prog bison:new = { michael@22: version = %{V_new} michael@22: url = ftp://ftp.gnu.org/gnu/bison/ michael@22: regex = bison-(2.\d+(.\d+)*[a-z]?)\.tar\.gz michael@22: } michael@22: prog bison:old = { michael@22: version = %{V_old} michael@22: url = ftp://ftp.gnu.org/gnu/bison/ michael@22: regex = bison-(1\.3\d+)\.tar\.gz michael@22: } michael@22: michael@22: %prep michael@22: %setup -q -c -n bison-%{V_new} michael@22: %patch -p0 -d bison-%{V_new} michael@22: %setup -q -T -D -a 1 michael@22: %{l_shtool} subst \ michael@22: -e 's;^\( *SUBDIRS = .*\) examples\(.*\)$;\1\2;' \ michael@22: bison-%{V_new}/Makefile.in michael@22: michael@22: %build michael@22: ( cd bison-%{V_new} michael@22: CC="%{l_cc}" \ michael@22: CFLAGS="%{l_cflags -O}" \ michael@22: ./configure \ michael@22: --prefix=%{l_prefix} \ michael@22: --mandir=%{l_prefix}/man \ michael@22: --infodir=%{l_prefix}/info \ michael@22: --disable-nls michael@22: %{l_make} -f Makefile %{l_mflags} michael@22: ) || exit $? michael@22: %if "%{with_old}" == "yes" michael@22: ( cd bison-%{V_old} michael@22: CC="%{l_cc}" \ michael@22: CFLAGS="%{l_cflags -O}" \ michael@22: ./configure \ michael@22: --prefix=%{l_prefix} \ michael@22: --mandir=%{l_prefix}/man \ michael@22: --infodir=%{l_prefix}/info \ michael@22: --disable-nls michael@22: %{l_make} -f Makefile %{l_mflags} michael@22: ) || exit $? michael@22: %endif michael@22: michael@22: %install michael@22: rm -rf $RPM_BUILD_ROOT michael@22: %if "%{with_old}" == "yes" michael@22: ( cd bison-%{V_old} michael@22: %{l_make} -f Makefile %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" michael@22: mv $RPM_BUILD_ROOT%{l_prefix}/bin/bison \ michael@22: $RPM_BUILD_ROOT%{l_prefix}/bin/bison-old michael@22: mv $RPM_BUILD_ROOT%{l_prefix}/man/man1/bison.1 \ michael@22: $RPM_BUILD_ROOT%{l_prefix}/man/man1/bison-old.1 michael@22: ) || exit $? michael@22: %endif michael@22: ( cd bison-%{V_new} michael@22: %{l_make} -f Makefile %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" michael@22: ) || exit $? michael@22: rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale michael@22: rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir michael@22: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/charset.alias michael@22: strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true michael@22: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} michael@22: michael@22: %files -f files michael@22: michael@22: %clean michael@22: rm -rf $RPM_BUILD_ROOT michael@22: