rules 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/usr/bin/make -f
  2. # -*- makefile -*-
  3. # Uncomment this to turn on verbose mode.
  4. export DH_VERBOSE=1
  5. export GOPATH=$(CURDIR)/debian/build
  6. PKGDIR=debian/gogs
  7. %:
  8. dh $@
  9. clean:
  10. dh_clean
  11. rm -rf $(GOPATH)/bin/* $(GOPATH)/pkg/*
  12. #cd $(GOPATH)/src && find * -name '*.go' -exec dirname {} \; | xargs -n1 go clean
  13. rm -f $(GOPATH)/goinstall.log
  14. binary-arch: clean
  15. dh_prep
  16. dh_installdirs
  17. # Work around internal gogs package names
  18. mkdir -p $(GOPATH)/src/github.com/gogits/
  19. go get -d
  20. rm -rf $(GOPATH)/src/github.com/gogits/gogs
  21. ln -s $(CURDIR) $(GOPATH)/src/github.com/gogits/gogs
  22. go build
  23. mkdir -p $(PKGDIR)/DEBIAN
  24. mkdir -p $(PKGDIR)/opt/gogs
  25. mkdir -p $(PKGDIR)/opt/gogs/data
  26. mkdir -p $(PKGDIR)/opt/gogs/log
  27. mkdir -p $(PKGDIR)/opt/gogs/custom/conf
  28. mkdir -p $(PKGDIR)/var/log
  29. mkdir -p $(PKGDIR)/etc
  30. mkdir -p $(PKGDIR)/etc/init.d
  31. ln -s /opt/gogs/log $(PKGDIR)/var/log/gogs
  32. ln -s /opt/gogs/conf $(PKGDIR)/etc/gogs
  33. cp debian/gogs.init $(PKGDIR)/etc/init.d/gogs
  34. cp gogs $(PKGDIR)/opt/gogs
  35. cp -rp public $(PKGDIR)/opt/gogs
  36. cp -rp templates $(PKGDIR)/opt/gogs
  37. cp -rp conf $(PKGDIR)/opt/gogs
  38. cp debian/postinst $(PKGDIR)/DEBIAN
  39. sed -i 's#^MODE =.*#MODE = file#' $(PKGDIR)/opt/gogs/conf/app.ini
  40. #dh_strip
  41. dh_compress
  42. dh_fixperms
  43. dh_installdeb
  44. dh_gencontrol
  45. dh_md5sums
  46. dh_builddeb
  47. binary: binary-arch