--- /dev/null
+Name: unzip
+Version: 610c23
+Release: 0
+License: BSD
+Summary: A utility for unpacking zip files
+Url: http://www.info-zip.org/pub/infozip/UnZip.html
+Group: Applications/Archiving
+Source: unzip%{version}.tar.gz
+Source1001: unzip.manifest
+
+%description
+The unzip utility is used to list, test, or extract files from a zip
+archive. Zip archives are commonly found on MS-DOS systems. The zip
+utility, included in the zip package, creates zip archives. Zip and
+unzip are both compatible with archives created by PKWARE(R)'s PKZIP
+for MS-DOS, but the programs' options and default behaviors do differ
+in some respects.
+
+Install the unzip package if you need to list, test or extract files from
+a zip archive.
+
+%prep
+%setup -q -n %{name}%{version}
+cp %{SOURCE1001} .
+ln -s unix/Makefile Makefile
+
+%build
+export LDFLAGS+=" -Wl,-z,relro -pie "
+make %{?_smp_mflags} LOCAL_UNZIP=-DIZ_HAVE_UXUIDGID generic
+
+%install
+make PREFIX=%{buildroot}%{_prefix} MANDIR=%{buildroot}/%{_mandir}/man1 INSTALL="cp -p" install
+
+%remove_docs
+
+%files
+%manifest %{name}.manifest
+%defattr(-,root,root)
+%license LICENSE
+%{_bindir}/*
CC_BZ = $(CC)
CF_NOOPT = -I. -DUNIX $(LOCAL_UNZIP)
-CFLAGS = -O
+CFLAGS = -O3 -fPIC
CF = $(CFLAGS) $(CF_NOOPT) # C compiler flags (core components)
CF_BZ = $(CF) # C compiler flags (BZIP2 components)
# - CC and LD must match, else "unresolved symbol: ___main" is possible.
# - To use "gcc", specify "make" macro, "CC=gcc", instead of editing here.
LD = $(CC)
-LF1 =
-LF2 = -s
+LF1 = $(LDFLAGS)
+LFLAGS1 = $(LDFLAGS)
+#LF2 = -s
+LF2 =
# Other utility programs
AR = ar cq
"PROD='$(PROD)'" \
"LIST='$(LIST)'" \
"CC='$(CC)'" \
- "CFLAGS='$(LOCAL_UNZIP)'" \
+ "CFLAGS='$(CFLAGS) $(LOCAL_UNZIP)'" \
"LFLAGS1='$(LFLAGS1)'" \
"LFLAGS2='$(LFLAGS2)'" \
"NO_AES_WG='$(NO_AES_WG)'" \
CC_BZ=${CC_BZ:-${CC}} # C compiler name (BZIP2 components)
CC_LIST='' # C compiler name, if LIST enabled
CFLAGS=${CFLAGS:-}' -I.' # C compiler flags (core components)
-CFLAGS_BZ=${CFLAGS_BZ:-}' -I.' # C cmplr flags (BZIP2 components)
+CFLAGS_BZ=${CFLAGS:-}' -I.' # C cmplr flags (BZIP2 components)
CFLAGS_OPT=${CFLAGS_OPT:-} # C cmplr optimze (and list) options
CFLAGS_USR=${LOCAL_UNZIP:-} # C compiler user override options