summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac3
-rw-r--r--debian/changelog2
-rw-r--r--dpkg-deb/main.c2
-rw-r--r--m4/dpkg-build.m417
4 files changed, 23 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 767c4d623..74e379deb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,6 +31,9 @@ DPKG_WITH_DIR([admindir], [${localstatedir}/lib/${PACKAGE_NAME}],
DPKG_WITH_DIR([logdir], [${localstatedir}/log],
[system logging directory [LOCALSTATEDIR/log]])
+# Set default dpkg-deb compressor
+DPKG_DEB_COMPRESSOR([gzip])
+
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
diff --git a/debian/changelog b/debian/changelog
index d3faa2cfc..116e40227 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -121,6 +121,8 @@ dpkg (1.17.0) UNRELEASED; urgency=low
* Add support for mipsn32(el) and mips64(el) to arch tables.
Thanks to YunQiang Su <wzssyqa@gmail.com>. Closes: #685096, #707323
* Document --file and --label parser options in dpkg-parsechangelog(1).
+ * Add a new configure --with-dpkg-deb-compressor option to allow selecting
+ the default dpkg-deb compressor, mainly for downstreams.
[ Updated programs translations ]
* Fix typo in Spanish translation of update-alternatives.
diff --git a/dpkg-deb/main.c b/dpkg-deb/main.c
index cac983453..9c5bf8bdb 100644
--- a/dpkg-deb/main.c
+++ b/dpkg-deb/main.c
@@ -180,7 +180,7 @@ set_deb_new(const struct cmdinfo *cip, const char *value)
}
struct compress_params compress_params = {
- .type = compressor_type_gzip,
+ .type = DPKG_DEB_DEFAULT_COMPRESSOR,
.strategy = compressor_strategy_none,
.level = -1,
};
diff --git a/m4/dpkg-build.m4 b/m4/dpkg-build.m4
index 1c259f2c8..bf351635f 100644
--- a/m4/dpkg-build.m4
+++ b/m4/dpkg-build.m4
@@ -35,6 +35,23 @@ AC_DEFUN([DPKG_WITH_DIR], [
AC_MSG_NOTICE([using directory $1 = '$$1'])
])# DPKG_WITH_DIR
+# DPKG_DEB_COMPRESSOR(COMP)
+# -------------------
+# Change default «dpkg-deb --build» compressor.
+AC_DEFUN([DPKG_DEB_COMPRESSOR], [
+ AC_ARG_WITH([dpkg-deb-compressor],
+ [AS_HELP_STRING([--with-dpkg-deb-compressor=COMP],
+ [change default dpkg-deb build compressor])],
+ [with_dpkg_deb_compressor=$withval], [with_dpkg_deb_compressor=$1])
+ AS_CASE([$with_dpkg_deb_compressor],
+ [gzip|xz|bzip2], [:],
+ [AC_MSG_ERROR([unsupported default compressor $with_dpkg_deb_compressor])])
+ AC_DEFINE_UNQUOTED([DPKG_DEB_DEFAULT_COMPRESSOR],
+ [compressor_type_${with_dpkg_deb_compressor}],
+ [default dpkg-deb build compressor])
+ AC_MSG_NOTICE([using default dpkg-deb compressor = $with_dpkg_deb_compressor])
+]) # DPKG_DEB_COMPRESSOR
+
# DPKG_DIST_CHECK(COND, ERROR)
# ---------------
# Check if the condition is fulfilled when preparing a distribution tarball.