summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in13
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 78cd4cfc..b0247bdf 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -44,7 +44,7 @@ startdir="$PWD"
srcdir="$startdir/src"
pkgdir="$startdir/pkg"
-packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'purge')
+packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'purge' 'upx')
other_options=('ccache' 'distcc' 'buildflags' 'makeflags')
splitpkg_overrides=('pkgver' 'pkgrel' 'pkgdesc' 'arch' 'license' 'groups' \
'depends' 'optdepends' 'provides' 'conflicts' 'replaces' \
@@ -940,6 +940,17 @@ tidy_install() {
msg2 "$(gettext "Removing empty directories...")"
find . -depth -type d -empty -delete
fi
+
+ if [[ $(check_option upx) = "y" ]]; then
+ msg2 "$(gettext "Compressing binaries with %s...")" "UPX"
+ local binary
+ find . -type f -perm -u+w 2>/dev/null | while read binary ; do
+ if [[ $(file -bi "$binary") = *'application/x-executable'* ]]; then
+ upx $UPXFLAGS "$binary" &>/dev/null ||
+ warning "$(gettext "Could not compress binary : %s")" "${binary/$pkgdir\//}"
+ fi
+ done
+ fi
}
find_libdepends() {