| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 5 |
export DH_GOPKG := github.com/caddyserver/caddy/v2 |
| 6 |
export DH_GOLANG_INSTALL_EXTRA := caddytest |
| 7 |
export DH_GOLANG_EXCLUDES := integration tracing |
| 8 |
export BUILDDIR := build |
| 9 |
|
| 10 |
export deb_systemdsystemunitdir = $(shell pkg-config --variable=systemdsystemunitdir systemd | sed s,^/,,) |
| 11 |
|
| 12 |
include /usr/share/dpkg/pkg-info.mk |
| 13 |
LDFLAGS := -ldflags '-X $(DH_GOPKG).CustomVersion=$(DEB_VERSION_UPSTREAM) -X $(DH_GOPKG)/cmd.CustomDate="$(SOURCE_DATE_EPOCH)"' |
| 14 |
|
| 15 |
%: |
| 16 |
dh $@ --builddirectory=$(BUILDDIR) --buildsystem=golang --with=golang |
| 17 |
|
| 18 |
override_dh_auto_build: |
| 19 |
dh_auto_build -- $(LDFLAGS) |
| 20 |
|
| 21 |
override_dh_auto_configure: |
| 22 |
|
| 23 |
mkdir -p -v $(BUILDDIR)/src/github.com/caddyserver/caddy/v2/vendor/ |
| 24 |
cp -v -a debian/missing-sources/* $(BUILDDIR)/src/github.com/caddyserver/caddy/v2/vendor/ |
| 25 |
|
| 26 |
mkdir -p -v $(BUILDDIR)/src/github.com/caddyserver/caddy/v2/modules/caddyhttp/fileserver/ |
| 27 |
cp -v -a modules/caddyhttp/fileserver/browse.html $(BUILDDIR)/src/github.com/caddyserver/caddy/v2/modules/caddyhttp/fileserver/ |
| 28 |
cp -v -a debian/missing-sources/caddy/fileserver/browse.html $(BUILDDIR)/src/github.com/caddyserver/caddy/v2/modules/caddyhttp/fileserver/ |
| 29 |
dh_auto_configure |
| 30 |
|
| 31 |
override_dh_auto_install: |
| 32 |
|
| 33 |
cp -a dist/scripts/postinstall.sh debian/caddy.postinst |
| 34 |
cp -a dist/scripts/postremove.sh debian/caddy.postrm |
| 35 |
cp -a dist/scripts/preremove.sh debian/caddy.prerm |
| 36 |
dh_auto_install -- --no-source |
| 37 |
|
| 38 |
mkdir -p debian/generated/completions |
| 39 |
debian/tmp/usr/bin/caddy completion bash > debian/generated/completions/caddy |
| 40 |
debian/tmp/usr/bin/caddy completion zsh > debian/generated/completions/_caddy |
| 41 |
debian/tmp/usr/bin/caddy completion fish > debian/generated/completions/caddy.fish |
| 42 |
|
| 43 |
mkdir -p debian/generated/manpages |
| 44 |
debian/tmp/usr/bin/caddy manpage --directory debian/generated/manpages |