dragon.spec 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. ##
  2. ## dragon.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package version
  24. %define V_base 1.1.13
  25. %define V_dragon 1.3.0
  26. # package information
  27. Name: dragon
  28. Summary: Dragon Parser Generator
  29. URL: http://www.lemke-it.com/opensource.html
  30. Vendor: Björn Lemke
  31. Packager: OpenPKG Foundation e.V.
  32. Distribution: OpenPKG Community
  33. Class: EVAL
  34. Group: CompilerCompiler
  35. License: GPL
  36. Version: %{V_dragon}
  37. Release: 20090206
  38. # list of sources
  39. Source0: http://www.lemke-it.com/base-%{V_base}.tar.gz
  40. Source1: http://www.lemke-it.com/dragon-%{V_dragon}.tar.gz
  41. Patch0: dragon.patch
  42. # build information
  43. Prefix: %{l_prefix}
  44. BuildRoot: %{l_buildroot}
  45. BuildPreReq: OpenPKG, openpkg >= 20060823, gcc, gcc::with_cxx = yes
  46. PreReq: OpenPKG, openpkg >= 20060823
  47. AutoReq: no
  48. AutoReqProv: no
  49. %description
  50. The dragon software package implements a combined scanner/parser
  51. generator for LR compliant grammar definitions. The generated
  52. C++ parser class is used as a super class from which a parser
  53. implementation class must be derived. The implementation class
  54. implements the scanner feed methods but also all required semantic
  55. action method. dragon has been used for several large projects with
  56. complex grammar defintions (about 200 productions / 80 tokens).
  57. Since for those grammar defintions, the analyse phase to build up
  58. the parse table is quite CPU intensive, it is recommended to use
  59. state of the art hardware. dragon requires the base package to get
  60. compiled but also for the compilation of the generated C++ code.
  61. %track
  62. prog dragon:base = {
  63. version = %{V_base}
  64. url = http://www.lemke-it.com/opensource.html
  65. regex = base-(__VER__)\.tar\.gz
  66. }
  67. prog dragon:dragon = {
  68. version = %{V_dragon}
  69. url = http://www.lemke-it.com/opensource.html
  70. regex = dragon-(__VER__)\.tar\.gz
  71. }
  72. %prep
  73. %setup -q -c
  74. %setup -q -T -D -a 1
  75. %patch -p0
  76. %build
  77. ( cd base
  78. export CC="%{l_cc}"
  79. export CXX="%{l_cxx}"
  80. export CFLAGS="%{l_cflags -O}"
  81. export CXXFLAGS="%{l_cxxflags -O}"
  82. export CPPFLAGS="%{l_cppflags}"
  83. export LDFLAGS="%{l_ldflags}"
  84. ./configure \
  85. --prefix=%{l_prefix}
  86. %{l_make} %{l_mflags}
  87. ) || exit $?
  88. ( cd dragon
  89. export CC="%{l_cc}"
  90. export CXX="%{l_cxx}"
  91. export CFLAGS="%{l_cflags -O}"
  92. export CXXFLAGS="%{l_cxxflags -O}"
  93. export CPPFLAGS="%{l_cppflags} -I`pwd`/../base/src"
  94. export LDFLAGS="%{l_ldflags} -L`pwd`/../base/src"
  95. ./configure \
  96. --prefix=%{l_prefix}
  97. %{l_make} %{l_mflags}
  98. ) || exit $?
  99. %install
  100. rm -rf $RPM_BUILD_ROOT
  101. %{l_shtool} mkdir -f -p -m 755 \
  102. $RPM_BUILD_ROOT%{l_prefix}/bin \
  103. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  104. $RPM_BUILD_ROOT%{l_prefix}/share/dragon
  105. ( cd dragon
  106. %{l_make} %{l_mflags} install PREFIX=$RPM_BUILD_ROOT%{l_prefix}
  107. ) || exit $?
  108. %{l_shtool} install -c -m 644 \
  109. dragon/man/dragon.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  110. %{l_shtool} install -c -m 644 \
  111. dragon/doc/dragon.pdf $RPM_BUILD_ROOT%{l_prefix}/share/dragon/
  112. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  113. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  114. %{l_files_std} \
  115. '%doc %{l_prefix}/share/dragon/*'
  116. %files -f files
  117. %clean
  118. rm -rf $RPM_BUILD_ROOT