File: rules

package info (click to toggle)
gir-rust-code-generator 0.21.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,516 kB
  • sloc: python: 191; makefile: 31
file content (38 lines) | stat: -rwxr-xr-x 1,486 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
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk
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
export PATH := /usr/share/cargo/bin:$(PATH)
export CARGO=/usr/share/cargo/bin/cargo
export CARGO_HOME=$(shell pwd)/debian/cargo_home
export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@  --buildsystem=cargo

execute_after_dh_auto_clean:
	rm -rf debian/cargo_registry
	rm -rf debian/cargo-checksum.json

# touch a dummy checksum to allow building
override_dh_auto_configure:
	$(CARGO) prepare-debian debian/cargo_registry --link-from-system
	rm -f Cargo.lock
	touch debian/cargo-checksum.json
	dh_auto_configure

execute_before_dh_installdocs:
	mkdir -p debian/gir-rust-code-generator/usr/share/doc/gir-rust-code-generator/html
	cd $(CURDIR)/book/src && \
	for f in *.md ; do pandoc $$f -f markdown -t html -s -o $$f.html; done && \
	mv $(CURDIR)/book/src/*.html $(CURDIR)/debian/gir-rust-code-generator/usr/share/doc/gir-rust-code-generator/html
	cd $(CURDIR)/book/src/tutorial && \
	for f in *.md; do pandoc $$f -f markdown -t html -s -o $$f.html; done && \
	mv $(CURDIR)/book/src/tutorial/*.html $(CURDIR)/debian/gir-rust-code-generator/usr/share/doc/gir-rust-code-generator/html
execute_after_dh_auto_install:
	/usr/share/cargo/bin/dh-cargo-built-using gir