Bug 1846: LTS Support
[osm/osmclient.git] / snap / snapcraft.yaml
1 ---
2 ##
3 # Copyright 2020 ETSI
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License"); you may
6 # not use this file except in compliance with the License. You may obtain
7 # a copy of the License at
8 #
9 #         http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 # License for the specific language governing permissions and limitations
15 # under the License.
16 ##
17 name: osmclient
18 base: core20
19 adopt-info: client
20 summary: A python client for orchestrating OSM
21 description: |
22   A python client for orchestrating Open Source Mano (OSM).
23
24 grade: stable
25
26 confinement: strict
27
28 environment:
29   LC_ALL: C.UTF-8
30   LANG: C.UTF-8
31
32 apps:
33   osm:
34     command: bin/osm
35     plugs:
36       - network
37       - home
38       - ssh-public-keys
39     environment:
40       PATH: $SNAP/usr/bin:$SNAP/bin/:$PATH:$SNAP/usr/local/bin/:/usr/local/bin/
41       MAGIC: $SNAP/usr/share/file/magic.mgc
42
43 parts:
44   client:
45     plugin: python
46     source: .
47     requirements:
48       - requirements-dev.txt
49       - requirements.txt
50     python-packages:
51       - pip==21.0.1
52       - setuptools==44.0.0
53     build-environment:
54       - PIP_COMPILE: "false" # disable .pyc generation in pip
55       - PYTHONDONTWRITEBYTECODE: "false" # disable .pyc generation by setup.py
56     build-packages:
57       - gcc
58       - git
59       - make
60       - wget
61       - libcurl4-openssl-dev
62       - libssl-dev
63       - python3-distutils
64       - python3-dev
65       - python3-pip
66       - python3-pycurl
67     stage-packages:
68       - libmagic1
69       - libcurl4-openssl-dev
70       - python3
71     override-build: |
72       VERSION=$(git describe --match v* --tags --long --dirty)
73       snapcraftctl set-version $VERSION
74       snapcraftctl build
75       `find $SNAPCRAFT_PART_INSTALL -name '__pycache__' | xargs rm -r`
76       `find $SNAPCRAFT_PART_INSTALL -name 'RECORD' | xargs rm`