summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Hesse <mail@earthworm.de>2012-02-11 19:48:59 +1000
committerDan McGee <dan@archlinux.org>2012-03-08 17:28:36 -0600
commit09a93b2e0e8d603328c484a92cad90a1558c6f89 (patch)
tree776dd6dfc5f7e1612e4d2993f3bba77da0915951
parente85e77e6f9f0979a16d69cd93ee6ea35583e9bfb (diff)
downloadpacman-09a93b2e0e8d603328c484a92cad90a1558c6f89.tar.xz
makepkg: allow specifying compression options
Adds the ability to override the commands used to compressing compiled and source packages. This is useful for those wanting to use alternative implementations of the compression tools or non-default compression options. Allan: documented options in man page Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--doc/makepkg.conf.5.txt4
-rw-r--r--etc/makepkg.conf.in10
-rw-r--r--scripts/makepkg.sh.in8
3 files changed, 18 insertions, 4 deletions
diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt
index db1e6d53..5970946d 100644
--- a/doc/makepkg.conf.5.txt
+++ b/doc/makepkg.conf.5.txt
@@ -213,6 +213,10 @@ Options
This value is used when querying a package to see who was the builder.
It is recommended you change this to your name and email address.
+**COMPRESSGZ=**"(gzip -c -f -n)", **COMPRESSBZ2=**"(bzip2 -c -f)", **COMPRESSXZ=**"(xz -c -z -)", **COMPRESSZ=**"(compress -c -f)"::
+ Sets the command and options used when compressing compiled or source
+ packages in the named format.
+
**PKGEXT=**".pkg.tar.gz", **SRCEXT=**".src.tar.gz"::
Sets the compression used when making compiled or source packages. The
current valid suffixes are `.tar`, `.tar.gz`, `.tar.bz2`, `.tar.xz`, and
diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in
index e9152c8b..6c87ea4c 100644
--- a/etc/makepkg.conf.in
+++ b/etc/makepkg.conf.in
@@ -107,6 +107,16 @@ PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
#GPGKEY=""
#########################################################################
+# COMPRESSION DEFAULTS
+#########################################################################
+#
+COMPRESSGZ=(gzip -c -f -n)
+COMPRESSBZ2=(bzip2 -c -f)
+COMPRESSXZ=(xz -c -z -)
+COMPRESSZ=(compress -c -f)
+
+
+#########################################################################
# EXTENSION DEFAULTS
#########################################################################
#
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 6e7a5562..48f7f7ec 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1294,10 +1294,10 @@ create_package() {
# Disable bsdtar compression and use gzip -n for now.
bsdtar -cf - $comp_files * |
case "$PKGEXT" in
- *tar.gz) gzip -c -f -n ;;
- *tar.bz2) bzip2 -c -f ;;
- *tar.xz) xz -c -z - ;;
- *tar.Z) compress -c -f ;;
+ *tar.gz) ${COMPRESSGZ[@]:-gzip -c -f -n} ;;
+ *tar.bz2) ${COMPRESSBZ2[@]:-bzip2 -c -f} ;;
+ *tar.xz) ${COMPRESSXZ[@]:-xz -c -z -} ;;
+ *tar.Z) ${COMPRESSZ[@]:-compress -c -f} ;;
*tar) cat ;;
*) warning "$(gettext "'%s' is not a valid archive extension.")" \
"$PKGEXT"; cat ;;