bison.spec 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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 versions
  26. %define V_release 1.35
  27. %define V_beta 1.875
  28. # package information
  29. Name: bison
  30. Summary: Yacc-compatible LALR(1) Parser Generator
  31. URL: http://www.gnu.org/software/bison/
  32. Vendor: Free Software Foundation
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG [CORE]
  35. Group: Language
  36. License: GPL
  37. Version: %{V_release}
  38. Release: 20030103
  39. # package options
  40. %option with_beta yes
  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 >= 20030103, make, m4
  49. PreReq: OpenPKG, openpkg >= 20030103, 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. %prep
  62. %setup0 -q -c -n bison-%{V_release}
  63. %if "%{with_beta}" == "yes"
  64. %setup1 -q -T -D -a 1
  65. %endif
  66. ( cd bison-%{V_beta}
  67. %patch -p0
  68. )
  69. %build
  70. ( cd bison-%{V_release}
  71. CC="%{l_cc}" \
  72. CFLAGS="%{l_cflags -O}" \
  73. CONFIG_SHELL=/bin/sh \
  74. ./configure \
  75. --prefix=%{l_prefix}
  76. %{l_make} -f Makefile %{l_mflags}
  77. )
  78. %if "%{with_beta}" == "yes"
  79. ( cd bison-%{V_beta}
  80. CC="%{l_cc}" \
  81. CFLAGS="%{l_cflags -O}" \
  82. CONFIG_SHELL=/bin/sh \
  83. ./configure \
  84. --prefix=%{l_prefix}
  85. %{l_make} -f Makefile %{l_mflags}
  86. )
  87. %endif
  88. %install
  89. rm -rf $RPM_BUILD_ROOT
  90. %if "%{with_beta}" == "yes"
  91. ( cd bison-%{V_beta}
  92. %{l_make} -f Makefile %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  93. mv $RPM_BUILD_ROOT%{l_prefix}/bin/bison \
  94. $RPM_BUILD_ROOT%{l_prefix}/bin/bison-beta
  95. mv $RPM_BUILD_ROOT%{l_prefix}/man/man1/bison.1 \
  96. $RPM_BUILD_ROOT%{l_prefix}/man/man1/bison-beta.1
  97. )
  98. %endif
  99. ( cd bison-%{V_release}
  100. %{l_make} -f Makefile %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  101. )
  102. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale
  103. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  104. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/charset.alias
  105. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  106. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  107. %files -f files
  108. %clean
  109. rm -rf $RPM_BUILD_ROOT