-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsnapcraft.yaml
50 lines (45 loc) · 1.52 KB
/
snapcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: check-sieve
license: MIT
version: "0.8" # automatically updated during pull
summary: Syntax checker for mail sieves
description: |
Makes checking mail sieve syntax easy and painless.
Because breaking your sieve in production sucks.
type: app
base: core22
grade: stable
compression: xz
confinement: strict
adopt-info: check-sieve
parts:
check-sieve:
plugin: make
source: https://github.com/dburkart/check-sieve.git
build-packages:
- g++
- gcc
- make
override-pull: |
craftctl default
last_committed_tag="$(git describe --tags --abbrev=0)"
last_committed_version="$(echo "${last_committed_tag}" | grep -Eo '[[:digit:]]+\.[[:digit:]]+')"
last_released_version="$(snap info $CRAFT_PROJECT_NAME | awk '$1 == "latest/beta:" { print $2 }' || true)"
# If the latest tag from the upstream project has not been released to
# beta, build that tag instead of master.
if [ "${last_committed_version}" != "${last_released_version}" ]; then
git fetch
git checkout "${last_committed_tag}"
echo "Setting version to ${last_committed_version}"
craftctl set version="${last_committed_version}"
else
echo "Setting version to $(git rev-parse --short HEAD)"
craftctl set version="$(git rev-parse --short HEAD)"
fi
override-build: |
CFLAGS='-O3 -pipe' make -j4
cp check-sieve $CRAFT_PART_INSTALL
apps:
check-sieve:
command: check-sieve
plugs:
- home # access to user's /home directory