flex.spec 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. %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 20011203
  30. %define V_devel_maj 2.5.6
  31. %define V_devel_min 2001-12-03
  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: 20011213
  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 >= 20011227, bison, make
  57. %if "%{V_branch}" == "devel"
  58. BuildPreReq: autoconf, automake
  59. %endif
  60. PreReq: OpenPKG, openpkg >= 20011227
  61. AutoReq: no
  62. AutoReqProv: no
  63. %description
  64. Flex is a tool for generating scanners: programs which recognized lexical
  65. patterns in text. flex reads the given input files for a description of a
  66. scanner to generate. The description is in the form of pairs of regular
  67. expressions and C code, called rules. flex generates as output a C source
  68. file, lex.yy.c, which defines a routine yylex(). This file is compiled and
  69. linked with the -lfl library to produce an executable. When the executable
  70. is run, it analyzes its input for occurrences of the regular expressions.
  71. Whenever it finds one, it executes the corresponding C code.
  72. %prep
  73. %if "%{V_branch}" == "release"
  74. %setup -q -n flex-%{V_release_maj}
  75. %else
  76. %setup -q -n flex
  77. %endif
  78. %build
  79. PATH="%{l_prefix}/bin:%{l_prefix}/sbin:$PATH"
  80. export PATH
  81. %if "%{V_branch}" == "devel"
  82. ./autogen.sh
  83. %endif
  84. CC="%{l_cc}" \
  85. CFLAGS="%{l_cflags -O}" \
  86. ./configure \
  87. --prefix=$RPM_BUILD_ROOT%{l_prefix}
  88. %{l_make} %{l_mflags}
  89. %install
  90. rm -rf $RPM_BUILD_ROOT
  91. %{l_make} %{l_mflags} install
  92. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  93. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/flex++
  94. ln $RPM_BUILD_ROOT%{l_prefix}/bin/flex \
  95. $RPM_BUILD_ROOT%{l_prefix}/bin/flex++
  96. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  97. %files -f files
  98. %clean
  99. rm -rf $RPM_BUILD_ROOT