add PKGBUILD, upd DEB builder

This commit is contained in:
ge
2024-01-16 22:26:59 +03:00
parent f091b34854
commit 10ff2ca297
15 changed files with 91 additions and 33 deletions

View File

@ -0,0 +1,10 @@
FROM archlinux:latest
WORKDIR /mnt
RUN chown 1000:1000 /mnt; \
pacman -Sy --noconfirm \
fakeroot \
binutils \
python \
python-pip; \
echo "alias ll='ls -alFh'" >> /etc/bash.bashrc
USER 1000:1000

View File

@ -0,0 +1,22 @@
DOCKER_CMD ?= docker
DOCKER_IMG = computebuilder:archlinux
BUILDDIR = build
all: docker-build build
clean:
test -d $(BUILDDIR) && rm -rf $(BUILDDIR) || true
docker-build:
$(DOCKER_CMD) build -f Dockerfile -t $(DOCKER_IMG) .
build: clean
mkdir -p $(BUILDDIR)
VERSION=$$(awk '/^version/{print $$3}' ../../pyproject.toml | sed s'/-/\./'); \
sed "s/pkgver=.*/pkgver=$$VERSION/" PKGBUILD > $(BUILDDIR)/PKGBUILD
cp -v ../../dist/compute-*[.tar.gz] $(BUILDDIR)/
cp ../../extra/completion.bash $(BUILDDIR)/
$(DOCKER_CMD) run --rm -i -v $$PWD/$(BUILDDIR):/mnt --ulimit "nofile=1024:1048576" \
$(DOCKER_IMG) makepkg --nodeps --clean
# Remove unwanted files from build dir
rm $(BUILDDIR)/compute*.tar.gz $(BUILDDIR)/PKGBUILD

View File

@ -0,0 +1,16 @@
pkgname=compute
pkgver='0.1.0-dev4'
pkgrel=1
pkgdesc='Compute instances management library'
arch=(any)
url=https://get.lulzette.ru/hstack/compute
license=('GPL-3-or-later')
makedepends=(python python-pip)
depends=(python libvirt libvirt-python qemu-base qemu-system-x86 qemu-img dnsmasq iptables-nft)
provides=(compute)
conflicts=()
package() {
pip install --no-cache-dir --no-deps --root $pkgdir ../$pkgname-*.tar.gz
install -Dm644 ../completion.bash $pkgdir/usr/share/bash-completion/completions/compute
}