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.

snapcraft.yaml 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. icon: public/img/logo.png
  9. confinement: strict
  10. base: core18
  11. adopt-info: gitea
  12. architectures:
  13. - build-on: armhf
  14. - build-on: amd64
  15. - build-on: arm64
  16. environment:
  17. GITEA_CUSTOM: "$SNAP_COMMON"
  18. GITEA_WORK_DIR: "$SNAP_COMMON"
  19. GIT_TEMPLATE_DIR: "$SNAP/usr/share/git-core/templates"
  20. GIT_EXEC_PATH: "$SNAP/usr/lib/git-core"
  21. apps:
  22. gitea:
  23. command: gitea
  24. plugs: [network, network-bind, removable-media]
  25. web:
  26. command: gitea web
  27. daemon: simple
  28. plugs: [network, network-bind, removable-media]
  29. dump:
  30. command: gitea dump
  31. plugs: [home, removable-media]
  32. version:
  33. command: gitea --version
  34. sqlite:
  35. command: usr/bin/sqlite3
  36. parts:
  37. gitea:
  38. plugin: make
  39. source: .
  40. stage-packages: [ git, sqlite3, openssh-client ]
  41. build-packages: [ git, libpam0g-dev, libsqlite3-dev]
  42. build-snaps: [ go, node/14/stable ]
  43. build-environment:
  44. - LDFLAGS: ""
  45. override-pull: |
  46. snapcraftctl pull
  47. last_committed_tag="$(git for-each-ref --sort=taggerdate --format '%(tag)' refs/tags | tail -n 1)"
  48. last_released_tag="$(snap info gitea | awk '$1 == "latest/candidate:" { print $2 }')"
  49. # If the latest tag from the upstream project has not been released to
  50. # stable, build that tag instead of master.
  51. if [ "${last_committed_tag}" != "${last_released_tag}" ]; then
  52. git fetch
  53. git checkout "${last_committed_tag}"
  54. fi
  55. version="$(git describe --always | sed -e 's/-/+git/;y/-/./')"
  56. [ -n "$(echo $version | grep "+git")" ] && grade=devel || grade=stable
  57. snapcraftctl set-version "$version"
  58. snapcraftctl set-grade "$grade"
  59. override-build: |
  60. set -x
  61. TAGS="bindata sqlite sqlite_unlock_notify pam cert" make build
  62. install -D gitea "${SNAPCRAFT_PART_INSTALL}/gitea"
  63. cp -r options "${SNAPCRAFT_PART_INSTALL}/"
  64. prime:
  65. - -etc
  66. - -usr/lib/systemd
  67. - -usr/lib/gcc
  68. - -usr/lib/sasl2
  69. - -usr/lib/x86_64-linux-gnu/krb5
  70. - -usr/share/apport
  71. - -usr/share/bash-completion
  72. - -usr/share/git-core/contrib
  73. - -usr/share/man
  74. - -usr/share/upstart
  75. - -var