File: rules

package info (click to toggle)
lf 28-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 640 kB
  • sloc: sh: 129; makefile: 22; csh: 4
file content (37 lines) | stat: -rwxr-xr-x 1,144 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
35
36
37
#!/usr/bin/make -f

export DH_VERBOSE = 1
include /usr/share/dpkg/pkg-info.mk

# The tarball source does not include the upstream version, so let's
# get it from the source package and inject it at build time
# (see packages gdu and golang-github-micromdm-scep for similar)
#
export CGO_ENABLED := 0
DH_GOPKG := github.com/gokcehan/lf

VERSION = $(DEB_VERSION_UPSTREAM)
GO_LDFLAGS := -ldflags '-X "main.gVersion=$(VERSION)"'

override_dh_auto_build:
	dh_auto_build -- $(GO_LDFLAGS)

override_dh_auto_install:
	dh_auto_install -- --no-source

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

override_dh_auto_install:
	# Remove PowerShell files
	rm -f ./etc/lf.ps1 ./etc/lfcd.ps1 ./etc/lfrc.ps1.example
	# Remove Windows cmd.exe files
	rm -f ./etc/lfcd.cmd ./etc/lfrc.cmd.example
	dh_auto_install -- --no-source
	# Install completions
	install -D -m644 $(CURDIR)/etc/lf.bash \
		$(CURDIR)/debian/lf/usr/share/bash-completion/completions/lf
	install -D -m644 $(CURDIR)/etc/lf.zsh \
		$(CURDIR)/debian/lf/usr/share/zsh/vendor-completions/_lf
	install -D -m644 $(CURDIR)/etc/lf.fish \
		$(CURDIR)/debian/lf/usr/share/fish/vendor_completions.d/lf.fish