fix(juju): honor juju changes in descriptor
[osm/osmclient.git] / snap / snapcraft.yaml
index 208c01c..84635ae 100644 (file)
@@ -31,13 +31,11 @@ environment:
 
 apps:
   osm:
-    # command: usr/bin/osm.wrapper
     command: usr/bin/python3 $SNAP/usr/local/bin/osm
     plugs:
       - network
       - home
       - ssh-public-keys
-      # - charm
     environment:
       PATH: $SNAP/usr/bin:$SNAP/bin/:$PATH
       PYTHONPATH: $SNAP/usr/lib/python3/dist-packages:$PYTHONPATH
@@ -50,21 +48,28 @@ parts:
     build-environment:
       - PATH: "$PATH:$SNAPCRAFT_PART_INSTALL/usr/local/bin"
     build-packages:
+      - gcc
       - git
+      - make
+      - wget
     stage-packages:
-      - python3-pip
-      - python3-setuptools
+      - libmagic1
       - python3
       - python3-dev
+      - python3-pip
       - python3-pycurl
-      - libmagic1
-      - zlib1g-dev
+      - python3-setuptools
     override-build: |
-      BRANCH_OR_TAG=`git symbolic-ref -q --short HEAD || git describe --tags --exact-match`
+      $SNAPCRAFT_PART_INSTALL/usr/bin/pip3 install wheel
+      $SNAPCRAFT_PART_INSTALL/usr/bin/pip3 install pyang
+      $SNAPCRAFT_PART_INSTALL/usr/bin/pip3 install pyangbind
+      PATH="$PATH:$SNAPCRAFT_PART_INSTALL/usr/local/bin"
+      BRANCH_OR_TAG=`git symbolic-ref -q --short HEAD || git describe --tags --exact-match 2>/dev/null || echo $BRANCH`
       git clone https://osm.etsi.org/gerrit/osm/IM.git
       cd IM/
       git checkout $BRANCH_OR_TAG
       $SNAPCRAFT_PART_INSTALL/usr/bin/pip3 install .
       cd ../ && rm -rf IM/
       $SNAPCRAFT_PART_INSTALL/usr/bin/pip3 install .
+      rm -rf .tox
       snapcraftctl build