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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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/assets/img/logo.png
  9. confinement: strict
  10. base: core22
  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, build-essential]
  42. build-snaps: [ go/1.22/stable, node/20/stable ]
  43. build-environment:
  44. - LDFLAGS: ""
  45. override-pull: |
  46. craftctl default
  47. git config --global --add safe.directory /root/parts/gitea/src
  48. last_committed_tag="$(git for-each-ref --sort=taggerdate --format '%(tag)' refs/tags | tail -n 1)"
  49. last_released_tag="$(snap info gitea | awk '$1 == "latest/candidate:" { print $2 }')"
  50. # If the latest tag from the upstream project has not been released to
  51. # stable, build that tag instead of master.
  52. if [ "${last_committed_tag}" != "${last_released_tag}" ]; then
  53. git fetch
  54. git checkout "${last_committed_tag}"
  55. fi
  56. version="$(git describe --always | sed -e 's/-/+git/;y/-/./')"
  57. [ -n "$(echo $version | grep "+git")" ] && grade=devel || grade=stable
  58. craftctl set version="$version"
  59. craftctl set grade="$grade"
  60. override-build: |
  61. set -x
  62. sed -i 's/os.Getuid()/1/g' modules/setting/setting.go
  63. TAGS="bindata sqlite sqlite_unlock_notify pam cert" make build
  64. install -D gitea "${SNAPCRAFT_PART_INSTALL}/gitea"
  65. cp -r options "${SNAPCRAFT_PART_INSTALL}/"
  66. prime:
  67. - -etc
  68. - -usr/lib/systemd
  69. - -usr/lib/gcc
  70. - -usr/lib/sasl2
  71. - -usr/lib/x86_64-linux-gnu/krb5
  72. - -usr/share/apport
  73. - -usr/share/bash-completion
  74. - -usr/share/git-core/contrib
  75. - -usr/share/man
  76. - -usr/share/upstart
  77. - -var