flex.spec 3.6 KB

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