diff --git a/debian/vitastor-mon.install b/debian/vitastor-mon.install index 094ce288..a1cecf92 100644 --- a/debian/vitastor-mon.install +++ b/debian/vitastor-mon.install @@ -1,3 +1,3 @@ -mon usr/lib/vitastor/mon +mon usr/lib/vitastor/ mon/scripts/make-etcd usr/lib/vitastor/mon mon/scripts/vitastor-mon.service /lib/systemd/system diff --git a/debian/vitastor.Dockerfile b/debian/vitastor.Dockerfile index c31e936c..82881c6c 100644 --- a/debian/vitastor.Dockerfile +++ b/debian/vitastor.Dockerfile @@ -25,7 +25,7 @@ RUN apt-get update RUN apt-get -y install fio liburing-dev libgoogle-perftools-dev devscripts RUN apt-get -y build-dep fio RUN apt-get --download-only source fio -RUN apt-get update && apt-get -y install libjerasure-dev cmake libibverbs-dev libisal-dev libnl-3-dev libnl-genl-3-dev +RUN apt-get update && apt-get -y install libjerasure-dev cmake libibverbs-dev libisal-dev libnl-3-dev libnl-genl-3-dev curl ADD . /root/vitastor RUN set -e -x; \ @@ -37,8 +37,10 @@ RUN set -e -x; \ mkdir -p /root/packages/vitastor-$REL; \ rm -rf /root/packages/vitastor-$REL/*; \ cd /root/packages/vitastor-$REL; \ - cp -r /root/vitastor vitastor-1.6.1; \ - cd vitastor-1.6.1; \ + FULLVER=$(head -n1 /root/vitastor/debian/changelog | perl -pe 's/^.*\((.*?)\).*$/$1/'); \ + VER=${FULLVER%%-*}; \ + cp -r /root/vitastor vitastor-$VER; \ + cd vitastor-$VER; \ ln -s /root/fio-build/fio-*/ ./fio; \ FIO=$(head -n1 fio/debian/changelog | perl -pe 's/^.*\((.*?)\).*$/$1/'); \ ls /usr/include/linux/raw.h || cp ./debian/raw.h /usr/include/linux/raw.h; \ @@ -50,10 +52,14 @@ RUN set -e -x; \ echo fio-headers.patch >> debian/patches/series; \ rm -rf a b; \ echo "dep:fio=$FIO" > debian/fio_version; \ + cd /root/packages/vitastor-$REL/vitastor-$VER; \ + mkdir mon/node_modules; \ + cd mon/node_modules; \ + curl -s https://git.yourcmc.ru/vitalif/antietcd/archive/master.tar.gz | tar -zx; \ + curl -s https://git.yourcmc.ru/vitalif/tinyraft/archive/master.tar.gz | tar -zx; \ cd /root/packages/vitastor-$REL; \ - tar --sort=name --mtime='2020-01-01' --owner=0 --group=0 --exclude=debian -cJf vitastor_1.6.1.orig.tar.xz vitastor-1.6.1; \ - cd vitastor-1.6.1; \ - V=$(head -n1 debian/changelog | perl -pe 's/^.*\((.*?)\).*$/$1/'); \ - DEBFULLNAME="Vitaliy Filippov " dch -D $REL -v "$V""$REL" "Rebuild for $REL"; \ + tar --sort=name --mtime='2020-01-01' --owner=0 --group=0 --exclude=debian -cJf vitastor_$VER.orig.tar.xz vitastor-$VER; \ + cd vitastor-$VER; \ + DEBFULLNAME="Vitaliy Filippov " dch -D $REL -v "$FULLVER""$REL" "Rebuild for $REL"; \ DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage --jobs=auto -sa; \ rm -rf /root/packages/vitastor-$REL/vitastor-*/ diff --git a/rpm/build-tarball.sh b/rpm/build-tarball.sh index 0b8f206c..1cf44b34 100755 --- a/rpm/build-tarball.sh +++ b/rpm/build-tarball.sh @@ -18,10 +18,11 @@ fi cd ~/rpmbuild/SPECS rpmbuild -bp fio.spec cd $VITASTOR +VER=$(grep ^Version: rpm/vitastor-el7.spec | awk '{print $2}') ln -s ~/rpmbuild/BUILD/fio*/ fio sh copy-fio-includes.sh rm fio mv fio-copy fio FIO=`rpm -qi fio | 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 -tar --transform 's#^#vitastor-1.6.1/#' --exclude 'rpm/*.rpm' -czf $VITASTOR/../vitastor-1.6.1$(rpm --eval '%dist').tar.gz * +tar --transform "s#^#vitastor-$VER/#" --exclude 'rpm/*.rpm' -czf $VITASTOR/../vitastor-$VER$(rpm --eval '%dist').tar.gz * diff --git a/rpm/vitastor-el7.Dockerfile b/rpm/vitastor-el7.Dockerfile index 40519b54..92f4314e 100644 --- a/rpm/vitastor-el7.Dockerfile +++ b/rpm/vitastor-el7.Dockerfile @@ -36,7 +36,8 @@ ADD . /root/vitastor RUN set -e; \ cd /root/vitastor/rpm; \ sh build-tarball.sh; \ - cp /root/vitastor-1.6.1.el7.tar.gz ~/rpmbuild/SOURCES; \ + VER=$(grep ^Version: vitastor-el7.spec | awk '{print $2}'); \ + cp /root/vitastor-$VER.el7.tar.gz ~/rpmbuild/SOURCES; \ cp vitastor-el7.spec ~/rpmbuild/SPECS/vitastor.spec; \ cd ~/rpmbuild/SPECS/; \ rpmbuild -ba vitastor.spec; \ diff --git a/rpm/vitastor-el8.Dockerfile b/rpm/vitastor-el8.Dockerfile index e8e43f23..5bb6bf37 100644 --- a/rpm/vitastor-el8.Dockerfile +++ b/rpm/vitastor-el8.Dockerfile @@ -35,7 +35,8 @@ ADD . /root/vitastor RUN set -e; \ cd /root/vitastor/rpm; \ sh build-tarball.sh; \ - cp /root/vitastor-1.6.1.el8.tar.gz ~/rpmbuild/SOURCES; \ + VER=$(grep ^Version: vitastor-el8.spec | awk '{print $2}'); \ + cp /root/vitastor-$VER.el8.tar.gz ~/rpmbuild/SOURCES; \ cp vitastor-el8.spec ~/rpmbuild/SPECS/vitastor.spec; \ cd ~/rpmbuild/SPECS/; \ rpmbuild -ba vitastor.spec; \ diff --git a/rpm/vitastor-el9.Dockerfile b/rpm/vitastor-el9.Dockerfile index e038512e..b91ad4c5 100644 --- a/rpm/vitastor-el9.Dockerfile +++ b/rpm/vitastor-el9.Dockerfile @@ -18,7 +18,8 @@ ADD . /root/vitastor RUN set -e; \ cd /root/vitastor/rpm; \ sh build-tarball.sh; \ - cp /root/vitastor-1.6.1.el9.tar.gz ~/rpmbuild/SOURCES; \ + VER=$(grep ^Version: vitastor-el9.spec | awk '{print $2}'); \ + cp /root/vitastor-$VER.el9.tar.gz ~/rpmbuild/SOURCES; \ cp vitastor-el9.spec ~/rpmbuild/SPECS/vitastor.spec; \ cd ~/rpmbuild/SPECS/; \ rpmbuild -ba vitastor.spec; \