You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
3.5 KiB

  1. name: gitea
  2. summary: Gitea - A painless self-hosted Git service
  3. description: |
  4. The goal of this project is to make the easiest, fastest, and most painless
  5. way of setting up a self-hosted Git service. With Go, this can be done with
  6. an independent binary distribution across ALL platforms that Go supports,
  7. including Linux, Mac OS X, Windows and ARM.
  8. type: app
  9. icon: public/img/gitea-lg.png
  10. confinement: strict
  11. grade: stable
  12. version: 'git'
  13. apps:
  14. gitea:
  15. command: bin/gitea
  16. plugs: [network, network-bind]
  17. web:
  18. command: bin/gitea web
  19. daemon: simple
  20. plugs: [network, network-bind]
  21. serv:
  22. command: bin/gitea serv
  23. plugs: [network, network-bind]
  24. admin:
  25. command: bin/gitea admin
  26. plugs: [network, network-bind]
  27. cert:
  28. command: bin/gitea cert
  29. hook:
  30. command: bin/gitea hook
  31. plugs: [network, network-bind]
  32. dump:
  33. command: bin/gitea dump
  34. plugs: [home]
  35. help:
  36. command: bin/gitea --help
  37. version:
  38. command: bin/gitea --version
  39. sqlite:
  40. command: usr/bin/sqlite3
  41. parts:
  42. go:
  43. source-tag: go1.8.3
  44. prime:
  45. - -*
  46. gitea:
  47. plugin: nil
  48. source: .
  49. source-type: git
  50. after: [ go ]
  51. stage-packages: [ git, sqlite3, openssh-client ]
  52. build-packages: [ libpam0g-dev, libsqlite3-dev]
  53. prepare: |
  54. export PATH=$SNAPCRAFT_PART_INSTALL/../../go/install/bin:$PATH
  55. export GOPATH=$SNAPCRAFT_PART_INSTALL/../go
  56. export bld=$SNAPCRAFT_PART_INSTALL/../build
  57. export src=$SNAPCRAFT_PART_INSTALL/../src
  58. mkdir -p $GOPATH/src/code.gitea.io/gitea
  59. cp -r $src/* $GOPATH/src/code.gitea.io/gitea
  60. build: |
  61. export PATH=$SNAPCRAFT_PART_INSTALL/../go/bin/:$SNAPCRAFT_PART_INSTALL/../../go/install/bin:$PATH
  62. export GOPATH=$SNAPCRAFT_PART_INSTALL/../go
  63. go get -u github.com/jteeuwen/go-bindata/...
  64. cd $GOPATH/src/code.gitea.io/gitea
  65. TAGS="bindata sqlite sqlite_unlock_notify pam cert" make generate build
  66. install: |
  67. # Set Convenience Variables
  68. src=$SNAPCRAFT_PART_INSTALL/../go/src/code.gitea.io/gitea
  69. giteaBase=$SNAPCRAFT_PART_INSTALL/gitea
  70. scurrent=/var/snap/$SNAPCRAFT_PROJECT_NAME/current
  71. scommon=/var/snap/$SNAPCRAFT_PROJECT_NAME/common
  72. # Copy build artifact and necessary files
  73. mkdir -p $giteaBase/conf
  74. # Workaround for gitea ignoring APP_DATA_PATH in app.ini after snap update.
  75. ln -s $scurrent/custom $giteaBase/custom
  76. ln -s $scommon/data $giteaBase/data
  77. # Workaround for cmd/certs not knowing how to put files somewhere else
  78. ln -s $scurrent/cert.pem $giteaBase/cert.pem
  79. ln -s $scurrent/key.pem $giteaBase/key.pem
  80. # Copy static content
  81. mkdir -p $SNAPCRAFT_PART_INSTALL/static
  82. cp $src/gitea $giteaBase/
  83. cp -r $src/LICENSE \
  84. $src/templates \
  85. $src/public \
  86. $src/scripts \
  87. $SNAPCRAFT_PART_INSTALL/static/
  88. cp -r $src/README.md \
  89. $src/LICENSE \
  90. $src/custom \
  91. $SNAPCRAFT_PART_INSTALL/
  92. prime:
  93. - -etc
  94. - -usr/lib/systemd
  95. - -usr/lib/gcc
  96. - -usr/lib/sasl2
  97. - -usr/lib/x86_64-linux-gnu/krb5
  98. - -usr/share/apport
  99. - -usr/share/bash-completion
  100. - -usr/share/doc
  101. - -usr/share/git-core/contrib
  102. - -usr/share/man
  103. - -usr/share/upstart
  104. - -var
  105. helpers:
  106. plugin: dump
  107. source: snap/helpers
  108. organize:
  109. simple_launcher.sh: bin/gitea
  110. app.ini: gitea/snapApp.ini
  111. configuration.sh: bin/gconfig
  112. prime:
  113. - bin/gitea
  114. - bin/gconfig
  115. - gitea/snapApp.ini