]> git.proxmox.com Git - proxmox-backup.git/blob - debian/rules
cf94692ecfe0403568f949b3c98e203c086470b8
[proxmox-backup.git] / debian / rules
1 #!/usr/bin/make -f
2 # See debhelper(7) (uncomment to enable)
3 # output every command that modifies files on the build system.
4 DH_VERBOSE = 1
5
6 include /usr/share/dpkg/pkg-info.mk
7 include /usr/share/rustc/architecture.mk
8
9 export BUILD_MODE=release
10
11 CARGO=/usr/share/cargo/bin/cargo
12
13 export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
14 export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE
15 export CARGO_HOME = $(CURDIR)/debian/cargo_home
16
17 export DEB_CARGO_CRATE=proxmox-backup_$(DEB_VERSION_UPSTREAM)
18 export DEB_CARGO_PACKAGE=proxmox-backup
19
20 %:
21 dh $@ --with=bash-completion
22
23 override_dh_auto_configure:
24 @perl -ne 'if (/^version\s*=\s*"(\d+(?:\.\d+)+)"/) { my $$v_cargo = $$1; my $$v_deb = $$ENV{DEB_VERSION_UPSTREAM}; die "ERROR: d/changelog <-> Cargo.toml version mismatch: $$v_cargo != $$v_deb\n" if $$v_cargo ne $$v_deb; exit(0); }' Cargo.toml
25 $(CARGO) prepare-debian $(CURDIR)/debian/cargo_registry --link-from-system
26 dh_auto_configure
27
28 override_dh_auto_build:
29 dh_auto_build -- \
30 PROXY_USER=backup \
31 LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
32
33 override_dh_missing:
34 dh_missing --fail-missing
35
36 override_dh_auto_install:
37 dh_auto_install -- \
38 PROXY_USER=backup \
39 LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
40
41 override_dh_installsystemd:
42 dh_installsystemd -pproxmox-backup-server proxmox-backup-daily-update.timer
43 # note: we start/try-reload-restart services manually in postinst
44 dh_installsystemd --no-start --no-restart-after-upgrade
45
46 override_dh_fixperms:
47 dh_fixperms --exclude sg-tape-cmd
48
49 override_dh_strip:
50 dh_strip
51 for exe in $$(find \
52 debian/proxmox-backup-client/usr \
53 debian/proxmox-backup-server/usr \
54 debian/proxmox-backup-file-restore \
55 -executable -type f); do \
56 debian/scripts/elf-strip-unused-dependencies.sh "$$exe" || true; \
57 done
58
59 override_dh_compress:
60 dh_compress -X.pdf