rules 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/usr/bin/make -f
  2. REPO := gosigar
  3. WHOAMI := themusicgod1
  4. NOTABUG := notabug
  5. # Required: Put the url (without http://) of your git repo.
  6. export DH_GOPKG := notabug.org/$(WHOAMI)/$(REPO)
  7. # Required: Put the name of your git repo below.
  8. GIT_REPO_NAME := $(NOTABUG)-$(WHOAMI)-$(REPO)
  9. OUT1 := debian/golang-$(GIT_REPO_NAME)-dev/usr/lib/$(REPO)
  10. # usr/gocode/src/notabug.org/$(WHOAMI)/$(REPO)/
  11. BUILD_DIR := obj-$(DEB_HOST_GNU_TYPE)
  12. export PATH := $(CURDIR)/$(BUILD_DIR)/bin:$(PATH)
  13. ##
  14. # From git-lfs/git-lfs repo:
  15. # by-default, dh_golang only copies *.go and other source - this upsets a bunch of vendor test routines
  16. ##
  17. #export DH_GOLANG_INSTALL_ALL := 1
  18. %:
  19. dh $@ --buildsystem=golang --with=golang
  20. override_dh_auto_build:
  21. dh_auto_build -- -ldflags "-s -w"
  22. ##
  23. # From git-lfs/git-lfs repo:
  24. # dh_golang doesn't do anything here in deb 8, and it's needed in both
  25. ##
  26. ## ??
  27. if [ "$(DEB_HOST_GNU_TYPE)" != "$(DEB_BUILD_GNU_TYPE)" ]; then\
  28. cp -rf $(BUILD_DIR)/bin/*/* $(BUILD_DIR)/bin/; \
  29. # cp -rf $(BUILD_DIR)/pkg/*/* $(BUILD_DIR)/pkg/; \
  30. fi
  31. override_dh_auto_install:
  32. # golang-notabug-themusicgod1-panicparse-dev
  33. # This is making a "fakeroot" so that when the deb is installed the binary will be placed in /usr/bin.
  34. # mkdir -p debian/golang-$(GIT_REPO_NAME)-dev/usr/bin
  35. mkdir -p $(OUT1)
  36. mkdir -p $(OUT1)/examples
  37. # mkdir -p $(OUT1)/pkg
  38. mkdir -p $(OUT1)/src/gosigar
  39. # This is copying the binary and placing it in the fake root path.
  40. cp $(BUILD_DIR)/bin/df $(OUT1)/examples
  41. cp $(BUILD_DIR)/bin/free $(OUT1)/examples
  42. cp $(BUILD_DIR)/bin/ps $(OUT1)/examples
  43. cp $(BUILD_DIR)/bin/ss $(OUT1)/examples
  44. cp $(BUILD_DIR)/bin/uptime $(OUT1)/examples
  45. # cp -r $(BUILD_DIR)/pkg/* $(OUT1)/pkg
  46. cp -r $(BUILD_DIR)/src/* $(OUT1)/src