mirror of
https://github.com/quintusl/rust-socksd.git
synced 2026-11-13 16:17:46 +00:00
55 lines
1.6 KiB
Makefile
Executable File
55 lines
1.6 KiB
Makefile
Executable File
#!/usr/bin/make -f
|
|
|
|
include /usr/share/dpkg/architecture.mk
|
|
|
|
ifndef CARGO_BUILD_TARGET
|
|
ifeq ($(DEB_HOST_ARCH),amd64)
|
|
CARGO_BUILD_TARGET = x86_64-unknown-linux-gnu
|
|
else ifeq ($(DEB_HOST_ARCH),arm64)
|
|
CARGO_BUILD_TARGET = aarch64-unknown-linux-gnu
|
|
else ifeq ($(DEB_HOST_ARCH),armhf)
|
|
CARGO_BUILD_TARGET = armv7-unknown-linux-gnueabihf
|
|
endif
|
|
endif
|
|
|
|
%:
|
|
dh $@
|
|
|
|
override_dh_auto_build:
|
|
ifdef USE_CROSS
|
|
ifdef CARGO_BUILD_TARGET
|
|
cross build --release --target $(CARGO_BUILD_TARGET)
|
|
else
|
|
cross build --release
|
|
endif
|
|
else
|
|
ifdef CARGO_BUILD_TARGET
|
|
cargo build --release --target $(CARGO_BUILD_TARGET)
|
|
else
|
|
cargo build --release
|
|
endif
|
|
endif
|
|
|
|
override_dh_auto_install:
|
|
ifdef CARGO_BUILD_TARGET
|
|
install -D -m755 target/$(CARGO_BUILD_TARGET)/release/rust-socksd debian/rust-socksd/usr/bin/rust-socksd
|
|
else
|
|
install -D -m755 target/release/rust-socksd debian/rust-socksd/usr/bin/rust-socksd
|
|
endif
|
|
install -D -m644 config/rust-socksd.service debian/rust-socksd/lib/systemd/system/rust-socksd.service
|
|
install -D -m644 config/rust-socksd.sysusers.conf debian/rust-socksd/usr/lib/sysusers.d/rust-socksd.conf
|
|
install -D -m640 config/config.yml.journald.example debian/rust-socksd/etc/rust-socksd/config.yml
|
|
install -D -m660 config/users.yml.example debian/rust-socksd/etc/rust-socksd/users.yml
|
|
install -d debian/rust-socksd/var/log/rust-socksd
|
|
install -d debian/rust-socksd/var/lib/rust-socksd
|
|
|
|
override_dh_auto_clean:
|
|
rm -rf target
|
|
|
|
override_dh_auto_test:
|
|
# Skip tests for now - can be enabled later
|
|
# cargo test
|
|
|
|
.PHONY: override_dh_strip
|
|
override_dh_strip:
|
|
dh_strip --exclude=rust-socksd
|