File: rules

package info (click to toggle)
caddy 2.6.2-14
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,876 kB
  • sloc: sh: 730; makefile: 30
file content (44 lines) | stat: -rwxr-xr-x 2,006 bytes parent folder | download | duplicates (2)
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
38
39
40
41
42
43
44
#!/usr/bin/make -f

#export DH_VERBOSE := 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DH_GOPKG := github.com/caddyserver/caddy/v2
export DH_GOLANG_INSTALL_EXTRA := caddytest
export DH_GOLANG_EXCLUDES := integration tracing
export BUILDDIR := build

export deb_systemdsystemunitdir = $(shell pkg-config --variable=systemdsystemunitdir systemd | sed s,^/,,)

include /usr/share/dpkg/pkg-info.mk
LDFLAGS := -ldflags '-X $(DH_GOPKG).CustomVersion=$(DEB_VERSION_UPSTREAM) -X $(DH_GOPKG)/cmd.CustomDate="$(SOURCE_DATE_EPOCH)"'

%:
	dh $@ --builddirectory=$(BUILDDIR) --buildsystem=golang --with=golang

override_dh_auto_build:
	dh_auto_build -- $(LDFLAGS)

override_dh_auto_configure:
	#import missing missing-sources
	mkdir -p -v $(BUILDDIR)/src/github.com/caddyserver/caddy/v2/vendor/
	cp -v -a debian/missing-sources/* $(BUILDDIR)/src/github.com/caddyserver/caddy/v2/vendor/
	#import missing http files into build dir
	mkdir -p -v $(BUILDDIR)/src/github.com/caddyserver/caddy/v2/modules/caddyhttp/fileserver/
	cp -v -a modules/caddyhttp/fileserver/browse.html $(BUILDDIR)/src/github.com/caddyserver/caddy/v2/modules/caddyhttp/fileserver/
	cp -v -a debian/missing-sources/caddy/fileserver/browse.html $(BUILDDIR)/src/github.com/caddyserver/caddy/v2/modules/caddyhttp/fileserver/
	dh_auto_configure

override_dh_auto_install:
	#import install/remove scripts
	cp -a dist/scripts/postinstall.sh debian/caddy.postinst
	cp -a dist/scripts/postremove.sh debian/caddy.postrm
	cp -a dist/scripts/preremove.sh debian/caddy.prerm
	dh_auto_install -- --no-source
	#generate shell completions
	mkdir -p debian/generated/completions
	debian/caddy/usr/bin/caddy completion bash > debian/generated/completions/caddy
	debian/caddy/usr/bin/caddy completion zsh > debian/generated/completions/_caddy
	debian/caddy/usr/bin/caddy completion fish > debian/generated/completions/caddy.fish
	#generate manpage
	mkdir -p debian/generated/manpages
	debian/caddy/usr/bin/caddy manpage --directory debian/generated/manpages