bison.spec 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. ##
  2. ## bison.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package options
  26. %option with_beta yes
  27. # package versions
  28. %define V_release 1.35
  29. %define V_beta 1.75
  30. # package information
  31. Name: bison
  32. Summary: Yacc-compatible LALR(1) Parser Generator
  33. URL: http://www.gnu.org/software/bison/
  34. Vendor: Free Software Foundation
  35. Packager: The OpenPKG Project
  36. Distribution: OpenPKG [CORE]
  37. Group: Language
  38. License: GPL
  39. Version: %{V_release}
  40. Release: 20021230
  41. # list of sources
  42. Source0: ftp://ftp.gnu.org/gnu/bison/bison-%{V_release}.tar.gz
  43. Source1: ftp://ftp.gnu.org/gnu/bison/bison-%{V_beta}.tar.gz
  44. Patch0: bison.patch
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20021230, make, m4
  49. PreReq: OpenPKG, openpkg >= 20021230, m4
  50. AutoReq: no
  51. AutoReqProv: no
  52. %description
  53. Bison is a general-purpose parser generator that converts a grammar
  54. description for an LALR(1) context-free grammar into a C program to parse
  55. that grammar. Once you are proficient with bison, you may use it to
  56. develop a wide range of language parsers, from those used in simple desk
  57. calculators to complex programming languages. Bison is upward compatible
  58. with yacc: all properly-written yacc grammars ought to work with bison
  59. with no change. Anyone familiar with yacc should be able to use bison with
  60. little trouble.
  61. %options
  62. %prep
  63. %setup0 -q -c -n bison-%{V_release}
  64. %if "%{with_beta}" == "yes"
  65. %setup1 -q -T -D -a 1
  66. %endif
  67. ( cd bison-%{V_beta}
  68. %patch -p0
  69. )
  70. %build
  71. ( cd bison-%{V_release}
  72. CC="%{l_cc}" \
  73. CFLAGS="%{l_cflags -O}" \
  74. CONFIG_SHELL=/bin/sh \
  75. ./configure \
  76. --prefix=%{l_prefix}
  77. %{l_make} -f Makefile %{l_mflags}
  78. )
  79. %if "%{with_beta}" == "yes"
  80. ( cd bison-%{V_beta}
  81. CC="%{l_cc}" \
  82. CFLAGS="%{l_cflags -O}" \
  83. CONFIG_SHELL=/bin/sh \
  84. ./configure \
  85. --prefix=%{l_prefix}
  86. %{l_make} -f Makefile %{l_mflags}
  87. )
  88. %endif
  89. %install
  90. rm -rf $RPM_BUILD_ROOT
  91. %if "%{with_beta}" == "yes"
  92. ( cd bison-%{V_beta}
  93. %{l_make} -f Makefile %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  94. mv $RPM_BUILD_ROOT%{l_prefix}/bin/bison \
  95. $RPM_BUILD_ROOT%{l_prefix}/bin/bison-beta
  96. mv $RPM_BUILD_ROOT%{l_prefix}/man/man1/bison.1 \
  97. $RPM_BUILD_ROOT%{l_prefix}/man/man1/bison-beta.1
  98. )
  99. %endif
  100. ( cd bison-%{V_release}
  101. %{l_make} -f Makefile %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  102. )
  103. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale
  104. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  105. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/charset.alias
  106. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  107. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  108. %files -f files
  109. %clean
  110. rm -rf $RPM_BUILD_ROOT