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
|
#!/usr/bin/make -f
#export DH_VERBOSE = 1
include /usr/share/dpkg/default.mk
include /usr/share/rustc/architecture.mk
export PYBUILD_NAME=proton-vpn-local-agent
export DEB_BUILD_MAINT_OPTIONS=hardening=+all,
export RUSTFLAGS += -C link-arg=-Wl,-z,relro -C link-arg=-Wl,-z,now -C link-arg=-Wl,-z,noexecstack
export CARGO_BUILD_TARGET = $(DEB_HOST_RUST_TYPE)
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=$(CURDIR)/debian/cargo_home
export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
export DEB_CARGO_MANIFEST_PATH=$(CURDIR)/python-proton-vpn-local-agent/Cargo.toml
%:
dh $@
# tests disabled because they require connection to an external server
override_dh_auto_test:
override_dh_auto_configure:
$(CARGO) prepare-debian debian/cargo_registry --link-from-system
rm -f $(CURDIR)/python-proton-vpn-local-agent/Cargo.lock
dh_auto_configure
override_dh_auto_build:
$(CARGO) build --manifest-path python-proton-vpn-local-agent/Cargo.toml --offline --release
override_dh_install:
mkdir -p debian/python3-proton-vpn-local-agent/usr/lib/python3/dist-packages/proton/vpn
touch debian/python3-proton-vpn-local-agent/usr/lib/python3/dist-packages/proton/vpn/__init__.py
install -m 644 -p -T \
python-proton-vpn-local-agent/target/$(DEB_HOST_RUST_TYPE)/release/libpython_proton_vpn_local_agent.so \
debian/python3-proton-vpn-local-agent/usr/lib/python3/dist-packages/proton/vpn/local_agent.abi3.so
|