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.3KB

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