github.com/canonical/ubuntu-image@v0.0.0-20240430122802-2202fe98b290/debian/rules (about) 1 #!/usr/bin/make -f 2 #export DH_VERBOSE = 1 3 4 export DEB_BUILD_MAINT_OPTIONS = optimize=-lto 5 export DH_GOPKG := github.com/canonical/ubuntu-image 6 7 # strict symbols checking 8 export DPKG_GENSYMBOLS_CHECK_LEVEL=4 9 10 PKGVERSION=$(shell dpkg-parsechangelog --show-field version) 11 BUILDFLAGS+= -buildmode=pie -ldflags "-X main.Version=$(PKGVERSION)" 12 builddir = $(CURDIR)/obj-$(DEB_HOST_GNU_TYPE) 13 artifactsdir = $(builddir)/build 14 15 %: 16 dh $@ --buildsystem=golang --with=golang 17 18 override_dh_auto_clean: 19 dh_auto_clean 20 # create the vendor directory when building the source package 21 [ -d vendor/ ] || go mod vendor 22 23 override_dh_auto_install: 24 dh_auto_install -- --no-source 25 26 override_dh_installman: 27 mkdir -p $(artifactsdir) 28 rst2man ubuntu-image.rst $(artifactsdir)/ubuntu-image.1 29 dh_installman 30 31 override_dh_auto_test: 32 33 override_dh_auto_build: 34 dh_auto_build -- $(BUILDFLAGS) 35 36 override_dh_missing: 37 dh_missing --fail-missing