snapcraft.yaml 2.3 KB
Newer Older
sangshuduo's avatar
sangshuduo 已提交
1
name: tdengine
2
base: core18
S
Shengliang Guan 已提交
3

Z
zyyang 已提交
4
version: '2.1.1.0'
sangshuduo's avatar
sangshuduo 已提交
5
icon: snap/gui/t-dengine.svg
6
summary: an open-source big data platform designed and optimized for IoT. 
sangshuduo's avatar
sangshuduo 已提交
7 8 9 10
description: |
  TDengine is an open-source big data platform designed and optimized for Internet of Things (IoT), Connected Vehicles, and Industrial IoT. Besides the 10x faster time-series database, it provides caching, stream computing, message queuing and other functionalities to reduce the complexity and costs of development and operations.

grade: stable
sangshuduo's avatar
sangshuduo 已提交
11
confinement: strict
sangshuduo's avatar
sangshuduo 已提交
12 13 14 15 16 17 18 19 20

apps:
  tdengine:
    command: launcher.sh
    daemon: simple
    restart-condition: always
    plugs:
      - network
      - network-bind
21
      - system-observe
sangshuduo's avatar
sangshuduo 已提交
22 23

  taos:
24
    command: taoswrapper.sh
sangshuduo's avatar
sangshuduo 已提交
25 26
    plugs:
      - network
sangshuduo's avatar
sangshuduo 已提交
27
      - system-observe
sangshuduo's avatar
sangshuduo 已提交
28

29 30 31 32 33
  taosdemo:
    command: usr/bin/taosdemo
    plugs:
      - network

sangshuduo's avatar
sangshuduo 已提交
34 35 36 37 38 39
parts:
  script:
    plugin: dump
    source: snap/local/
    prime:
      - launcher.sh
40
      - taoswrapper.sh
sangshuduo's avatar
sangshuduo 已提交
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55

  tdengine:
    source: .
    source-type: local
    plugin: cmake
    build-packages:
      - gcc
      - g++
      - make
      - cmake
    override-build: |
      snapcraftctl build
      if [ ! -d $SNAPCRAFT_STAGE/usr ]; then
        mkdir $SNAPCRAFT_STAGE/usr
      fi
56

sangshuduo's avatar
sangshuduo 已提交
57 58 59
      if [ ! -d $SNAPCRAFT_STAGE/etc/taos ]; then
        mkdir -p $SNAPCRAFT_STAGE/etc/taos
      fi
60

sangshuduo's avatar
sangshuduo 已提交
61 62 63
      cp $SNAPCRAFT_PART_BUILD/build/* -rf $SNAPCRAFT_STAGE/usr/
      cp $SNAPCRAFT_PART_SRC/packaging/cfg/taos.cfg -rf $SNAPCRAFT_STAGE/etc/taos/

64 65 66 67
      if [ ! -d $SNAPCRAFT_STAGE/var/lib/taos ]; then
        mkdir -p $SNAPCRAFT_STAGE/var/lib/taos
      fi
      if [ ! -d $SNAPCRAFT_STAGE/var/log/taos ]; then
sangshuduo's avatar
sangshuduo 已提交
68
        mkdir -p --mode=777 $SNAPCRAFT_STAGE/var/log/taos
69 70
      fi

sangshuduo's avatar
sangshuduo 已提交
71 72 73 74 75
    prime:
      - etc/taos/taos.cfg
      - usr/bin/taosd
      - usr/bin/taos
      - usr/bin/taosdemo
Z
zyyang 已提交
76
      - usr/lib/libtaos.so.2.1.1.0
sangshuduo's avatar
sangshuduo 已提交
77 78 79
      - usr/lib/libtaos.so.1
      - usr/lib/libtaos.so

80 81
    override-prime: |
      snapcraftctl prime
sangshuduo's avatar
sangshuduo 已提交
82
      if [ ! -d $SNAPCRAFT_PRIME/var/lib/taos ]; then
83 84
        cp -rf $SNAPCRAFT_STAGE/var/lib/taos $SNAPCRAFT_PRIME
      fi
sangshuduo's avatar
sangshuduo 已提交
85
      if [ ! -d $SNAPCRAFT_PRIME/var/log/taos ]; then
86 87 88 89 90 91 92 93
        cp -rf  $SNAPCRAFT_STAGE/var/log/taos $SNAPCRAFT_PRIME
      fi

layout:
  /var/lib/taos:
    bind: $SNAP_DATA/var/lib/taos
  /var/log/taos:
    bind: $SNAP_DATA/var/log/taos
sangshuduo's avatar
sangshuduo 已提交
94 95
  /etc/taos:
    bind: $SNAP_DATA/etc/taos