vitastor/rpm/build-tarball.sh

29 lines
898 B
Bash
Raw Normal View History

2020-11-07 01:51:14 +03:00
#!/bin/bash
2021-12-01 23:41:46 +03:00
# Vitastor depends on QEMU and/or FIO headers, but QEMU and FIO don't have -devel packages
2020-11-07 01:51:14 +03:00
# So we have to copy their headers into the source tarball
set -e
VITASTOR=$(dirname $0)
VITASTOR=$(realpath "$VITASTOR/..")
2020-11-08 01:53:17 +03:00
if [ -d /opt/rh/gcc-toolset-9 ]; then
# CentOS 8
EL=8
. /opt/rh/gcc-toolset-9/enable
else
# CentOS 7
EL=7
. /opt/rh/devtoolset-9/enable
fi
2020-11-07 01:51:14 +03:00
cd ~/rpmbuild/SPECS
rpmbuild -bp fio.spec
cd $VITASTOR
ln -s ~/rpmbuild/BUILD/fio*/ fio
sh copy-fio-includes.sh
rm fio
mv fio-copy fio
2020-11-10 23:40:56 +03:00
FIO=`rpm -qi fio | perl -e 'while(<>) { /^Epoch[\s:]+(\S+)/ && print "$1:"; /^Version[\s:]+(\S+)/ && print $1; /^Release[\s:]+(\S+)/ && print "-$1"; }'`
2020-11-08 01:53:17 +03:00
perl -i -pe 's/(Requires:\s*fio)([^\n]+)?/$1 = '$FIO'/' $VITASTOR/rpm/vitastor-el$EL.spec
tar --transform 's#^#vitastor-0.6.11/#' --exclude 'rpm/*.rpm' -czf $VITASTOR/../vitastor-0.6.11$(rpm --eval '%dist').tar.gz *