File: rules

package info (click to toggle)
waypipe 0.11.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,380 kB
  • sloc: ansic: 15,809; xml: 9,436; python: 1,726; sh: 101; makefile: 40
file content (52 lines) | stat: -rwxr-xr-x 1,459 bytes parent folder | download
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
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk
include /usr/share/rustc/architecture.mk
export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
export DEB_CARGO_CRATE=waypipe_0.11.0
export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE
export PATH := /usr/share/cargo/bin/:$(PATH)
export CARGO_HOME=$(CURDIR)/debian/cargo_home
export CARGO_REGISTRY=$(CURDIR)/debian/local-registry

RUNTIME_LIBS=libavcodec.so libgbm.so

ifeq ($(shell dpkg --compare-versions $$(dpkg-query -W -f '$${Version}\n' librust-getrandom-dev) gt 0.4; echo $$?), 0)
	FEATURES=getrandom_04
else
	FEATURES=getrandom_02
endif

%:
	dh $@

execute_before_dh_auto_configure:
	mkdir -p .cargo
	cargo prepare-debian $(CARGO_REGISTRY) --link-from-system --features "$(FEATURES)"
	mv Cargo.lock Cargo.lock.ignored

execute_after_dh_auto_clean:
	rm -f waypipe.1
	rm -rf target
	if [ -f Cargo.lock.ignored ]; then \
	  mv Cargo.lock.ignored Cargo.lock; \
	fi
	rm -rf $(CARGO_REGISTRY)
	rm -rf $(CARGO_HOME)

override_dh_auto_configure:

override_dh_auto_build:
	cargo build --release  --features "$(FEATURES)"
	scdoc < waypipe.scd > waypipe.1

override_dh_auto_install:
	install -D target/$(DEB_HOST_RUST_TYPE)/release/waypipe debian/tmp/usr/bin/waypipe

override_dh_auto_test:
	cargo test --release --features "$(FEATURES)"

execute_before_dh_gencontrol:
	dh-cargo-built-using waypipe
	DEB_HOST_MULTIARCH=$(DEB_HOST_MULTIARCH) debian/runtime-recommends.sh $(RUNTIME_LIBS)