From 98b40e35ca9c6183ddd875018ca70f88154e8d82 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 18 Nov 2022 08:06:30 +0100 Subject: [PATCH] Really build with -std=gnu89 (#2143565) --- zip-gnu89-build.patch | 15 +++++++++++++++ zip.spec | 9 +++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 zip-gnu89-build.patch diff --git a/zip-gnu89-build.patch b/zip-gnu89-build.patch new file mode 100644 index 0000000..65ee7a7 --- /dev/null +++ b/zip-gnu89-build.patch @@ -0,0 +1,15 @@ +zip uses C89-only features, so it needs to be built in C89 mode. + +diff --git a/unix/Makefile b/unix/Makefile +index 86cf54bf0f56cea9..244390893eab5fc6 100644 +--- a/unix/Makefile ++++ b/unix/Makefile +@@ -202,7 +202,7 @@ generic: flags + eval $(MAKE) $(MAKEF) zips `cat flags` + + generic_gcc: +- $(MAKE) $(MAKEF) generic CC=gcc CPP="gcc -E" ++ $(MAKE) $(MAKEF) generic CC="gcc -std=gnu89" CPP="gcc -E" + + # AT&T 6300 PLUS (don't know yet how to allocate 64K bytes): + att6300nodir: diff --git a/zip.spec b/zip.spec index 58f5621..e63430e 100644 --- a/zip.spec +++ b/zip.spec @@ -1,7 +1,7 @@ Summary: A file compression and packaging utility compatible with PKZIP Name: zip Version: 3.0 -Release: 34%{?dist} +Release: 35%{?dist} License: BSD Source: http://downloads.sourceforge.net/infozip/zip30.tar.gz URL: http://www.info-zip.org/Zip.html @@ -16,6 +16,7 @@ Patch3: zip-3.0-time.patch Patch4: man.patch Patch5: zip-3.0-format-security.patch Patch6: zipnote.patch +Patch7: zip-gnu89-build.patch BuildRequires: make BuildRequires: bzip2-devel, gcc Requires: unzip @@ -37,9 +38,10 @@ program. %patch4 -p1 -b .man %patch5 -p1 -b .format-security %patch6 -p1 -b .zipnote +%patch7 -p1 -b .gnu89-build %build -%{make_build} -f unix/Makefile prefix=%{_prefix} "CFLAGS_NOOPT=-I. -DUNIX -std=gnu89 $RPM_OPT_FLAGS" generic +%{make_build} -f unix/Makefile prefix=%{_prefix} "CFLAGS_NOOPT=-I. -DUNIX $RPM_OPT_FLAGS" generic_gcc %install mkdir -p $RPM_BUILD_ROOT%{_bindir} @@ -62,6 +64,9 @@ mkdir -p $RPM_BULD_ROOT%{_mandir}/man1 %{_mandir}/man1/zipsplit.1* %changelog +* Fri Nov 18 2022 Florian Weimer - 3.0-35 +- Really build with -std=gnu89 (#2143565) + * Thu Nov 17 2022 Florian Weimer - 3.0-34 - Build with -std=gnu89 (#2143565)