Final fixes for packaging
This commit is contained in:
@@ -44,8 +44,8 @@ ln -s ~/rpmbuild/BUILD/fio*/ fio
|
||||
sh copy-fio-includes.sh
|
||||
rm fio
|
||||
mv fio-copy fio
|
||||
FIO=`rpm -qa fio | perl -pe 's/^fio-(.*)$/$1/'`
|
||||
QEMU=`rpm -qa qemu qemu-kvm | perl -pe 's/^qemu-(?:kvm-)?(.*)$/$1/'`
|
||||
FIO=`rpm -qi fio | perl -e 'while(<>) { /^Epoch[\s:]+(\S+)/ && print "$1:"; /^Version[\s:]+(\S+)/ && print $1; /^Release[\s:]+(\S+)/ && print "-$1"; }'`
|
||||
QEMU=`rpm -qi qemu qemu-kvm | perl -e 'while(<>) { /^Epoch[\s:]+(\S+)/ && print "$1:"; /^Version[\s:]+(\S+)/ && print $1; /^Release[\s:]+(\S+)/ && print "-$1"; }'`
|
||||
perl -i -pe 's/(Requires:\s*fio)([^\n]+)?/$1 = '$FIO'/' $VITASTOR/rpm/vitastor-el$EL.spec
|
||||
perl -i -pe 's/(Requires:\s*qemu)([^\n]+)?/$1 = '$QEMU'/' $VITASTOR/rpm/vitastor-el$EL.spec
|
||||
perl -i -pe 's/(Requires:\s*qemu(?:-kvm)?)([^\n]+)?/$1 = '$QEMU'/' $VITASTOR/rpm/vitastor-el$EL.spec
|
||||
tar --transform 's#^#vitastor-0.5/#' --exclude 'rpm/*.rpm' -czf $VITASTOR/../vitastor-0.5$(rpm --eval '%dist').tar.gz *
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Install/get required packages on CentOS 7 and 8
|
||||
|
||||
set -e
|
||||
|
||||
DIST=`rpm --eval '%dist'`
|
||||
rm -f /etc/yum.repos.d/CentOS-Media.repo
|
||||
if [ "$DIST" = ".el8" ]; then
|
||||
dnf -y install centos-release-advanced-virtualization epel-release
|
||||
dnf --enablerepo='*' -y install gcc-toolset-9 gcc-toolset-9-gcc-c++ gperftools-devel qemu-kvm fio nodejs rpm-build
|
||||
dnf download --disablerepo='*' --enablerepo='centos-advanced-virtualization-source' --source qemu-kvm
|
||||
dnf download --source fio
|
||||
rpm --nomd5 -i qemu*.src.rpm
|
||||
rpm --nomd5 -i fio*.src.rpm
|
||||
cd ~/rpmbuild/SPECS
|
||||
dnf builddep -y --enablerepo='*' --spec qemu-kvm.spec
|
||||
dnf builddep -y --enablerepo='*' --spec fio.spec
|
||||
else
|
||||
yum -y --enablerepo=extras install centos-release-scl epel-release yum-utils rpm-build
|
||||
yum -y install devtoolset-9-gcc-c++ devtoolset-9-libatomic-devel gperftools-devel qemu fio rh-nodejs12
|
||||
yumdownloader --source qemu
|
||||
yumdownloader --source fio
|
||||
rpm --nomd5 -i qemu*.src.rpm
|
||||
rpm --nomd5 -i fio*.src.rpm
|
||||
cd ~/rpmbuild/SPECS
|
||||
yum-builddep -y --enablerepo='*' qemu.spec
|
||||
yum-builddep -y --enablerepo='*' fio.spec
|
||||
fi
|
||||
@@ -41,7 +41,8 @@ rm -rf $RPM_BUILD_ROOT
|
||||
cd mon
|
||||
npm install
|
||||
cd ..
|
||||
cp -r mon %buildroot%_libdir/vitastor/mon
|
||||
mkdir -p %buildroot/usr/lib/vitastor
|
||||
cp -r mon %buildroot/usr/lib/vitastor/mon
|
||||
|
||||
|
||||
%files
|
||||
@@ -52,6 +53,7 @@ cp -r mon %buildroot%_libdir/vitastor/mon
|
||||
%_bindir/vitastor-rm
|
||||
%_libdir/qemu-kvm/block-vitastor.so
|
||||
%_libdir/vitastor
|
||||
/usr/lib/vitastor
|
||||
|
||||
|
||||
%changelog
|
||||
|
||||
@@ -29,7 +29,7 @@ RUN set -e; \
|
||||
|
||||
RUN rpm -i `ls /root/build/liburing-el7/liburing-*.x86_64.rpm | grep -v debug`
|
||||
|
||||
ADD . /root/vitastor
|
||||
ADD qemu-*-vitastor.patch /root/vitastor/
|
||||
|
||||
RUN set -e; \
|
||||
mkdir -p /root/build/qemu-el8; \
|
||||
@@ -48,6 +48,10 @@ RUN set -e; \
|
||||
cp ~/rpmbuild/RPMS/*/*qemu* /root/build/qemu-el8/; \
|
||||
cp ~/rpmbuild/SRPMS/*qemu* /root/build/qemu-el8/
|
||||
|
||||
RUN cd /root/build/qemu-el8; dnf -y install `ls qemu*.rpm | grep -vP 'debug|guest|tests|src'`
|
||||
|
||||
ADD . /root/vitastor
|
||||
|
||||
RUN set -e; \
|
||||
cd /root/vitastor/rpm; \
|
||||
sh build-tarball.sh; \
|
||||
|
||||
@@ -12,7 +12,7 @@ BuildRequires: gperftools-devel
|
||||
BuildRequires: gcc-toolset-9-gcc-c++
|
||||
BuildRequires: nodejs >= 10
|
||||
Requires: fio = 3.7-3.el8
|
||||
Requires: qemu = 4.2.0-29.el8.6
|
||||
Requires: qemu-kvm = 4.2.0-29.el8.6
|
||||
Requires: nodejs >= 10
|
||||
Requires: liburing >= 0.6
|
||||
|
||||
@@ -38,7 +38,8 @@ rm -rf $RPM_BUILD_ROOT
|
||||
cd mon
|
||||
npm install
|
||||
cd ..
|
||||
cp -r mon %buildroot%_libdir/vitastor/mon
|
||||
mkdir -p %buildroot/usr/lib/vitastor
|
||||
cp -r mon %buildroot/usr/lib/vitastor
|
||||
|
||||
|
||||
%files
|
||||
@@ -49,6 +50,7 @@ cp -r mon %buildroot%_libdir/vitastor/mon
|
||||
%_bindir/vitastor-rm
|
||||
%_libdir/qemu-kvm/block-vitastor.so
|
||||
%_libdir/vitastor
|
||||
/usr/lib/vitastor
|
||||
|
||||
|
||||
%changelog
|
||||
|
||||
Reference in New Issue
Block a user