File: rules

package info (click to toggle)
rust-coreutils 0.0.17-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 12,956 kB
  • sloc: sh: 491; python: 304; javascript: 72; makefile: 37
file content (41 lines) | stat: -rwxr-xr-x 1,457 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
#!/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_HOST_RUST_TYPE DEB_HOST_GNU_TYPE
VERSION := $(shell dpkg-parsechangelog -S Version|sed -e "s|.*~\(.*\)-.*|\1|g")


# Build a multicall binary instead of multiple binaries
# to reduce the storage footprint
export MULTICALL = y

%:
	dh $@ --buildsystem cargo

override_dh_auto_test:
	# for now, don't fail the build if tests are failing
	CARGO_HOME=$(CURDIR)/debian/cargo_home make PROFILE=release MULTICALL=$(MULTICALL) test||true

override_dh_auto_install:
	CARGO_HOME=$(CURDIR)/debian/cargo_home DEB_CARGO_CRATE=coreutils_$(VERSION) /usr/share/cargo/bin/cargo prepare-debian debian/cargo_registry --link-from-system
	CARGO_HOME=$(CURDIR)/debian/cargo_home DESTDIR=$(CURDIR)/debian/tmp/ make SELINUX_ENABLED=1 PROFILE=release MULTICALL=$(MULTICALL) install
# Create the symlink early to be able to generate the manpages
	dh_link

override_dh_missing:
	dh_missing --fail-missing

execute_before_dh_installman:
	cd $(CURDIR)/debian/rust-coreutils/usr/lib/cargo/bin/coreutils/; \
	for f in *; do \
		filename=$$(basename $$f); \
		help2man --no-info $$f > $(CURDIR)/docs/rust-$$filename.1; \
	done
	
	cd $(CURDIR)/debian/tmp/usr/bin/; \
	help2man --no-info coreutils > $(CURDIR)/docs/coreutils.1 || true
	
	# test --help returns nothing
	rm -f $(CURDIR)/docs/rust-test.1