Skip to content

Commit

Permalink
[RPM] Improve buildrpms.sh script and use pbzip2 when available
Browse files Browse the repository at this point in the history
  • Loading branch information
daniviga authored and nyalldawson committed Mar 27, 2019
1 parent 93f3a25 commit 79ffbff
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions rpm/buildrpms.sh
Expand Up @@ -38,9 +38,18 @@ Usage:
'
}

function compress
{
if command -v pbzip2 &> /dev/null; then
echo 'pbzip2'
else
echo 'bzip2'
fi
}

if [ $_MOCK_OLD_CHROOT ]
then
mock_args="--old-chroot"
mock_args="--old-chroot"
fi

relver=1
Expand Down Expand Up @@ -133,7 +142,7 @@ then

print_info "Creating source tarball"
# Create source tarball
git -C .. archive --format=tar --prefix=qgis-$version/ HEAD | bzip2 > sources/qgis-$version.tar.bz2
git -C .. archive --format=tar --prefix=qgis-$version/ HEAD | compress > sources/qgis-$version.tar.bz2

print_info "Creating source package"
# Build source package
Expand All @@ -148,7 +157,7 @@ then
fi

srpm=$(grep -e 'Wrote: .*\.src\.rpm' $OUTDIR/build.log |
sed 's_Wrote: /builddir/build/SRPMS/\(.*\)_\1_')
sed 's_Wrote: /builddir/build/SRPMS/\(.*\)_\1_')

print_info "Source package created: $srpm"
fi
Expand Down

0 comments on commit 79ffbff

Please sign in to comment.