Compare commits

...
Sign in to create a new pull request.

80 commits

Author SHA1 Message Date
Fedora Release Engineering
642acc32b5 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-23 20:36:11 +00:00
Fedora Release Engineering
92050e21e8 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-16 18:26:34 +00:00
Fedora Release Engineering
dc359e9869 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-17 23:17:23 +00:00
Arjun Shankar
6e3f209ce3 Provide flex-doc via the main flex package
Commit e7d1e0be25 removed and obsoleted
flex-doc, but did not 'Provides:' it.  This commit fixes that.
2024-04-23 17:17:13 +02:00
Arjun Shankar
992cb3242a Switch to %autosetup 2024-04-23 17:17:13 +02:00
Fedora Release Engineering
e2cfee03f9 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-24 11:43:21 +00:00
Fedora Release Engineering
2b40fc1153 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-19 19:28:13 +00:00
Arjun Shankar
d687d8a413 Migrate License field to SPDX identifiers
https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_2
2023-10-30 12:23:34 +01:00
Fedora Release Engineering
12a46b39b6 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-19 19:52:01 +00:00
Edjunior Machado
711ba9a8ad tests: Fix fmf plan attributes 2023-04-05 13:55:36 +00:00
Fedora Release Engineering
abdaa050ff Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 03:34:41 +00:00
Fedora Release Engineering
a2246316dc Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-21 03:18:28 +00:00
Fedora Release Engineering
76db1a4296 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 03:08:04 +00:00
Fedora Release Engineering
4157a4f3d3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-21 23:05:27 +00:00
Arjun Shankar
e7d1e0be25 Remove and obsolete the flex-doc subpackage (#1915609)
The flex-doc subpackage hasn't contained any documentation for quite a
while.  It is supposed to contain the manual in PDF format, but
`make && make install' does not produce a PDF.  Since info and man pages
are provided in the main package itself, this leaves flex-doc redundant.

This commit removes and obsoletes the flex-doc subpackage.

No Fedora packages are currently dependent on or build-dependent on
flex-doc:

$ dnf repoquery --whatdepends flex-doc

$ dnf repoquery --disablerepo="*" --enablerepo="*-source" --arch=src \
  --whatdepends flex-doc

Therefore, only an "Obsoletes: flex-doc" line is added, with no
accompanying "Provides: flex-doc" line.
2021-05-06 00:49:44 +02:00
Edjunior Machado
8a8070ad74 Introduce CI gating 2021-02-01 11:12:11 +00:00
Fedora Release Engineering
d13f0a5806 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 05:40:01 +00:00
Tom Stellard
bfe32fe72b Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2020-12-18 22:42:41 +00:00
Arjun Shankar
9adf2296f3 Re-work and rename flex subpackages, and provide shared libraries
This resolves a user request for a shared library (#1327851) and harmonizes
package names and content with Debian and SUSE.

The following subpackage changes have been made:

- Remove and obsolete the flex-devel subpackage containing static libraries
- Provide shared libraries in a new subpackage named libfl2
- Provide development files in a new subpackage named libfl-devel
- Provide static libraries in a new subpackage named libfl-static
2020-08-21 12:01:28 +02:00
Fedora Release Engineering
f0b1e7d68b - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-27 17:34:32 +00:00
Fedora Release Engineering
ad90513c6b - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-28 18:39:36 +00:00
Fedora Release Engineering
b089780d0b - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 00:42:58 +00:00
Fedora Release Engineering
f8de7fa8f1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-01-31 19:50:29 +00:00
Igor Gnatenko
71b1cadc9c Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:02 +01:00
Igor Gnatenko
61d01ac272
Remove obsolete scriptlets
References: https://fedoraproject.org/wiki/Changes/RemoveObsoleteScriptlets
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-01-27 15:30:36 +01:00
Arjun Shankar
c0c5e9ed4b Rebase to 2.6.4 (#1389575)
This patch rebases flex to upstream version 2.6.4 and thus drops all
backported upstream patches that the package has been carrying so far.

One exception is flex-2.6.0-yyless.patch which has no equivalent upstream.
I could not track the origin of this patch because flex development moved
from SourceForge to GitHub and in the process, sourceforge bug tracker
content has been lost. However, RHBZ #1281976 seems to suggest that this
patch was included in order to fix a libreswan build failure caused by a
flex integer comparison type mismatch bug. I dropped flex-2.6.0-yyless.patch
and confirmed that the Fedora libreswan package corresponding to
libreswan-3.25 builds successfully despite this patch being dropped.

Additionally, flex-2.6.4 FTBFS because it uses reallocarray but does not
define _GNU_SOURCE leading to a missing prototype for reallocarray. This
commit also includes the upstream patch that fixes this. The patch modifies
configure.ac, which necessitates executing autoreconf at build time and thus
a corresponding set of new build dependencies.
2018-09-03 18:37:45 +02:00
Arjun Shankar
ffa5f9318b Bump release
The release bump was missed during the previous change.
2018-07-23 18:13:55 +02:00
Arjun Shankar
c6ddf9b328 Add gcc-c++ to BuildRequires 2018-07-23 16:58:05 +02:00
Fedora Release Engineering
24741c559e - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-13 00:38:51 +00:00
Jason Tibbitts
7ee751b935 Remove needless use of %defattr 2018-07-10 00:50:56 -05:00
Igor Gnatenko
46592962ea add BuildRequires: gcc
Reference: https://fedoraproject.org/wiki/Changes/Remove_GCC_from_BuildRoot
2018-07-09 19:06:44 +02:00
Arjun Shankar
967afaa6d0 Remove g++ signed/unsigned comparison warning in generated scanner
Compiling a flex generated scanner with g++ with all warnings turned on (-Wall)
produces a warning due to "comparison of integer expressions of different
signedness". This change removes the warning by using the same signedness.

This bug was a regression inherited from upstream flex during the rebase to
flex-2.6.1. The same bug was fixed previously (albeit differently) by commit
a3088c99e8.
2018-06-28 16:18:04 +02:00
Arjun Shankar
2aa1cb2053 Include quilt tooling and convert patches to be used with quilt
This is not a functional change and merely adds quilt scripts and a README
explaining their usage. In addition, it rewrites patch levels to be in line
with the result of 'quilt refresh -p ab'. No source changes are involved and
the source files are identical.
2018-06-27 14:05:06 +02:00
Igor Gnatenko
3a93f14080
Remove %clean section
None of currently supported distributions need that.
Last one was EL5 which is EOL for a while.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-14 09:06:51 +01:00
Igor Gnatenko
c7df4d76ee Remove BuildRoot definition
None of currently supported distributions need that.
It was needed last for EL5 which is EOL now

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-13 23:22:34 +01:00
Igor Gnatenko
1638482983
Escape macros in %changelog
Reference: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/Y2ZUKK2B7T2IKXPMODNF6HB2O5T5TS6H/
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-09 09:04:29 +01:00
Fedora Release Engineering
0ef95e75c4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-07 09:48:40 +00:00
Fedora Release Engineering
c8b4c0b5fb - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-02 20:38:20 +00:00
Fedora Release Engineering
cf8a163ba8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-26 08:29:38 +00:00
Stephen Gallagher
26fe0dfe58
Add missing %license macro 2017-02-01 20:01:52 -05:00
Patsy Franklin
c92a3e6ae8 Resolves: #1373601
- Fix several type comparison issues including BZ #1373601
2016-09-25 15:09:09 -04:00
Rex Dieter
e12b8361fa 2.6.1-1
- Rebase to 2.6.1 (#1318074,#1364943)
- update URL (github), drop unused patches (#1238860)
2016-09-13 08:56:11 -05:00
Patsy Franklin
3821e2741c Resolves: #1360744
Fix wrong type on num_to_read.
2016-07-27 13:59:22 -04:00
Patsy Franklin
ffdaf36582 Resolves: #1281976
- Rebase to flex-2.6.0
- Add a patch to fix yy_less_macro_arg types.
2016-03-11 14:53:33 -05:00
Dennis Gilmore
c3a70b341f - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild 2016-02-03 20:35:04 +00:00
Patsy Franklin
b4c0265c95 Resolves: #1238860
- Remove obsolete patches.
2015-10-30 00:36:01 -04:00
Dennis Gilmore
a842d2a3b5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild 2015-06-17 06:26:07 +00:00
Patsy Franklin
9829cc0a31 Resolves: #1064735
- Rebase to flex-2.5.39
2015-04-13 11:27:39 -04:00
Peter Robinson
c5de0e2acb - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild 2014-08-16 12:36:42 +00:00
Ville Skyttä
bc2fdd62f6 Make docdir unversioned where appropriate (#993754)
- Install docs to one common package doc dir, drop separate one for -doc
- Include COPYING in -devel
- Fix bogus dates in %changelog
2014-07-20 00:12:57 +03:00
Dennis Gilmore
509ceeb03a - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild 2014-06-07 07:17:03 -05:00
Patsy Franklin
21e70cdb9f Resolves: #1087433
- Add a patch to remove obsolete bison constructs YYLEX_PARAM and
  YYPARSE_PARAM. Use %lex-param, %parse-param, or %param.
2014-04-16 15:01:50 -04:00
Petr Machata
a3088c99e8 Add a patch for "comparison between signed and unsigned" warnings 2013-09-03 19:59:34 +02:00
Dennis Gilmore
d39470d8a5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild 2013-08-03 06:25:03 -05:00
Petr Machata
122421a064 Update config.sub and config.guess to support aarch64 2013-04-04 15:43:21 +02:00
Petr Machata
83840e9d2b Drop old release from sources 2013-03-20 14:41:18 +01:00
Petr Machata
9059a932e4 Rebase to 2.5.37 2013-03-20 13:37:21 +01:00
Dennis Gilmore
0e75ec3118 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild 2013-02-13 15:45:51 -06:00
Petr Machata
e634b42c58 Bump for rebuild 2012-10-26 16:37:23 +02:00
Petr Machata
d59e4fdce9 Clarify licensing 2012-10-26 16:36:02 +02:00
Petr Machata
10db3f4a59 Add a link to upstream tracker for patch 0 2012-08-01 01:40:40 +02:00
Petr Machata
9a65236274 This part of the patch isn't necessary 2012-08-01 01:32:22 +02:00
Petr Machata
9c353052cc Rebase to 2.5.36 2012-08-01 01:16:49 +02:00
Dennis Gilmore
1d38037b36 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild 2012-07-18 21:37:48 -05:00
Petr Machata
0763a46cf7 Rename flex-static to flex-devel
- flex-static is still provided for backward compatibility in BuildRequires
- Resolves: #674301
2012-03-12 20:38:15 +01:00
Petr Machata
f936739e35 Update .gitignore 2012-03-12 20:30:02 +01:00
Dennis Gilmore
6feae83743 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild 2012-01-12 20:31:31 -06:00
Dennis Gilmore
bcf541bebd - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild 2011-02-08 14:29:49 -06:00
Petr Machata
d6e92f36f3 Drop the dependency of core package on flex-static 2010-08-17 15:15:12 +02:00
Fedora Release Engineering
12773fc12d dist-git conversion 2010-07-28 14:33:43 +00:00
Petr Machata
0e24cc19d3 - Forgot that the changes in flex.skl won't propagate to skel.c
- Resolves: #612465
2010-07-14 11:24:13 +00:00
Petr Machata
758aa395c6 - Declare yyget_column and yyset_column in reentrant mode.
- Resolves: #612465
2010-07-13 15:57:53 +00:00
Petr Machata
8c1a39ae06 - Move libraries into a sub-package of their own. 2010-01-21 16:14:15 +00:00
Petr Machata
6689963599 - Add source URL 2010-01-12 14:09:08 +00:00
Bill Nottingham
6a74a545c8 Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-25 23:16:26 +00:00
Petr Machata
feda0adf7e - Fix installation with --excludedocs
- Resolves: #515928
2009-08-24 12:26:18 +00:00
Jesse Keating
a5bfa248cb - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild 2009-07-24 22:53:10 +00:00
Petr Machata
0547dfe11a Forgot the patch. 2009-04-20 14:59:18 +00:00
Petr Machata
db7d0160b5 - Resolves: #496548.
Mon Apr 20 2009 Petr Machata <pmachata@redhat.com> - 2.5.35-4
- Get rid of warning caused by ignoring return value of fwrite() in ECHO
    macro. Debian patch.
- Resolves: #484961
2009-04-20 11:26:12 +00:00
Jesse Keating
63237cc23d - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild 2009-02-24 17:28:55 +00:00
21 changed files with 710 additions and 65 deletions

View file

@ -1 +0,0 @@
flex-2.5.35.tar.bz2

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

10
.gitignore vendored Normal file
View file

@ -0,0 +1,10 @@
flex-2.5.35.tar.bz2
/flex*/
*.rpm
/flex-2.5.36.tar.bz2
/flex-2.5.37.tar.bz2
/flex-2.5.39.tar.bz2
/flex-2.6.0.tar.bz2
/flex-2.6.1.tar.xz
/flex-2.6.4.tar.gz
series

View file

@ -1,21 +0,0 @@
# Makefile for source rpm: flex
# $Id: Makefile,v 1.1 2004/09/09 04:46:04 cvsdist Exp $
NAME := flex
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attempt a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

40
README.quilt Normal file
View file

@ -0,0 +1,40 @@
This package supports working with patch files using quilt.
To regenerate the quilt series file run:
./gen-quilt-series.sh
Setup environment:
export QUILT_PATCHES=$PWD
Setup the source:
./quilt-patch.sh [-f]
Use `-f` if you want to have quilt-patch always remove the existing
source directory before starting. Otherwise you'll be patching on top of
an already patched tree generated perhaps by `*pkg prep`.
To add a new patch:
Option 1: Create a new patch:
cd flex-2.6.1/
quilt new flex-rh1439367.patch
quilt add tests/test-bison-yylloc/parser.y
# edit tests/test-bison-yylloc/parser.y
# you may add and edit several files in the same fashion
Option 2: Add an already prepared patch (e.g. from an upstream commit):
cd flex-2.6.1/
quilt import -P flex-rh1439367.patch ~/backport/obsolete-bison.patch
quilt push # if this fails, manually deal with conflicts (as in Option 1)
Finally:
quilt refresh -p ab
cd ..
git add flex-rh1439367.patch
# edit flex.spec to build with the new patch
git add flex.spec
git commit
You're done!

View file

@ -1,11 +0,0 @@
--- flex-2.5.35/gen.c-orig 2008-04-30 22:51:08.000000000 +0200
+++ flex-2.5.35/gen.c 2008-04-30 22:51:14.000000000 +0200
@@ -1890,7 +1890,7 @@
outn ("\tif ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \\");
outn ("\t\t{ \\");
outn ("\t\tint c = '*'; \\");
- outn ("\t\tint n; \\");
+ outn ("\t\tunsigned n; \\");
outn ("\t\tfor ( n = 0; n < max_size && \\");
outn ("\t\t\t (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\");
outn ("\t\t\tbuf[n] = (char) c; \\");

39
flex-rh1389575.patch Normal file
View file

@ -0,0 +1,39 @@
This patch fixes a flex-2.6.4 build failure on x86_64 and possibly other
architectures where `size_t' is larger than `int'. The failure occurs as
follows:
A missing `reallocarray' prototype during compilation means that the
compiler assumes an `int' return type. When compiling with `-pie' (standard
for Fedora), addresses on the heap can be larger than `int' can store. Thus,
pointers returned from `reallocarray' are truncated and any read/write to
them leads to a SIGSEGV.
From 24fd0551333e7eded87b64dd36062da3df2f6380 Mon Sep 17 00:00:00 2001
From: Explorer09 <explorer09@gmail.com>
Date: Mon, 4 Sep 2017 10:47:33 +0800
Subject: [PATCH] build: AC_USE_SYSTEM_EXTENSIONS in configure.ac.
This would, e.g. define _GNU_SOURCE in config.h, enabling the
reallocarray() prototype in glibc 2.26+ on Linux systems with that
version of glibc.
Fixes #241.
---
configure.ac | 2 ++
1 file changed, 2 insertions(+)
Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -25,8 +25,10 @@
# autoconf requirements and initialization
AC_INIT([the fast lexical analyser generator],[2.6.4],[flex-help@lists.sourceforge.net],[flex])
+AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([src/scan.l])
AC_CONFIG_AUX_DIR([build-aux])
+AC_USE_SYSTEM_EXTENSIONS
LT_INIT
AM_INIT_AUTOMAKE([1.11.3 -Wno-portability foreign check-news std-options dist-lzip parallel-tests subdir-objects])
AC_CONFIG_HEADER([src/config.h])

336
flex.spec
View file

@ -1,17 +1,26 @@
Summary: A tool for creating scanners (text pattern recognizers) %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
Summary: A tool for generating scanners (text pattern recognizers)
Name: flex Name: flex
Version: 2.5.35 Version: 2.6.4
Release: 2%{?dist} Release: 20%{?dist}
License: BSD
Group: Development/Tools # An SPDX license string check done against flex-2.6.4 using fossology
URL: http://flex.sourceforge.net/ # found strings corresponding to the licenses noted below across the flex
Source: flex-%{version}.tar.bz2 # source tree.
Patch0: flex-2.5.35-sign.patch License: BSD-3-Clause-flex AND GPL-3.0-or-later WITH Autoconf-exception-generic-3.0 AND GPL-3.0-or-later WITH Bison-exception-2.2 AND GPL-3.0-or-later WITH Texinfo-exception AND FSFAP AND FSFUL AND FSFULLR AND FSFULLRWD AND GPL-2.0-or-later AND X11
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
URL: https://github.com/westes/flex
Source: https://github.com/westes/flex/releases/download/v%{version}/flex-%{version}.tar.gz
Patch0: flex-rh1389575.patch
Requires: m4 Requires: m4
BuildRequires: gettext bison m4 BuildRequires: gettext gettext-devel bison m4 help2man gcc gcc-c++ automake libtool
Requires(post): /sbin/install-info BuildRequires: make
Requires(preun): /sbin/install-info
Obsoletes: flex-doc < 2.6.4-8
Provides: flex-doc = %{version}-%{release}
%description %description
The flex program generates scanners. Scanners are programs which can The flex program generates scanners. Scanners are programs which can
@ -27,18 +36,65 @@ build process.
You should install flex if you are going to use your system for You should install flex if you are going to use your system for
application development. application development.
# We keep the libraries in separate sub-package to allow for multilib
# installations of flex.
%define somajor 2
%package -n libfl%{somajor}
Summary: Libraries for the flex scanner generator
%description -n libfl%{somajor}
flex is a tool for generating scanners.
This package contains the shared library with default implementations of
`main' and `yywrap' functions that binaries using flex can choose to link
against instead of implementing on their own.
%package -n libfl-devel
Summary: Development files for the flex scanner generator
Requires: libfl%{somajor} = %{version}-%{release}
%description -n libfl-devel
flex is a tool for generating scanners.
This package contains files required to build programs that use flex
libraries.
%package -n libfl-static
Summary: Static libraries for the flex scanner generator
# We renamed flex-static to flex-devel in version 2.5.35-15:
Obsoletes: flex-static < 2.5.35-15
Provides: flex-static = %{version}-%{release}
# We renamed flex-devel to libfl-static in version 2.6.4-6. This clarifies
# the nature of the package and brings us in line with naming used by SUSE
# and Debian:
Obsoletes: flex-devel < 2.6.4-6
Provides: flex-devel = %{version}-%{release}
%description -n libfl-static
flex is a tool for generating scanners.
This package contains the static library with default implementations of
`main' and `yywrap' functions that binaries using flex can choose to
statically link against instead of implementing their own.
%prep %prep
%setup -q %autosetup -p1
%patch0 -p1
%build %build
%configure --disable-dependency-tracking CFLAGS="-fPIC $RPM_OPT_FLAGS" autoreconf -i
%configure --docdir=%{_pkgdocdir} CFLAGS="-fPIC $RPM_OPT_FLAGS"
make %{?_smp_mflags} make %{?_smp_mflags}
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install make DESTDIR=$RPM_BUILD_ROOT install
rm -f $RPM_BUILD_ROOT/%{_infodir}/dir rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
rm -f $RPM_BUILD_ROOT/%{_pkgdocdir}/{README.cvs,TODO,AUTHORS,COPYING,ONEWS}
# Exclude libtool archives (.la) as per Fedora packaging guidelines
find %{buildroot} -name '*.la' -delete
( cd ${RPM_BUILD_ROOT} ( cd ${RPM_BUILD_ROOT}
ln -sf flex .%{_bindir}/lex ln -sf flex .%{_bindir}/lex
@ -50,32 +106,250 @@ rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
%find_lang flex %find_lang flex
%post
/sbin/install-info %{_infodir}/flex.info.gz --dir-file=%{_infodir}/dir ||:
%preun
if [ $1 = 0 ]; then
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir ||:
fi
%check %check
echo ============TESTING=============== echo ============TESTING===============
make check make check
echo ============END TESTING=========== echo ============END TESTING===========
%clean
rm -rf ${RPM_BUILD_ROOT}
%files -f flex.lang %files -f flex.lang
%defattr(-,root,root) %dir %{_pkgdocdir}
%doc COPYING NEWS README %license COPYING
%{_pkgdocdir}/NEWS
%{_pkgdocdir}/README.md
%{_bindir}/* %{_bindir}/*
%{_mandir}/man1/* %{_mandir}/man1/*
%{_libdir}/*.a
%{_includedir}/FlexLexer.h %{_includedir}/FlexLexer.h
%{_infodir}/flex.info* %{_infodir}/flex.info*
%files -n libfl%{somajor}
%{_libdir}/libfl.so.%{somajor}*
%files -n libfl-devel
%{_includedir}/FlexLexer.h
%{_libdir}/libfl.so
%files -n libfl-static
%dir %{_pkgdocdir}
%license COPYING
%{_libdir}/*.a
%changelog %changelog
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Tue Apr 23 2024 Arjun Shankar <arjun@redhat.com> - 2.6.4-17
- Provide flex-doc via the main flex package
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Oct 30 2023 Arjun Shankar <arjun@redhat.com> - 2.6.4-14
- Analyse flex sources for license information
- Migrate License field to SPDX identifiers for
https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_2
(#2222083)
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu May 06 2021 Arjun Shankar <arjun@redhat.com> - 2.6.4-8
- Remove and obsolete the flex-doc subpackage; documention is provided in the
main package itself
- Specify versions in "Provides:" lines for flex-static and flex-devel
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri Aug 21 2020 Arjun Shankar <arjun@redhat.com> - 2.6.4-6
- Re-work flex subpackages and provide shared libraries (#1327851):
- Remove and obsolete the flex-devel subpackage containing static libraries
- Provide shared libraries in a new subpackage named libfl2
- Provide development files in a new subpackage named libfl-devel
- Provide static libraries in a new subpackage named libfl-static
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Sep 03 2018 Arjun Shankar <arjun@redhat.com> - 2.6.4-1
- Rebase to 2.6.4
- Fix build failure due to missing include and `reallocarray' prototype
- Add gettext-devel, automake and libtool to build dependencies, and
execute `autoreconf -i' to regenerate files after patching configure.ac
* Mon Jul 23 2018 Arjun Shankar <arjun@redhat.com> - 2.6.1-10
- Add gcc-c++ as a build-time requirement
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Jun 27 2018 Arjun Shankar <arjun@redhat.com> - 2.6.1-8
- Remove g++ signed/unsigned comparison warning in generated scanner
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.6.1-7
- Escape macros in %%changelog
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Wed Feb 01 2017 Stephen Gallagher <sgallagh@redhat.com> - 2.6.1-3
- Add missing %%license macro
* Sun Sep 25 2016 Patsy Franklin <pfrankli@redhat.com> - 2.6.1-2
- Fix several type comparison issues including BZ #1373601
* Tue Sep 13 2016 Rex Dieter <rdieter@fedoraproject.org> - 2.6.1-1
- Rebase to 2.6.1 (#1318074,#1364943)
- update URL (github), drop unused patches (#1238860)
* Wed Jul 27 2016 Patsy Franklin <pfrankli@redhat.com> - 2.6.0-2
Fix wrong type on num_to_read. BZ #1360744
* Thu Mar 10 2016 Patsy Franklin <pfrankli@redhat.com> - 2.6.0-1
- Rebase to 2.6.0
- Pick up an additional patch requested in BZ #1281976
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.39-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Oct 29 2015 Patsy Franklin <pfrankli@redhat.com> - 2.5.39-3
- Remove obsolete patches from git repository. (BZ #1238860)
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.39-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Mon Apr 13 2015 Patsy Franklin <pfrankli@redhat.com> - 2.5.39-1
- Rebase to 2.5.39
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.37-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jul 19 2014 Ville Skyttä <ville.skytta@iki.fi> - 2.5.37-7
- Make docdir unversioned where appropriate (#993754)
- Install docs to one common package doc dir, drop separate one for -doc
- Include COPYING in -devel
- Fix bogus dates in %%changelog
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.37-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed Apr 16 2014 Patsy Franklin <pfrankli@redhat.com> - 2.5.37-5
- Add a patch to remove obsolete bison constructs YYLEX_PARAM and
YYPARSE_PARAM. Use %%lex-param, %%parse-param, or %%param.
* Tue Sep 3 2013 Petr Machata <pmachata@redhat.com> - 2.5.37-4
- Add a patch for "comparison between signed and unsigned" warnings
that GCC produces when compiling flex-generated scanners
(flex-2.5.37-types.patch)
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.37-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Apr 4 2013 Petr Machata <pmachata@redhat.com> - 2.5.37-2
- Update config.sub and config.guess to support aarch64
* Wed Mar 20 2013 Petr Machata <pmachata@redhat.com> - 2.5.37-1
- Rebase to 2.5.37
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.36-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Fri Oct 26 2012 Petr Machata <pmachata@redhat.com> - 2.5.36-2
- Bump for rebuild
* Tue Jul 31 2012 Petr Machata <pmachata@redhat.com> - 2.5.36-1
- Rebase to 2.5.36
- Drop flex-2.5.35-sign.patch, flex-2.5.35-hardening.patch,
flex-2.5.35-gcc44.patch, flex-2.5.35-missing-prototypes.patch
- Add flex-2.5.36-bison-2.6.1.patch
- Add a subpackage doc
- Resolves #842073
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.35-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Mon Mar 12 2012 Petr Machata <pmachata@redhat.com> - 2.5.35-15
- Rename flex-static to flex-devel so that it gets to repositories of
minor multi-lib arch (i386 on x86_64 etc.)
- Resolves: #674301
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.35-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.35-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Tue Aug 17 2010 Petr Machata <pmachata@redhat.com> - 2.5.35-12
- Drop the dependency of core package on flex-static.
- Resolves: #624549
* Wed Jul 14 2010 Petr Machata <pmachata@redhat.com> - 2.5.35-11
- Forgot that the changes in flex.skl won't propagate to skel.c
- Resolves: #612465
* Tue Jul 13 2010 Petr Machata <pmachata@redhat.com> - 2.5.35-10
- Declare yyget_column and yyset_column in reentrant mode.
- Resolves: #612465
* Wed Jan 20 2010 Petr Machata <pmachata@redhat.com> - 2.5.35-9
- Move libraries into a sub-package of their own.
* Tue Jan 12 2010 Petr Machata <pmachata@redhat.com> - 2.5.35-8
- Add source URL
* Mon Aug 24 2009 Petr Machata <pmachata@redhat.com> - 2.5.35-7
- Fix installation with --excludedocs
- Resolves: #515928
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.35-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Mon Apr 20 2009 Debarshi Ray <rishi@fedoraproject.org> - 2.5.35-5
- Resolves: #496548.
* Mon Apr 20 2009 Petr Machata <pmachata@redhat.com> - 2.5.35-4
- Get rid of warning caused by ignoring return value of fwrite() in
ECHO macro. Debian patch.
- Resolves: #484961
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.35-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Mon May 12 2008 Petr Machata <pmachata@redhat.com> - 2.5.35-2 * Mon May 12 2008 Petr Machata <pmachata@redhat.com> - 2.5.35-2
- Resolves: #445950 - Resolves: #445950
@ -176,7 +450,7 @@ rm -rf ${RPM_BUILD_ROOT}
* Wed Mar 8 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-37.4 * Wed Mar 8 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-37.4
- adding test for #183098 into build process - adding test for #183098 into build process
* Fri Mar 2 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-37.3 * Thu Mar 2 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-37.3
- rebuilt, no changes inside. In hunt for #183098 - rebuilt, no changes inside. In hunt for #183098
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 2.5.4a-37.2 * Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 2.5.4a-37.2
@ -185,7 +459,7 @@ rm -rf ${RPM_BUILD_ROOT}
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 2.5.4a-37.1 * Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 2.5.4a-37.1
- rebuilt for new gcc4.1 snapshot and glibc changes - rebuilt for new gcc4.1 snapshot and glibc changes
* Wed Feb 02 2006 Petr Machata <pmachata@redhat.com> 2.5.4a-37 * Thu Feb 02 2006 Petr Machata <pmachata@redhat.com> 2.5.4a-37
- adding `make bigcheck' into build process. Refreshing initscan.c to - adding `make bigcheck' into build process. Refreshing initscan.c to
make this possible. make this possible.

19
gating.yaml Normal file
View file

@ -0,0 +1,19 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}

34
gen-quilt-series.sh Executable file
View file

@ -0,0 +1,34 @@
#!/bin/bash
# Autogenerates the quilt `series` from the patch order in the spec file.
# We don't use `quilt setup` because it makes a huge mess and doesn't work.
component="flex"
rm -f series.new
extra_args="--fuzz=0"
count=0
# Filter out the patches, and use `_` as our pseudo-IFS to prevent expansion.
for i in `grep '^%patch' flex.spec | sed -e 's,%patch,,g' -e 's, ,_,g'`; do
# Split the patch into number and arguments.
# 1 - Patch number.
# 2-N - Patch arguments.
# Get back our elements by undoing pseudo-IFS change.
elements=(`echo $i | sed -e 's,_, ,g'`)
num=${elements[0]}
args=${elements[@]:1}
# Find the next patch that applies in order and write it out.
# This way we transform the patch # list into a patch file list in order.
grep "Patch${num}: " flex.spec \
| sed -e 's,Patch.*: ,,g' -e "s,\$, ${args[@]} ${extra_args},g" \
| sed -e "s,%{name},${component},g" \
>> series.new
((count++))
done
# Double check we processed the correct number of patches.
fcount=`wc -l series.new | sed -e 's, .*$,,g'`
if [ $fcount -ne $count ]; then
echo "Error! Processed patch count doesn't match spec file count ($fcount != $count)."
exit 1
fi
echo "Processed $count patches."
mv series.new series
echo "Generated quilt ./series file. Please do not commit."
exit 0

5
plans/ci.fmf Normal file
View file

@ -0,0 +1,5 @@
summary: CI Gating Plan
discover:
how: fmf
execute:
how: tmt

22
quilt-patch.sh Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
# Patches are in the current directory.
export QUILT_PATCHES=$PWD
# Extract source file name from sources file,
# and assume it's the same name as the directory.
source=`awk -F '[() ]+' '/^[A-Z0-9]+ /{print $2}; /^[0-9a-f]+ /{print $2}' sources`
srcdir=${source%.tar.gz}
if [ "$1" == "-f" ] && [ -d "$srcdir" ]; then
echo Cleaning up $srcdir
rm -rf $srcdir
fi
if [ -d "$srcdir" ]; then
# Don't overwrite existing source directory.
echo "ERROR: Source directory $srcdir already exists. Use -f to force cleanup step."
exit 1
fi
tar xvf $source
echo "Entering $srcdir"
pushd $srcdir
# Apply all patches.
quilt push -a
popd

View file

@ -1 +1 @@
10714e50cea54dc7a227e3eddcd44d57 flex-2.5.35.tar.bz2 SHA512 (flex-2.6.4.tar.gz) = e9785f3d620a204b7d20222888917dc065c2036cae28667065bf7862dfa1b25235095a12fd04efdbd09bfd17d3452e6b9ef953a8c1137862ff671c97132a082e

View file

@ -0,0 +1,63 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/flex/Sanity/smoke-check-flex-runs
# Description: Show your version. Build a one-file project.
# Author: Vaclav Kadlcik <vkadlcik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2015 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/flex/Sanity/smoke-check-flex-runs
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE count_chars_and_lines.l calc-lexer.l calc-grammar.y expected_calc_output.txt
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Vaclav Kadlcik <vkadlcik@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Show your version. Build a one-file project." >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 15m" >> $(METADATA)
@echo "RunFor: flex" >> $(METADATA)
@echo "Requires: flex bison gcc" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View file

@ -0,0 +1,3 @@
PURPOSE of /tools/flex/Sanity/smoke-check-flex-runs
Description: Show your version. Build a one-file project.
Author: Vaclav Kadlcik <vkadlcik@redhat.com>

View file

@ -0,0 +1,36 @@
%{
#include <stdio.h>
%}
%token NUMBER
%token ADD SUB MUL DIV
%token EOL
%%
input:
| input EOL { }
| input expression EOL { printf("%d\n", $2); }
;
expression:
factor
| expression ADD factor { $$ = $1 + $3; }
| expression SUB factor { $$ = $1 - $3; }
;
factor:
NUMBER
| factor MUL NUMBER { $$ = $1 * $3; }
| factor DIV NUMBER { $$ = $1 / $3; }
;
%%
int main(int argc, char ** argv) {
yyparse();
}
yyerror(char *s) {
fprintf(stderr, "ERROR: %s\n", s);
}

View file

@ -0,0 +1,15 @@
%option noyywrap
%{
#include "calc-grammar.tab.h"
%}
%%
"+" { return ADD; }
"-" { return SUB; }
"*" { return MUL; }
"/" { return DIV; }
[0-9]+ { yylval = atoi(yytext); return NUMBER; }
\n { return EOL; }
[ \t] { /* ignore whitespaces */ }
. { yyerror("unexpected character %c", *yytext); }
%%

View file

@ -0,0 +1,21 @@
%option noyywrap
%{
#include <stdio.h>
int chars = 0;
int lines = 0;
%}
%%
\n { lines++; chars++; }
. { chars++; }
%%
int main(int argc, char ** argv) {
yylex();
printf("chars: %d\n", chars);
printf("lines: %d\n", lines);
return 0;
}

View file

@ -0,0 +1,3 @@
STDOUT: 7
STDOUT: -221
STDOUT: 42

View file

@ -0,0 +1,15 @@
summary: Show your version. Build a one-file project.
description: ''
contact:
- Vaclav Kadlcik <vkadlcik@redhat.com>
component:
- flex
test: ./runtest.sh
framework: beakerlib
recommend:
- flex
- bison
- gcc
duration: 15m
extra-summary: /tools/flex/Sanity/smoke-check-flex-runs
extra-task: /tools/flex/Sanity/smoke-check-flex-runs

View file

@ -0,0 +1,78 @@
#!/usr/bin/env bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/flex/Sanity/smoke-check-flex-runs
# Description: Show your version. Build a one-file project.
# Author: Vaclav Kadlcik <vkadlcik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2015 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="flex"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
yum -y install bison gcc
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "cp count_chars_and_lines.l calc-lexer.l calc-grammar.y expected_calc_output.txt $TmpDir"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest 'Show version'
rlRun -t -s 'flex -V'
rlAssertNotGrep '^STDERR:' $rlRun_LOG
rlAssertGrep '^STDOUT: flex [0-9]' $rlRun_LOG
rlPhaseEnd
rlPhaseStartTest 'Flex works standalone'
rlRun 'flex -o count_chars_and_lines.c count_chars_and_lines.l'
rlRun 'gcc -o count_chars_and_lines count_chars_and_lines.c'
rlAssertExists 'count_chars_and_lines'
rlRun -t -s 'echo -e "nazdar\nbazar" | ./count_chars_and_lines'
rlAssertNotGrep '^STDERR:' $rlRun_LOG
rlAssertGrep '^STDOUT: chars: 13$' $rlRun_LOG
rlAssertGrep '^STDOUT: lines: 2$' $rlRun_LOG
rlPhaseEnd
rlPhaseStartTest 'Flex works with Bison'
rlRun 'bison -d calc-grammar.y'
rlRun 'flex calc-lexer.l'
rlRun 'gcc -o calc calc-grammar.tab.c lex.yy.c'
rlAssertExists 'calc'
rlRun -t -s 'echo -e "1 + 2 * 3\n1 - 666 / 3\n42" | ./calc'
rlAssertNotDiffer expected_calc_output.txt $rlRun_LOG
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd