flex.spec 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. ##
  2. ## flex.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2001 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2001 Ralf S. Engelschall <rse@engelschall.com>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. %define V_branch devel
  25. %define V_release 2.5.4a
  26. %define V_release_maj 2.5.4
  27. %define V_release_min a
  28. %define V_devel 20011101
  29. %define V_devel_maj 2.5.6
  30. %define V_devel_min 2001-11-01
  31. # package information
  32. Name: flex
  33. Summary: Fast Lexical Analyzer Generator
  34. URL: http://www.gnu.org/software/flex/
  35. Vendor: Free Software Foundation
  36. Packager: The OpenPKG Project
  37. Distribution: OpenPKG [EXP]
  38. Group: Language
  39. License: BSD
  40. %if "%{V_branch}" == "release"
  41. Version: %{V_release}
  42. %else
  43. Version: %{V_devel}
  44. %endif
  45. Release: 20011121.0
  46. # list of sources
  47. %if "%{V_branch}" == "release"
  48. Source0: ftp://ftp.gnu.org/non-gnu/flex/flex-%{V_release}.tar.gz
  49. %else
  50. Source0: http://astro.temple.edu/~john43/flex/flex-%{V_devel_maj}-developer-%{V_devel_min}.tar.gz
  51. %endif
  52. # build information
  53. Prefix: %{l_prefix}
  54. BuildRoot: %{l_buildroot}
  55. BuildPreReq: OpenPKG, openpkg >= 0.9-20011025.0, bison, make
  56. PreReq: OpenPKG, openpkg >= 0.9-20011025.0
  57. AutoReq: no
  58. AutoReqProv: no
  59. %description
  60. Flex is a tool for generating scanners: programs which recognized lexical
  61. patterns in text. flex reads the given input files for a description of a
  62. scanner to generate. The description is in the form of pairs of regular
  63. expressions and C code, called rules. flex generates as output a C source
  64. file, lex.yy.c, which defines a routine yylex(). This file is compiled and
  65. linked with the -lfl library to produce an executable. When the executable
  66. is run, it analyzes its input for occurrences of the regular expressions.
  67. Whenever it finds one, it executes the corresponding C code.
  68. %prep
  69. %if "%{V_branch}" == "release"
  70. %setup -q -n flex-%{V_release_maj}
  71. %else
  72. %setup -q -n flex-%{V_devel_maj}
  73. %endif
  74. %build
  75. PATH="%{l_prefix}/bin:%{l_prefix}/sbin:$PATH"
  76. export PATH
  77. CC="%{l_cc}" \
  78. CFLAGS="%{l_cflags -O}" \
  79. ./configure \
  80. --prefix=$RPM_BUILD_ROOT%{l_prefix}
  81. %{l_make} %{l_mflags}
  82. %install
  83. rm -rf $RPM_BUILD_ROOT
  84. %{l_make} %{l_mflags} install
  85. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  86. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/flex++
  87. ln $RPM_BUILD_ROOT%{l_prefix}/bin/flex \
  88. $RPM_BUILD_ROOT%{l_prefix}/bin/flex++
  89. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  90. %files -f files
  91. %clean
  92. rm -rf $RPM_BUILD_ROOT