File: rules

package info (click to toggle)
micro 2.0.11-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,448 kB
  • sloc: sh: 232; makefile: 72; xml: 24
file content (34 lines) | stat: -rwxr-xr-x 1,226 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
#!/usr/bin/make -f

# Export DEB_VERSION
include /usr/share/dpkg/pkg-info.mk

# Linker variables from upstream (micro) Makefile
export VERSION := $(shell echo $(DEB_VERSION) | cut -d'-' -f1)

# Extra plugins that need installation
export DH_GOLANG_INSTALL_EXTRA := runtime/colorschemes runtime/help runtime/plugins runtime/syntax

# Disable cgo to avoid lintian warn: 'hardening-no-fortify-functions'
export CGO_ENABLED = 0

# Define build target
export DH_GOLANG_BUILDPKG := github.com/zyedidia/micro/cmd/micro

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

execute_before_dh_auto_configure:
	mkdir -p vendor/
	cp -a debian/ext/* vendor/
	sed -i -e 's|Icon=micro|Icon=/usr/share/micro/micro-logo-mark.svg|g' assets/packaging/micro.desktop

override_dh_auto_build:
	cd obj-$(DEB_BUILD_GNU_TYPE) && GOCACHE=/tmp/gocache GO111MODULE=off GOPATH=$$(pwd) go generate github.com/zyedidia/micro/runtime && cd ..
	dh_auto_build -- -buildmode=pie \
	-ldflags="-extldflags -Wl,-z,now -s -w -X 'github.com/zyedidia/micro/internal/util.Version=$(VERSION)'"
# Adding CompileDate is bad reproducibility and
# adding CommitHash is redundant as we don't use that to build a package.

override_dh_auto_install:
	dh_auto_install -- --no-source