File: rules

package info (click to toggle)
ruby-prometheus-client-mmap 1.2.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 700 kB
  • sloc: ruby: 3,149; sh: 54; makefile: 21
file content (31 lines) | stat: -rwxr-xr-x 1,174 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
#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk
include /usr/share/rustc/architecture.mk
include /usr/share/dpkg/pkg-info.mk

export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE

export GEM2DEB_TEST_RUNNER = --check-dependencies
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DH_RUBY = --gem-install

export CARGO=/usr/share/cargo/bin/cargo
export CARGO_HOME=$(CURDIR)/debian/cargo_home
export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)

RUBYGEMS_INTEGRATION_PATH := $(shell ruby -e 'puts Gem.path.grep(%r{^/usr/lib/.*/rubygems-integration/})')
CARGO_WORKSPACE = "debian/${DEB_SOURCE}${RUBYGEMS_INTEGRATION_PATH}/gems/prometheus-client-mmap-${DEB_VERSION_UPSTREAM}/ext/fast_mmaped_file_rs"

export RB_SYS_CARGO_TARGET_DIR = "$(shell pwd)/${CARGO_WORKSPACE}/target"
export CARGO_BUILD_TARGET = $(DEB_HOST_RUST_TYPE)

%:
	dh $@ --buildsystem=ruby --with ruby

execute_before_dh_auto_configure:
	$(CARGO) prepare-debian debian/cargo_registry --link-from-system
	echo "[workspace]\nmembers = [\"${CARGO_WORKSPACE}\"]\nresolver = \"2\"" > Cargo.toml

execute_after_dh_installexamples:
	find debian/ -name config.ru -type f -executable -exec chmod -x {} \+