flex.spec 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. ##
  2. ## flex.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2002 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2002 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. %ifndef with_branch
  27. %define with_branch release
  28. %endif
  29. # package versions
  30. %define V_release 2.5.4a
  31. %define V_release_maj 2.5.4
  32. %define V_release_min a
  33. %define V_devel 2.5.6s20020228
  34. %define V_devel_maj 2.5.6
  35. %define V_devel_min 2002-02-28
  36. # package information
  37. Name: flex
  38. Summary: Fast Lexical Analyzer Generator
  39. URL: http://www.gnu.org/software/flex/
  40. Vendor: Free Software Foundation
  41. Packager: The OpenPKG Project
  42. Distribution: OpenPKG [REL]
  43. Group: Language
  44. License: BSD
  45. %if "%{with_branch}" == "release"
  46. Version: %{V_release}
  47. %else
  48. Version: %{V_devel}
  49. %endif
  50. Release: 20020313
  51. # list of sources
  52. %if "%{with_branch}" == "release"
  53. Source0: ftp://ftp.gnu.org/non-gnu/flex/flex-%{V_release}.tar.gz
  54. %else
  55. Source0: http://astro.temple.edu/~john43/flex/flex-%{V_devel_maj}-developer-%{V_devel_min}.tar.gz
  56. %endif
  57. # build information
  58. Prefix: %{l_prefix}
  59. BuildRoot: %{l_buildroot}
  60. BuildPreReq: OpenPKG, openpkg >= 20020206, bison, make
  61. PreReq: OpenPKG, openpkg >= 20020206
  62. AutoReq: no
  63. AutoReqProv: no
  64. %description
  65. Flex is a tool for generating scanners: programs which recognized lexical
  66. patterns in text. flex reads the given input files for a description of a
  67. scanner to generate. The description is in the form of pairs of regular
  68. expressions and C code, called rules. flex generates as output a C source
  69. file, lex.yy.c, which defines a routine yylex(). This file is compiled and
  70. linked with the -lfl library to produce an executable. When the executable
  71. is run, it analyzes its input for occurrences of the regular expressions.
  72. Whenever it finds one, it executes the corresponding C code.
  73. Options: with_branch=%{with_branch}
  74. %prep
  75. %if "%{with_branch}" == "release"
  76. %setup -q -n flex-%{V_release_maj}
  77. %else
  78. %setup -q -n flex-%{V_devel_maj}
  79. %endif
  80. %build
  81. PATH="%{l_prefix}/bin:%{l_prefix}/sbin:$PATH"
  82. export PATH
  83. CC="%{l_cc}" \
  84. CFLAGS="%{l_cflags -O}" \
  85. ./configure \
  86. --prefix=$RPM_BUILD_ROOT%{l_prefix}
  87. %{l_make} %{l_mflags}
  88. %install
  89. rm -rf $RPM_BUILD_ROOT
  90. %{l_make} %{l_mflags} install
  91. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  92. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/flex++
  93. ln $RPM_BUILD_ROOT%{l_prefix}/bin/flex \
  94. $RPM_BUILD_ROOT%{l_prefix}/bin/flex++
  95. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  96. %files -f files
  97. %clean
  98. rm -rf $RPM_BUILD_ROOT