2015-05-15 15:27:21 +00:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
|
|
|
export DH_OPTIONS
|
2016-05-23 21:03:25 +00:00
|
|
|
export GO15VENDOREXPERIMENT=1
|
2015-05-15 15:27:21 +00:00
|
|
|
|
2015-07-26 15:26:57 +00:00
|
|
|
#dh_golang doesn't do this for you
|
2015-07-26 17:02:57 +00:00
|
|
|
ifeq ($(DEB_HOST_ARCH), i386)
|
2015-07-26 15:26:57 +00:00
|
|
|
export GOARCH := 386
|
2015-07-26 17:02:57 +00:00
|
|
|
else ifeq ($(DEB_HOST_ARCH), amd64)
|
2015-07-26 15:26:57 +00:00
|
|
|
export GOARCH := amd64
|
|
|
|
endif
|
|
|
|
|
|
|
|
BUILD_DIR := obj-$(DEB_HOST_GNU_TYPE)
|
2016-11-15 17:07:11 +00:00
|
|
|
export DH_GOPKG := github.com/git-lfs/git-lfs
|
2016-06-05 20:01:49 +00:00
|
|
|
# DH_GOLANG_EXCLUDES typically incorporates vendor exclusions from script/test
|
2016-11-22 16:42:22 +00:00
|
|
|
export DH_GOLANG_EXCLUDES := test github.com/olekukonko/ts/* github.com/xeipuuv/* github.com/spf13/cobra/* github.com/kr/* github.com/pkg/errors
|
2015-05-15 15:27:21 +00:00
|
|
|
export PATH := $(CURDIR)/$(BUILD_DIR)/bin:$(PATH)
|
2016-07-27 13:49:23 +00:00
|
|
|
|
2016-06-05 19:08:23 +00:00
|
|
|
# by-default, dh_golang only copies *.go and other source - this upsets a bunch of vendor test routines
|
|
|
|
export DH_GOLANG_INSTALL_ALL := 1
|
2015-05-15 15:27:21 +00:00
|
|
|
|
|
|
|
%:
|
|
|
|
dh $@ --buildsystem=golang --with=golang
|
|
|
|
|
|
|
|
override_dh_clean:
|
|
|
|
rm -f debian/debhelper.log
|
|
|
|
rm -rf man
|
|
|
|
dh_clean
|
|
|
|
|
|
|
|
override_dh_auto_build:
|
|
|
|
dh_auto_build
|
2016-05-23 21:03:25 +00:00
|
|
|
#dh_golang doesn't do anything here in deb 8, and it's needed in both
|
2015-07-26 17:02:57 +00:00
|
|
|
if [ "$(DEB_HOST_GNU_TYPE)" != "$(DEB_BUILD_GNU_TYPE)" ]; then\
|
|
|
|
cp -rf $(BUILD_DIR)/bin/*/* $(BUILD_DIR)/bin/; \
|
|
|
|
cp -rf $(BUILD_DIR)/pkg/*/* $(BUILD_DIR)/pkg/; \
|
2015-07-26 15:26:57 +00:00
|
|
|
fi
|
2015-05-15 15:27:21 +00:00
|
|
|
rm $(BUILD_DIR)/bin/script
|
2016-02-25 05:04:55 +00:00
|
|
|
rm $(BUILD_DIR)/bin/man
|
2015-05-15 15:27:21 +00:00
|
|
|
./script/man
|
|
|
|
|
|
|
|
override_dh_strip:
|
|
|
|
# strip disabled as golang upstream doesn't support it and it makes go
|
|
|
|
# crash. See https://launchpad.net/bugs/1200255.
|
|
|
|
|
|
|
|
override_dh_auto_install:
|
|
|
|
mkdir -p debian/git-lfs/usr/bin
|
|
|
|
cp $(BUILD_DIR)/bin/git-lfs debian/git-lfs/usr/bin/
|
|
|
|
|
|
|
|
override_dh_auto_test:
|
2016-11-15 17:07:11 +00:00
|
|
|
ln -s ../../../../../../commands/repos $(BUILD_DIR)/src/github.com/git-lfs/git-lfs/commands/repos
|
|
|
|
ln -s ../../../../bin $(BUILD_DIR)/src/github.com/git-lfs/git-lfs/bin
|
2015-07-26 15:26:57 +00:00
|
|
|
#dh_golang uses the wrong dir to test on. This tricks everything into being happy
|
|
|
|
DEB_BUILD_GNU_TYPE=$(DEB_HOST_GNU_TYPE) dh_auto_test
|
2016-11-15 17:07:11 +00:00
|
|
|
rm $(BUILD_DIR)/src/github.com/git-lfs/git-lfs/commands/repos $(BUILD_DIR)/src/github.com/git-lfs/git-lfs/bin
|