1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/make -f
# Enable all hardening options
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# Keep cargo state inside the build tree.
export HOME = $(CURDIR)/debian/home
export CARGO_HOME = $(HOME)/.cargo
export CARGO_TARGET_DIR = $(CURDIR)/target
export CARGO_NET_OFFLINE = true
RUSTC := $(shell for c in rustc-1.96 rustc; do command -v $$c >/dev/null 2>&1 && { printf '%s' "$$c"; break; }; done)
CARGO := $(shell for c in cargo-1.96 cargo; do command -v $$c >/dev/null 2>&1 && { printf '%s' "$$c"; break; }; done)
%:
dh $@
override_dh_auto_configure:
mkdir -p $(CARGO_HOME)
test -d vendor
test -f .cargo/config.toml
$(RUSTC) --version
$(CARGO) --version
override_dh_auto_build:
$(CARGO) build --release --frozen
override_dh_auto_install:
install -D -m 0755 target/release/all-smi debian/all-smi/usr/bin/all-smi
install -D -m 0755 target/release/liball_smi_amd.so debian/all-smi/usr/lib/all-smi/liball_smi_amd.so
override_dh_auto_test:
@echo "Skipping tests for PPA build"
override_dh_auto_clean:
rm -rf $(CARGO_TARGET_DIR) $(HOME)
override_dh_builddeb:
dh_builddeb --destdir=../