commit 2018e2cf9eef5f14110dc5dc58d425d8d707c6aa Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 10:38:56 2019 -0400 Package init diff --git a/flex-2.6.0-yyless.patch b/flex-2.6.0-yyless.patch new file mode 100644 index 0000000..bf7cf6f --- /dev/null +++ b/flex-2.6.0-yyless.patch @@ -0,0 +1,31 @@ +Index: b/src/flex.skl +=================================================================== +--- a/src/flex.skl ++++ b/src/flex.skl +@@ -494,7 +494,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], + */ + #define YY_LESS_LINENO(n) \ + do { \ +- int yyl;\ ++ yy_size_t yyl;\ + for ( yyl = n; yyl < yyleng; ++yyl )\ + if ( yytext[yyl] == '\n' )\ + --yylineno;\ +@@ -520,7 +520,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], + do \ + { \ + /* Undo effects of setting up yytext. */ \ +- int yyless_macro_arg = (n); \ ++ yy_size_t yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = YY_G(yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ +@@ -2576,7 +2576,7 @@ void yyFlexLexer::LexerError( yyconst ch + do \ + { \ + /* Undo effects of setting up yytext. */ \ +- int yyless_macro_arg = (n); \ ++ yy_size_t yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = YY_G(yy_hold_char); \ + YY_G(yy_c_buf_p) = yytext + yyless_macro_arg; \ diff --git a/flex-2.6.1.tar.xz b/flex-2.6.1.tar.xz new file mode 100644 index 0000000..fd897a9 Binary files /dev/null and b/flex-2.6.1.tar.xz differ diff --git a/flex-max_size.patch b/flex-max_size.patch new file mode 100644 index 0000000..133cfc1 --- /dev/null +++ b/flex-max_size.patch @@ -0,0 +1,37 @@ +commit 3946924ed5e77420c453bf841603c7278766093a +Author: rlar +Date: Sun Feb 28 15:20:31 2016 +0100 + + generated code, `max_size' seems to be of type `int', fix casts accordingly + +Index: b/src/gen.c +=================================================================== +--- a/src/gen.c ++++ b/src/gen.c +@@ -1875,7 +1875,7 @@ void make_tables (void) + if (!C_plus_plus) { + if (use_read) { + outn ("\terrno=0; \\"); +- outn ("\twhile ( (result = (int) read( fileno(yyin), buf, max_size )) < 0 ) \\"); ++ outn ("\twhile ( (result = (int) read( fileno(yyin), buf, (yy_size_t) max_size )) < 0 ) \\"); + outn ("\t{ \\"); + outn ("\t\tif( errno != EINTR) \\"); + outn ("\t\t{ \\"); +@@ -1891,7 +1891,7 @@ void make_tables (void) + outn ("\tif ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \\"); + outn ("\t\t{ \\"); + outn ("\t\tint c = '*'; \\"); +- outn ("\t\tsize_t n; \\"); ++ outn ("\t\tint 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; \\"); +@@ -1904,7 +1904,7 @@ void make_tables (void) + outn ("\telse \\"); + outn ("\t\t{ \\"); + outn ("\t\terrno=0; \\"); +- outn ("\t\twhile ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \\"); ++ outn ("\t\twhile ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \\"); + outn ("\t\t\t{ \\"); + outn ("\t\t\tif( errno != EINTR) \\"); + outn ("\t\t\t\t{ \\"); diff --git a/flex-new_size.patch b/flex-new_size.patch new file mode 100644 index 0000000..8f7fb5c --- /dev/null +++ b/flex-new_size.patch @@ -0,0 +1,19 @@ +commit 986bb5e29492a927a2ad157505c900f75c97016a +Author: rlar +Date: Sun Feb 28 15:20:31 2016 +0100 + + generated code, here `new_size' is of type `int', fix casts accordingly + +Index: b/src/flex.skl +=================================================================== +--- a/src/flex.skl ++++ b/src/flex.skl +@@ -1782,7 +1782,7 @@ m4_ifdef( [[M4_YY_USES_REJECT]], + /* Extend the array by 50%, plus the number we really need. */ + int new_size = YY_G(yy_n_chars) + number_to_move + (YY_G(yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( +- (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size M4_YY_CALL_LAST_ARG ); ++ (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size M4_YY_CALL_LAST_ARG ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } diff --git a/flex-yy_buf_size.patch b/flex-yy_buf_size.patch new file mode 100644 index 0000000..fcf1e2e --- /dev/null +++ b/flex-yy_buf_size.patch @@ -0,0 +1,43 @@ +commit 33dd868353ab98bc33363d43be5a8b0e7e049072 +Author: rlar +Date: Sun Feb 28 15:20:31 2016 +0100 + + generated code, `yy_buf_size' is of type `int', fix casts accordingly + +Index: b/src/flex.skl +=================================================================== +--- a/src/flex.skl ++++ b/src/flex.skl +@@ -1732,7 +1732,7 @@ m4_ifdef( [[M4_YY_USES_REJECT]], + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, +- b->yy_buf_size + 2 M4_YY_CALL_LAST_ARG ); ++ (yy_size_t) (b->yy_buf_size + 2) M4_YY_CALL_LAST_ARG ); + } + else + /* Can't grow it, we don't own it. */ +@@ -2102,12 +2102,12 @@ static void yy_load_buffer_state YYFARG + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + +- b->yy_buf_size = (yy_size_t)size; ++ b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ +- b->yy_ch_buf = (char *) yyalloc( b->yy_buf_size + 2 M4_YY_CALL_LAST_ARG ); ++ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) M4_YY_CALL_LAST_ARG ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + +@@ -2397,7 +2397,7 @@ YY_BUFFER_STATE yy_scan_buffer YYFARGS2 + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + +- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ ++ b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; diff --git a/flex-yybytes_len.patch b/flex-yybytes_len.patch new file mode 100644 index 0000000..9d204da --- /dev/null +++ b/flex-yybytes_len.patch @@ -0,0 +1,24 @@ +commit cf4121fa97abac8aeaa5e08b8fc0b2380228494e +Author: rlar +Date: Sat Feb 27 22:46:02 2016 +0100 + + generated code, `_yybytes_len' is of type `int', fix code accordingly + +Index: b/src/flex.skl +=================================================================== +--- a/src/flex.skl ++++ b/src/flex.skl +@@ -2451,11 +2451,11 @@ YY_BUFFER_STATE yy_scan_bytes YYFARGS2( + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; +- yy_size_t i; ++ int i; + m4_dnl M4_YY_DECL_GUTS_VAR(); + + /* Get memory for full buffer, including space for trailing EOB's. */ +- n = (yy_size_t) _yybytes_len + 2; ++ n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n M4_YY_CALL_LAST_ARG ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); diff --git a/flex.spec b/flex.spec new file mode 100644 index 0000000..3e3a2f3 --- /dev/null +++ b/flex.spec @@ -0,0 +1,104 @@ +Name: flex +Version: 2.6.1 +Release: 12 +Summary: A fast lexical analyzer generator +License: BSD and LGPLv2+ +URL: https://github.com/westes/flex +Source0: https://github.com/westes/flex/releases/download/v%{version}/flex-%{version}.tar.xz + +Patch0: flex-2.6.0-yyless.patch +Patch1: flex-max_size.patch +Patch2: flex-new_size.patch +Patch3: flex-yy_buf_size.patch +Patch4: flex-yybytes_len.patch + +BuildRequires: gcc gettext help2man m4 bison +Requires: m4 +Requires(post): info +Requires(preun): info + +%description +Flex is a tool for generating scanners: programs which recognize lexical +patterns in text. + +%package devel +Summary: Libraries for flex scanner generator +Obsoletes: flex-static < 2.5.35-15 +Provides: flex-static + +%description devel +This package contains the library with default implementations of +`main' and `yywrap' functions that the client binary can choose to use +instead of implementing their own. + +%package help +Summary: Documents for %{name} +Buildarch: noarch +Requires: man info +Provides: flex-doc +Obsoletes: flex-doc + +%description help +Man pages and other related documents for %{name}. + +%prep +%autosetup -n %{name}-%{version} -p1 + +%build +%configure +%make_build + +%install +%make_install +rm -f $RPM_BUILD_ROOT/%{_infodir}/dir +find %{buildroot} \( -name '*.la' -or -name '*.so' \) -delete +find %{buildroot} \( -name '*.so.2' -or -name '*.so.2.0.0' \) -delete + +cd ${RPM_BUILD_ROOT} +ln -sf flex .%{_bindir}/lex +ln -sf flex .%{_bindir}/flex++ +ln -s flex.1 .%{_mandir}/man1/lex.1 +ln -s flex.1 .%{_mandir}/man1/flex++.1 +ln -s libfl.a .%{_libdir}/libl.a + +%post +if [ -f %{_infodir}/flex.info.gz ]; then # for --excludedocs + /sbin/install-info %{_infodir}/flex.info.gz --dir-file=%{_infodir}/dir ||: +fi + +%preun +if [ $1 = 0 ]; then + if [ -f %{_infodir}/flex.info.gz ]; then # for --excludedocs + /sbin/install-info --delete %{_infodir}/%{name}.info.gz %{_infodir}/dir ||: + fi +fi + +%files +%{_datadir}/locale/* +%dir %{_pkgdocdir} +%license COPYING +%{_pkgdocdir}/NEWS +%{_pkgdocdir}/README +%{_bindir}/* +%{_includedir}/FlexLexer.h +%{_infodir}/flex.info* + +%files devel +%dir %{_pkgdocdir} +%license COPYING +%{_libdir}/*.a + +%files help +%{_pkgdocdir} +%{_mandir}/man1/* + +%changelog +* Fri Sep 27 2019 chengquan - 2.6.1-12 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:add help package + +* Mon Aug 19 2019 openEuler Buildteam - 2.6.1-11 +- Package init +