| 1 | Summary: A GNU general-purpose parser generator
|
|---|
| 2 | Name: bison
|
|---|
| 3 | Version: 2.5
|
|---|
| 4 | Release: 2%{?dist}
|
|---|
| 5 | License: GPLv2+
|
|---|
| 6 | Group: Development/Tools
|
|---|
| 7 | Source: ftp://ftp.gnu.org/pub/gnu/bison/bison-%{version}.tar.bz2
|
|---|
| 8 | Patch0: bison-os2.patch
|
|---|
| 9 | #Patch1: bison-2.4-reap_subpipe.patch
|
|---|
| 10 | URL: http://www.gnu.org/software/bison/
|
|---|
| 11 | BuildRoot: %{_tmppath}/%{name}-root
|
|---|
| 12 | BuildRequires: m4 >= 1.4
|
|---|
| 13 | #BuildRequires: java-1.6.0-openjdk-devel
|
|---|
| 14 |
|
|---|
| 15 | Requires: m4 >= 1.4
|
|---|
| 16 |
|
|---|
| 17 | %description
|
|---|
| 18 | Bison is a general purpose parser generator that converts a grammar
|
|---|
| 19 | description for an LALR(1) context-free grammar into a C program to
|
|---|
| 20 | parse that grammar. Bison can be used to develop a wide range of
|
|---|
| 21 | language parsers, from ones used in simple desk calculators to complex
|
|---|
| 22 | programming languages. Bison is upwardly compatible with Yacc, so any
|
|---|
| 23 | correctly written Yacc grammar should work with Bison without any
|
|---|
| 24 | changes. If you know Yacc, you shouldn't have any trouble using
|
|---|
| 25 | Bison. You do need to be very proficient in C programming to be able
|
|---|
| 26 | to use Bison. Bison is only needed on systems that are used for
|
|---|
| 27 | development.
|
|---|
| 28 |
|
|---|
| 29 | If your system will be used for C development, you should install
|
|---|
| 30 | Bison.
|
|---|
| 31 |
|
|---|
| 32 | %package devel
|
|---|
| 33 | Summary: -ly library for development using Bison-generated parsers
|
|---|
| 34 | Group: Development/Libraries
|
|---|
| 35 |
|
|---|
| 36 | %description devel
|
|---|
| 37 | The bison-devel package contains the -ly library sometimes used by
|
|---|
| 38 | programs using Bison-generated parsers. If you are developing programs
|
|---|
| 39 | using Bison, you might want to link with this library. This library
|
|---|
| 40 | is not required by all Bison-generated parsers, but may be employed by
|
|---|
| 41 | simple programs to supply minimal support for the generated parsers.
|
|---|
| 42 |
|
|---|
| 43 | # -ly is kept static. It only contains two symbols: main and yyerror,
|
|---|
| 44 | # and both of these are extremely simple (couple lines of C total).
|
|---|
| 45 | # It doesn't really pay off to introduce a shared library for that.
|
|---|
| 46 | #
|
|---|
| 47 | # Therefore -devel subpackage could have been created as -static, but
|
|---|
| 48 | # the split was done in Jan 2005, which predates current guidelines.
|
|---|
| 49 | # Besides there is logic to that: the library is devel in the sense
|
|---|
| 50 | # that the generated parser could be distributed together with other
|
|---|
| 51 | # sources, and only bison-devel would be necessary to wrap the build.
|
|---|
| 52 |
|
|---|
| 53 | %package runtime
|
|---|
| 54 | Summary: Runtime support files used by Bison-generated parsers
|
|---|
| 55 | Group: Development/Libraries
|
|---|
| 56 |
|
|---|
| 57 | %description runtime
|
|---|
| 58 | The bison-runtime package contains files used at runtime by parsers
|
|---|
| 59 | that Bison generates. Packages whose binaries contain parsers
|
|---|
| 60 | generated by Bison should depend on bison-runtime to ensure that
|
|---|
| 61 | these files are available. See the Internationalization in the
|
|---|
| 62 | Bison manual section for more information.
|
|---|
| 63 |
|
|---|
| 64 | %prep
|
|---|
| 65 | %setup -q
|
|---|
| 66 | %patch0 -p1
|
|---|
| 67 | #%patch1 -p1
|
|---|
| 68 |
|
|---|
| 69 | %build
|
|---|
| 70 | export CONFIG_SHELL="/@unixroot/usr/bin/sh.exe"
|
|---|
| 71 | export LDFLAGS="-Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
|
|---|
| 72 | export LIBS="-lurpo -lmmap"
|
|---|
| 73 | export M4="/@unixroot/usr/bin/m4.exe"
|
|---|
| 74 | %configure \
|
|---|
| 75 | "--cache-file=%{_topdir}/cache/%{name}-%{_target_cpu}.cache"
|
|---|
| 76 | make %{?_smp_mflags}
|
|---|
| 77 |
|
|---|
| 78 | #%check
|
|---|
| 79 | #make check
|
|---|
| 80 | #make maintainer-check
|
|---|
| 81 |
|
|---|
| 82 | %install
|
|---|
| 83 | rm -rf $RPM_BUILD_ROOT
|
|---|
| 84 | %makeinstall
|
|---|
| 85 |
|
|---|
| 86 | # Remove unpackaged files.
|
|---|
| 87 | rm -f $RPM_BUILD_ROOT/%{_bindir}/yacc
|
|---|
| 88 | rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
|
|---|
| 89 | rm -f $RPM_BUILD_ROOT/%{_mandir}/man1/yacc*
|
|---|
| 90 | rm -f $RPM_BUILD_ROOT/%{_libdir}/charset.alias
|
|---|
| 91 |
|
|---|
| 92 | #%find_lang %{name}
|
|---|
| 93 | #%find_lang %{name}-runtime
|
|---|
| 94 |
|
|---|
| 95 | gzip -9nf ${RPM_BUILD_ROOT}%{_infodir}/bison.info*
|
|---|
| 96 |
|
|---|
| 97 | # The distribution contains also source files. These are used by m4
|
|---|
| 98 | # when the target parser file is generated.
|
|---|
| 99 | %files
|
|---|
| 100 | %defattr(-,root,root)
|
|---|
| 101 | %doc AUTHORS ChangeLog NEWS OChangeLog README THANKS TODO
|
|---|
| 102 | %{_mandir}/*/bison*
|
|---|
| 103 | %{_datadir}/bison
|
|---|
| 104 | %{_infodir}/bison.info*
|
|---|
| 105 | %{_bindir}/bison.exe
|
|---|
| 106 | %{_datadir}/aclocal/bison*.m4
|
|---|
| 107 | %{_datadir}/locale/*
|
|---|
| 108 |
|
|---|
| 109 | %files devel
|
|---|
| 110 | %defattr(-,root,root)
|
|---|
| 111 | %{_libdir}/liby.a
|
|---|
| 112 |
|
|---|
| 113 | #%files runtime
|
|---|
| 114 | #%defattr(-,root,root)
|
|---|
| 115 | #%{_datadir}/locale/bison-runtime.*
|
|---|
| 116 |
|
|---|
| 117 | %clean
|
|---|
| 118 | rm -rf $RPM_BUILD_ROOT
|
|---|
| 119 |
|
|---|
| 120 | %changelog
|
|---|
| 121 | * Tue Feb 28 2012 yd
|
|---|
| 122 | - fixed m4 executable location.
|
|---|
| 123 |
|
|---|
| 124 | * Fri Jan 06 2012 yd
|
|---|
| 125 | - initial unixroot build.
|
|---|