| 1 | # devel is not buildable due to unresolved externals
|
|---|
| 2 | %define build_devel 0
|
|---|
| 3 |
|
|---|
| 4 | Summary: A tool for creating scanners (text pattern recognizers)
|
|---|
| 5 | Name: flex
|
|---|
| 6 | Version: 2.6.4
|
|---|
| 7 | Release: 1%{?dist}
|
|---|
| 8 | # parse.c and parse.h are under GPLv3+ with exception which allows
|
|---|
| 9 | # relicensing. Since flex is shipped under BDS-style license,
|
|---|
| 10 | # let's assume that the relicensing was done.
|
|---|
| 11 | # gettext.h (copied from gnulib) is under LGPLv2+
|
|---|
| 12 | License: BSD and LGPLv2+
|
|---|
| 13 | URL: https://github.com/westes/flex
|
|---|
| 14 | Group: Development/Tools
|
|---|
| 15 | %scm_source github https://github.com/bitwiseworks/%{name}-os2 %{version}-os2
|
|---|
| 16 |
|
|---|
| 17 | Requires: m4
|
|---|
| 18 | BuildRequires: gettext gettext-devel bison m4 help2man gcc automake libtool
|
|---|
| 19 |
|
|---|
| 20 | %description
|
|---|
| 21 | The flex program generates scanners. Scanners are programs which can
|
|---|
| 22 | recognize lexical patterns in text. Flex takes pairs of regular
|
|---|
| 23 | expressions and C code as input and generates a C source file as
|
|---|
| 24 | output. The output file is compiled and linked with a library to
|
|---|
| 25 | produce an executable. The executable searches through its input for
|
|---|
| 26 | occurrences of the regular expressions. When a match is found, it
|
|---|
| 27 | executes the corresponding C code. Flex was designed to work with
|
|---|
| 28 | both Yacc and Bison, and is used by many programs as part of their
|
|---|
| 29 | build process.
|
|---|
| 30 |
|
|---|
| 31 | You should install flex if you are going to use your system for
|
|---|
| 32 | application development.
|
|---|
| 33 |
|
|---|
| 34 | # We keep the libraries in separate sub-package to allow for multilib
|
|---|
| 35 | # installations of flex.
|
|---|
| 36 | %if %{build_devel}
|
|---|
| 37 | %package devel
|
|---|
| 38 | Summary: Libraries for flex scanner generator
|
|---|
| 39 | Obsoletes: flex-static < 2.5.35-15
|
|---|
| 40 | Provides: flex-static
|
|---|
| 41 |
|
|---|
| 42 | %description devel
|
|---|
| 43 |
|
|---|
| 44 | This package contains the library with default implementations of
|
|---|
| 45 | `main' and `yywrap' functions that the client binary can choose to use
|
|---|
| 46 | instead of implementing their own.
|
|---|
| 47 | %endif
|
|---|
| 48 |
|
|---|
| 49 | %package doc
|
|---|
| 50 | Summary: Documentation for flex scanner generator
|
|---|
| 51 |
|
|---|
| 52 | %description doc
|
|---|
| 53 |
|
|---|
| 54 | This package contains documentation for flex scanner generator in
|
|---|
| 55 | plain text and PDF formats.
|
|---|
| 56 |
|
|---|
| 57 | %debug_package
|
|---|
| 58 |
|
|---|
| 59 | %prep
|
|---|
| 60 | %scm_setup
|
|---|
| 61 |
|
|---|
| 62 | %build
|
|---|
| 63 | autoreconf -fvi
|
|---|
| 64 |
|
|---|
| 65 | export LDFLAGS="-Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
|
|---|
| 66 | export LIBS="-lcx"
|
|---|
| 67 | %if %{build_devel}
|
|---|
| 68 | %global conf_flags ""
|
|---|
| 69 | %else
|
|---|
| 70 | %global conf_flags "--disable-libfl"
|
|---|
| 71 | %endif
|
|---|
| 72 | %configure --docdir=%{_pkgdocdir} %{conf_flags}
|
|---|
| 73 | make %{?_smp_mflags}
|
|---|
| 74 |
|
|---|
| 75 | %install
|
|---|
| 76 | rm -rf $RPM_BUILD_ROOT
|
|---|
| 77 | make DESTDIR=$RPM_BUILD_ROOT install
|
|---|
| 78 | rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
|
|---|
| 79 | rm -f $RPM_BUILD_ROOT/%{_pkgdocdir}/README.cvs
|
|---|
| 80 | rm -f $RPM_BUILD_ROOT/%{_pkgdocdir}/TODO
|
|---|
| 81 | # For now, excluding the new .la and .so files as we haven't had
|
|---|
| 82 | # any requests for them and adding them will require a new subpackage.
|
|---|
| 83 | # The .so files contain 2 optional implementations of main and yywrap
|
|---|
| 84 | # for developer convenience. They are also available in the .a file
|
|---|
| 85 | # provided in flex-devel.
|
|---|
| 86 | find %{buildroot} -name '*.la' -delete
|
|---|
| 87 | find %{buildroot} -name '*.dll' -delete
|
|---|
| 88 |
|
|---|
| 89 | ( cd ${RPM_BUILD_ROOT}
|
|---|
| 90 | rm -f .%{_bindir}/flex++.exe
|
|---|
| 91 | ln -sf flex.exe .%{_bindir}/lex
|
|---|
| 92 | ln -sf flex.exe .%{_bindir}/flex++
|
|---|
| 93 | ln -s flex.1 .%{_mandir}/man1/lex.1
|
|---|
| 94 | ln -s flex.1 .%{_mandir}/man1/flex++.1
|
|---|
| 95 | %if %{build_devel}
|
|---|
| 96 | ln -s libfl.a .%{_libdir}/libl.a
|
|---|
| 97 | %endif
|
|---|
| 98 | )
|
|---|
| 99 |
|
|---|
| 100 | %find_lang flex
|
|---|
| 101 |
|
|---|
| 102 | %check
|
|---|
| 103 | echo ============TESTING===============
|
|---|
| 104 | make check
|
|---|
| 105 | echo ============END TESTING===========
|
|---|
| 106 |
|
|---|
| 107 | %files -f flex.lang
|
|---|
| 108 | %dir %{_pkgdocdir}
|
|---|
| 109 | %license COPYING
|
|---|
| 110 | %{_pkgdocdir}/NEWS
|
|---|
| 111 | %{_pkgdocdir}/README.md
|
|---|
| 112 | %{_bindir}/*
|
|---|
| 113 | %exclude %{_bindir}/*.dbg
|
|---|
| 114 | %{_mandir}/man1/*
|
|---|
| 115 | %{_includedir}/FlexLexer.h
|
|---|
| 116 | %{_infodir}/flex.info*
|
|---|
| 117 |
|
|---|
| 118 | %if %{build_devel}
|
|---|
| 119 | %files devel
|
|---|
| 120 | %dir %{_pkgdocdir}
|
|---|
| 121 | %license COPYING
|
|---|
| 122 | %{_libdir}/*.a
|
|---|
| 123 | %endif
|
|---|
| 124 |
|
|---|
| 125 | %files doc
|
|---|
| 126 | %{_pkgdocdir}
|
|---|
| 127 | %exclude %{_pkgdocdir}/NEWS
|
|---|
| 128 | %exclude %{_pkgdocdir}/README.md
|
|---|
| 129 |
|
|---|
| 130 | %changelog
|
|---|
| 131 | * Wed Jun 12 2019 Silvan Scherrer <silvan.scherrer@aroa.ch> 2.6.4-1
|
|---|
| 132 | - update to version 2.6.4
|
|---|
| 133 | - use scm_ macros
|
|---|
| 134 | - moved source to github
|
|---|
| 135 |
|
|---|
| 136 | * Tue Feb 28 2012 yd
|
|---|
| 137 | - fixed m4 executable location.
|
|---|
| 138 |
|
|---|
| 139 | * Fri Jan 06 2012 yd
|
|---|
| 140 | - initial unixroot build.
|
|---|