| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
include /usr/share/dpkg/pkg-info.mk |
| 4 |
|
| 5 |
# Include all assets, templates, etc. in build directory |
| 6 |
export DH_GOLANG_INSTALL_ALL := 1 |
| 7 |
|
| 8 |
GOPATH = $(CURDIR)/_build |
| 9 |
GO_IMPORT_PATH = miniflux.app/v2 |
| 10 |
|
| 11 |
export DH_GOLANG_BUILDPKG := $(GO_IMPORT_PATH) |
| 12 |
|
| 13 |
# Use changelog date instead of actual current date to ensure reproducible build |
| 14 |
BUILD_DATE := $(shell date +%FT%T%z -d @$(SOURCE_DATE_EPOCH)) |
| 15 |
LD_FLAGS := -s -w \ |
| 16 |
-X 'miniflux.app/v2/internal/version.Version=$(DEB_VERSION_UPSTREAM)' \ |
| 17 |
-X 'miniflux.app/v2/internal/version.BuildDate=$(BUILD_DATE)' |
| 18 |
|
| 19 |
%: |
| 20 |
dh $@ --builddirectory=_build --buildsystem=golang --with=golang --with=installsysusers |
| 21 |
|
| 22 |
override_dh_auto_build: |
| 23 |
dh_auto_build -- -ldflags "$(LD_FLAGS)" |
| 24 |
# Rename binary to miniflux |
| 25 |
mv $(GOPATH)/bin/v2 $(GOPATH)/bin/miniflux |
| 26 |
|
| 27 |
override_dh_auto_install: |
| 28 |
dh_auto_install -- --no-source |