buildsys: fixup package building
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
a10bb8b941
commit
13b77d1060
38
Makefile
38
Makefile
|
@ -3,6 +3,8 @@ include defines.mk
|
|||
ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
|
||||
GITVERSION:=$(shell git rev-parse HEAD)
|
||||
|
||||
SUBDIRS := etc www
|
||||
|
||||
# Binaries usable by users
|
||||
USR_BIN := \
|
||||
proxmox-backup-client \
|
||||
|
@ -16,7 +18,13 @@ SERVICE_BIN := \
|
|||
proxmox-backup-api \
|
||||
proxmox-backup-proxy
|
||||
|
||||
ifeq ($(BUILD_MODE), release)
|
||||
CARGO_BUILD_ARGS += --release
|
||||
COMPILEDIR := target/release
|
||||
else
|
||||
COMPILEDIR := target/debug
|
||||
endif
|
||||
|
||||
COMPILED_BINS := \
|
||||
$(addprefix $(COMPILEDIR)/,$(USR_BIN) $(USR_SBIN) $(SERVICE_BIN))
|
||||
|
||||
|
@ -30,21 +38,25 @@ DEB=${PACKAGE}_${PKGVER}-${PKGREL}_${ARCH}.deb
|
|||
|
||||
DESTDIR=
|
||||
|
||||
all:
|
||||
cargo build
|
||||
all: cargo-build $(SUBDIRS)
|
||||
|
||||
.PHONY: $(SUBDIRS)
|
||||
$(SUBDIRS):
|
||||
$(MAKE) -C $@
|
||||
|
||||
test:
|
||||
cargo test
|
||||
|
||||
.PHONY: deb
|
||||
deb ${DEB}:
|
||||
# always re-create this dir
|
||||
.PHONY: build
|
||||
build:
|
||||
rm -rf build
|
||||
# build here to cache results
|
||||
cargo build --release
|
||||
$(MAKE) -C www
|
||||
rsync -a debian Cargo.toml src www etc target build
|
||||
cd build; dpkg-buildpackage -b -us -uc
|
||||
rsync -a debian Makefile defines.mk Cargo.toml src $(SUBDIRS) build/
|
||||
|
||||
.PHONY: deb
|
||||
deb: $(DEB)
|
||||
$(DEB): build
|
||||
cd build; dpkg-buildpackage -b -us -uc
|
||||
|
||||
distclean: clean
|
||||
|
||||
|
@ -58,11 +70,11 @@ clean:
|
|||
dinstall: ${DEB}
|
||||
dpkg -i ${DEB}
|
||||
|
||||
.PHONY: build-release
|
||||
build-release:
|
||||
cargo build --release
|
||||
.PHONY: cargo-build
|
||||
cargo-build:
|
||||
cargo build $(CARGO_BUILD_ARGS)
|
||||
|
||||
$(COMPILED_BINS): build-release
|
||||
$(COMPILED_BINS): cargo-build
|
||||
|
||||
install: $(COMPILED_BINS)
|
||||
install -dm755 $(DESTDIR)$(BINDIR)
|
||||
|
|
|
@ -7,8 +7,15 @@
|
|||
%:
|
||||
dh $@ --with=systemd --with=bash-completion
|
||||
|
||||
override_dh_autobuild:
|
||||
make PROXY_USER=www-data
|
||||
override_dh_auto_build:
|
||||
dh_auto_build -- \
|
||||
PROXY_USER=www-data BUILD_MODE=release \
|
||||
LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
|
||||
|
||||
override_dh_auto_install:
|
||||
dh_auto_install -- \
|
||||
PROXY_USER=www-data BUILD_MODE=release \
|
||||
LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
|
||||
|
||||
override_dh_installinit:
|
||||
dh_installinit
|
||||
|
|
Loading…
Reference in New Issue