Hi Everyone,
Wget2 is in testing. Wget2 uses lzip so I need lzip for testing. I am
building the 1.21 release tarball from sources on platforms like OS X
and Solaris.
I like lzip. It is a small package with no dependencies. It is easy to
build. I found I needed to make a small change because I set my
variables like CXX and CXXFLAGS in the environment.
The change below looks for implicit variables in the environment. If
found they are used. If not found then the configure script's values
are used. The patch includes additional two small changes. First,
SHELL=/bin/sh was moved to the first line per GNU Coding Standards.
Second, variables like "${option}" was quoted due to Shellcheck
findings.
Using variables in the environment may not seem like a big change, but
it makes a difference when build 60 or 80 packages. When I need to
build a bunch of packages, it is very helpful when variables are set
once in the environment and everything "just works" like Autotools.
Thanks again for an easy to use package.
--- configure
+++ configure
@@ -20,10 +20,22 @@
datarootdir='$(prefix)/share'
infodir='$(datarootdir)/info'
mandir='$(datarootdir)/man'
-CXX=g++
-CPPFLAGS=
-CXXFLAGS='-Wall -W -O2'
-LDFLAGS=
+
+if [ -z "${CXX}" ]; then
+ CXX=g++
+fi
+
+if [ -z "${CPPFLAGS}" ]; then
+ CPPFLAGS=
+fi
+
+if [ -z "${CXXFLAGS}" ]; then
+ CXXFLAGS='-Wall -W -O2'
+fi
+
+if [ -z "${LDFLAGS}" ]; then
+ LDFLAGS=
+fi
# checking whether we are using GNU C++.
/bin/sh -c "${CXX} --version" > /dev/null 2>&1 ||
@@ -46,7 +58,7 @@
# Split out the argument for options that take them
case ${option} in
- *=*) optarg=`echo ${option} | sed -e 's,^[^=]*=,,;s,/$,,'` ;;
+ *=*) optarg=`echo "${option}" | sed -e 's,^[^=]*=,,;s,/$,,'` ;;
esac
# Process the options
@@ -125,7 +137,7 @@
if [ ! -r "${srcdir}/${srctrigger}" ] ; then srcdir=.. ; fi
if [ ! -r "${srcdir}/${srctrigger}" ] ; then
## the sed command below emulates the dirname command
- srcdir=`echo $0 | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+ srcdir=`echo "$0" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
fi
fi
--- Makefile.in
+++ Makefile.in
@@ -1,12 +1,11 @@
-
+SHELL = /bin/sh
DISTNAME = $(pkgname)-$(pkgversion)
INSTALL = install
INSTALL_PROGRAM = $(INSTALL) -m 755
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_DIR = $(INSTALL) -d -m 755
-SHELL = /bin/sh
CAN_RUN_INSTALLINFO = $(SHELL) -c "install-info --version" > /dev/null 2>&1
objs = arg_parser.o lzip_index.o list.o encoder_base.o encoder.o \
fast_encoder.o decoder.o main.o