49 lines
1.5 KiB
Makefile
Executable File
49 lines
1.5 KiB
Makefile
Executable File
#!/usr/bin/make -f
|
|
|
|
export DH_OPTIONS
|
|
|
|
#dh_golang doesn't do this for you
|
|
ifeq ($(DEB_HOST_ARCH), i386)
|
|
export GOARCH := 386
|
|
else ifeq ($(DEB_HOST_ARCH), amd64)
|
|
export GOARCH := amd64
|
|
endif
|
|
|
|
BUILD_DIR := obj-$(DEB_HOST_GNU_TYPE)
|
|
export DH_GOPKG := github.com/github/git-lfs
|
|
export DH_GOLANG_EXCLUDES := test
|
|
export PATH := $(CURDIR)/$(BUILD_DIR)/bin:$(PATH)
|
|
|
|
%:
|
|
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
|
|
#dh_golang doesn't do anything here in deb 8, and it's needed in both
|
|
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/; \
|
|
fi
|
|
rm $(BUILD_DIR)/bin/script
|
|
./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:
|
|
ln -s ../../../../../../commands/repos $(BUILD_DIR)/src/github.com/github/git-lfs/commands/repos
|
|
ln -s ../../../../bin $(BUILD_DIR)/src/github.com/github/git-lfs/bin
|
|
#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
|
|
rm $(BUILD_DIR)/src/github.com/github/git-lfs/commands/repos $(BUILD_DIR)/src/github.com/github/git-lfs/bin
|