Use standard Fedora linker flags

- Resolves rhbz#1548467

Signed-off-by: Rafael dos Santos <rdossant@redhat.com>
This commit is contained in:
Rafael dos Santos 2018-05-30 12:53:57 +02:00
commit 4ba84c8062
2 changed files with 58 additions and 2 deletions

51
build_flags.patch Normal file
View file

@ -0,0 +1,51 @@
diff -Nru zip30/unix/configure unix/configure
--- zip30/unix/configure 2008-06-20 05:32:20.000000000 +0200
+++ zip30/unix/configure 2018-05-30 12:49:13.023102083 +0200
@@ -5,7 +5,7 @@
# configure: Guess values for system-dependent variables
# Output the flag definitions to the file "flags".
#
-# Parameters: $1 = $CC, $2 = $CFLAGS, $3 = $IZ_BZIP2
+# Parameters: $1 = $CC, $2 = $CFLAGS, $3 = $IZ_BZIP2, $4 = $LFLAGS1
#
# This file is typically called from Makefile rather than executed
# from the command line.
@@ -18,7 +18,7 @@
CC=${1-cc}
CFLAGS=${2-"-I. -DUNIX"}
-LFLAGS1=''
+LFLAGS1=${4-}
LFLAGS2=''
LN="ln -s"
diff -Nru zip30/unix/Makefile unix/Makefile
--- zip30/unix/Makefile 2018-05-30 12:51:47.329157267 +0200
+++ zip30/unix/Makefile 2018-05-30 12:51:34.102152537 +0200
@@ -80,7 +80,7 @@
.SUFFIXES:
.SUFFIXES: _.o .o .c .doc .1
.c_.o:
- $(CC) -c $(CFLAGS) -DUTIL -o $@ $<
+ $(CC) -c $(CFLAGS) $(LFLAGS1) -DUTIL -o $@ $<
.c.o:
$(CC) -c $(CFLAGS) $<
@@ -117,7 +117,7 @@
$(CC) -c $(CFLAGS) unix/unix.c
unix_.o: unix/unix.c
- $(CC) -c $(CFLAGS) -DUTIL -o $@ unix/unix.c
+ $(CC) -c $(CFLAGS) $(LFLAGS1) -DUTIL -o $@ unix/unix.c
ZIPS = zip$E zipcloak$E zipnote$E zipsplit$E
@@ -177,7 +177,7 @@
flags: unix/configure
- sh unix/configure "${CC}" "${CFLAGS_NOOPT}" "${IZ_BZIP2}"
+ sh unix/configure "${CC}" "${CFLAGS_NOOPT}" "${IZ_BZIP2}" "${LFLAGS1}"
# These symbols, when #defined using -D have these effects on compilation:
# ZMEM - includes C language versions of memset(), memcpy(),

View file

@ -1,7 +1,7 @@
Summary: A file compression and packaging utility compatible with PKZIP
Name: zip
Version: 3.0
Release: 22%{?dist}
Release: 23%{?dist}
License: BSD
Group: Applications/Archiving
Source: http://downloads.sourceforge.net/infozip/zip30.tar.gz
@ -17,6 +17,7 @@ Patch3: zip-3.0-time.patch
Patch4: man.patch
Patch5: zip-3.0-format-security.patch
Patch6: zipnote.patch
Patch7: build_flags.patch
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 .buildflags
%build
make -f unix/Makefile prefix=%{_prefix} "CFLAGS_NOOPT=-I. -DUNIX $RPM_OPT_FLAGS" generic_gcc %{?_smp_mflags}
make -f unix/Makefile prefix=%{_prefix} "CFLAGS_NOOPT=-I. -DUNIX $RPM_OPT_FLAGS" "LFLAGS1=%{build_ldflags}" generic_gcc %{?_smp_mflags}
%install
mkdir -p $RPM_BUILD_ROOT%{_bindir}
@ -62,6 +64,9 @@ make -f unix/Makefile prefix=$RPM_BUILD_ROOT%{_prefix} \
%{_mandir}/man1/zipsplit.1*
%changelog
* Wed May 30 2018 Rafael dos Santos <rdossant@redhat.com> - 3.0-23
- Use standard Fedora linker flags (rhbz#1548467)
* Thu Mar 01 2018 Jakub Martisko <jamartis@redhat.com> - 3.0-22
- Add gcc to buildrequires