index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Allan McRae <allan@archlinux.org> | 2011-06-14 22:01:05 +1000 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-06-22 10:45:18 -0500 |
commit | b803a33a8fc2ef86ba2d986c36f31524532d454b (patch) | |
tree | 6a5e5a8a88be9ab10535a352d09a19647baf037c /scripts/makepkg.sh.in | |
parent | b8990993271b34d309ada49197090895b0fbdfb6 (diff) |
-rw-r--r-- | scripts/makepkg.sh.in | 13 |
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() { |