2020-12-05 18:42:45 +03:00
|
|
|
# Build Vitastor packages for Debian Buster or Bullseye/Sid inside a container
|
2021-02-21 00:52:16 +03:00
|
|
|
# cd ..; podman build --build-arg REL=bullseye -v `pwd`/packages:/root/packages -f debian/vitastor.Dockerfile .
|
2020-11-09 22:55:06 +03:00
|
|
|
|
2021-11-13 21:10:19 +03:00
|
|
|
ARG REL=
|
2020-11-09 22:55:06 +03:00
|
|
|
FROM debian:$REL
|
2021-11-13 21:10:19 +03:00
|
|
|
ARG REL=
|
2020-11-09 22:55:06 +03:00
|
|
|
|
|
|
|
WORKDIR /root
|
|
|
|
|
2021-11-21 16:16:46 +03:00
|
|
|
RUN if [ "$REL" = "buster" -o "$REL" = "bullseye" ]; then \
|
|
|
|
echo "deb http://deb.debian.org/debian $REL-backports main" >> /etc/apt/sources.list; \
|
2020-12-05 18:42:45 +03:00
|
|
|
echo >> /etc/apt/preferences; \
|
|
|
|
echo 'Package: *' >> /etc/apt/preferences; \
|
2021-11-21 16:16:46 +03:00
|
|
|
echo "Pin: release a=$REL-backports" >> /etc/apt/preferences; \
|
2020-12-05 18:42:45 +03:00
|
|
|
echo 'Pin-Priority: 500' >> /etc/apt/preferences; \
|
|
|
|
fi; \
|
|
|
|
grep '^deb ' /etc/apt/sources.list | perl -pe 's/^deb/deb-src/' >> /etc/apt/sources.list; \
|
|
|
|
echo 'APT::Install-Recommends false;' >> /etc/apt/apt.conf; \
|
|
|
|
echo 'APT::Install-Suggests false;' >> /etc/apt/apt.conf
|
2020-11-09 22:55:06 +03:00
|
|
|
|
|
|
|
RUN apt-get update
|
2021-12-01 02:00:14 +03:00
|
|
|
RUN apt-get -y install fio liburing1 liburing-dev libgoogle-perftools-dev devscripts
|
2020-11-09 22:55:06 +03:00
|
|
|
RUN apt-get -y build-dep fio
|
|
|
|
RUN apt-get --download-only source fio
|
2021-05-01 18:46:52 +03:00
|
|
|
RUN apt-get update && apt-get -y install libjerasure-dev cmake libibverbs-dev
|
2020-11-09 22:55:06 +03:00
|
|
|
|
|
|
|
ADD . /root/vitastor
|
2020-11-10 23:40:56 +03:00
|
|
|
RUN set -e -x; \
|
2020-11-09 22:55:06 +03:00
|
|
|
mkdir -p /root/fio-build/; \
|
|
|
|
cd /root/fio-build/; \
|
|
|
|
rm -rf /root/fio-build/*; \
|
|
|
|
dpkg-source -x /root/fio*.dsc; \
|
2021-02-21 00:52:16 +03:00
|
|
|
mkdir -p /root/packages/vitastor-$REL; \
|
|
|
|
rm -rf /root/packages/vitastor-$REL/*; \
|
|
|
|
cd /root/packages/vitastor-$REL; \
|
2021-12-10 21:40:12 +03:00
|
|
|
cp -r /root/vitastor vitastor-0.6.10; \
|
|
|
|
cd vitastor-0.6.10; \
|
2021-12-01 02:00:14 +03:00
|
|
|
ln -s /root/fio-build/fio-*/ ./fio; \
|
2020-11-10 23:40:56 +03:00
|
|
|
FIO=$(head -n1 fio/debian/changelog | perl -pe 's/^.*\((.*?)\).*$/$1/'); \
|
2021-12-01 02:00:14 +03:00
|
|
|
ls /usr/include/linux/raw.h || cp ./debian/raw.h /usr/include/linux/raw.h; \
|
2020-11-09 22:55:06 +03:00
|
|
|
sh copy-fio-includes.sh; \
|
2021-12-01 02:00:14 +03:00
|
|
|
rm fio; \
|
2020-11-10 23:40:56 +03:00
|
|
|
mkdir -p a b debian/patches; \
|
|
|
|
mv fio-copy b/fio; \
|
2021-12-01 02:00:14 +03:00
|
|
|
diff -NaurpbB a b > debian/patches/fio-headers.patch || true; \
|
|
|
|
echo fio-headers.patch >> debian/patches/series; \
|
2020-11-10 23:40:56 +03:00
|
|
|
rm -rf a b; \
|
2021-11-14 22:48:30 +03:00
|
|
|
echo "dep:fio=$FIO" > debian/fio_version; \
|
2021-02-21 00:52:16 +03:00
|
|
|
cd /root/packages/vitastor-$REL; \
|
2021-12-10 21:40:12 +03:00
|
|
|
tar --sort=name --mtime='2020-01-01' --owner=0 --group=0 --exclude=debian -cJf vitastor_0.6.10.orig.tar.xz vitastor-0.6.10; \
|
|
|
|
cd vitastor-0.6.10; \
|
2020-11-10 23:40:56 +03:00
|
|
|
V=$(head -n1 debian/changelog | perl -pe 's/^.*\((.*?)\).*$/$1/'); \
|
|
|
|
DEBFULLNAME="Vitaliy Filippov <vitalif@yourcmc.ru>" dch -D $REL -v "$V""$REL" "Rebuild for $REL"; \
|
|
|
|
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage --jobs=auto -sa; \
|
2021-02-21 00:52:16 +03:00
|
|
|
rm -rf /root/packages/vitastor-$REL/vitastor-*/
|