File: rules

package info (click to toggle)
gocryptfs 1.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,636 kB
  • sloc: sh: 782; makefile: 47
file content (34 lines) | stat: -rwxr-xr-x 1,207 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

include /usr/share/dpkg/default.mk

export DH_GOLANG_EXCLUDES := example test
export DH_GOLANG_INSTALL_ALL := 1

GOFUSE_VERSION_UPSTREAM=$(shell dpkg-query -f='$${source:Upstream-Version}' -W golang-github-hanwen-go-fuse-dev)
CHANGELOG_TIMESTAMP=$(shell date -u --rfc-3339=date -d@$(SOURCE_DATE_EPOCH))
DEB_LDFLAGS="-X main.GitVersion=$(DEB_VERSION_UPSTREAM) -X main.GitVersionFuse=$(GOFUSE_VERSION_UPSTREAM) -X main.BuildDate=$(CHANGELOG_TIMESTAMP)"

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

override_dh_auto_build:
	env > /tmp/env
	env
	dh_auto_build -- -ldflags $(DEB_LDFLAGS)
	cp -r internal/* obj*/src/github.com/rfjakob/gocryptfs/internal/
	cp -r tests/* obj*/src/github.com/rfjakob/gocryptfs/tests
	cp obj*/bin/gocryptfs obj*/src/github.com/rfjakob/gocryptfs/
	pandoc Documentation/MANPAGE.md -s -t man -o debian/gocryptfs.1
	pandoc Documentation/MANPAGE-XRAY.md -s -t man -o debian/gocryptfs-xray.1
	pandoc Documentation/MANPAGE-STATFS.md -s -t man -o debian/statfs.1

override_dh_auto_clean:
	rm -f debian/gocryptfs.1
	rm -f debian/gocryptfs-xray.1
	rm -f debian/statfs.1
	dh_auto_clean

override_dh_auto_install:
	dh_auto_install
	rm -rf debian/gocryptfs/usr/share/gocode