snapcraft.yaml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. name: zwavejs2mqtt
  2. base: core20
  3. version: 'v5.2.2'
  4. summary: Fully configurable Zwave to MQTT Gateway and Control Panel.
  5. description: |
  6. - Configurable Zwave to Mqtt Gateway
  7. - Home Assistant integration (beta)
  8. - Zwave Control Panel:
  9. - Nodes management: check all nodes discovered in the z-wave network, send/receive nodes values updates directly from the UI and send action to the nodes and controller for diagnostics and network heal Custom Node naming and Location: Starting from v1.3.0 nodes name and location are stored in a JSON file named nodes.json. This because not all nodes have native support for naming and location features (#45). This change is back compatible with older versions of this package: on startup it will get all nodes names and location from the zwcfg_homeHEX.xml file (if present) and create the new nodes.json file based on that. This file can be imported/exported from the UI control panel with the import/export buttons placed on the top of nodes table, on the right of controller actions select.
  10. - Firmware updates: You are able to send firmware updates to your devices using the UI, just select the controller action Begin Firmware Update
  11. - Groups associations: create associations between nodes (also supports multi-instance associations, need to use last version of zwave-js)
  12. - Custom scenes management
  13. - Log debug in UI
  14. - Mesh graph showing devices neighbors
  15. grade: stable # must be 'stable' to release into candidate/stable channels
  16. confinement: strict # use 'strict' once you have the right plugs and slots
  17. assumes:
  18. - command-chain
  19. architectures:
  20. - build-on: amd64
  21. - build-on: arm64
  22. - build-on: armhf
  23. #- build-on: ppc64el
  24. apps:
  25. zwavejs2mqtt:
  26. daemon: simple
  27. restart-condition: always
  28. environment:
  29. STORE_DIR: $SNAP_DATA
  30. ZWAVEJS_EXTERNAL_CONFIG: $SNAP_DATA/.ext-config
  31. DAEMONIZED: 1
  32. command: lib/node_modules/yarn/bin/yarn --cwd $SNAP/lib/node_modules/zwavejs2mqtt --global-folder $SNAP/lib/node_modules/npm/node_modules start
  33. command-chain:
  34. - helper/env-wrapper
  35. plugs:
  36. - network
  37. - network-bind
  38. - raw-usb
  39. - serial-port
  40. - hardware-observe
  41. exec:
  42. environment:
  43. STORE_DIR: $SNAP_DATA
  44. ZWAVEJS_EXTERNAL_CONFIG: $SNAP_DATA/.ext-config
  45. #command: lib/node_modules/zwavejs2mqtt/bin/www.ts
  46. command: lib/node_modules/yarn/bin/yarn --cwd $SNAP/lib/node_modules/zwavejs2mqtt start
  47. command-chain:
  48. - helper/env-wrapper
  49. plugs:
  50. - network
  51. - network-bind
  52. - raw-usb
  53. - serial-port
  54. - hardware-observe
  55. help:
  56. command: helper/env-wrapper --help
  57. enable:
  58. command: bin/daemonize
  59. disable:
  60. command: bin/de-daemonize
  61. restart:
  62. command: bin/restart
  63. layout:
  64. $SNAP/lib/node_modules/zwavejs2mqtt/node_modules/@zwave-js/config:
  65. bind: $SNAP/lib/node_modules/zwavejs2mqtt/node_modules/@zwave-js/config
  66. /usr/local/share/.cache/yarn:
  67. bind: $SNAP/.cache/yarn
  68. /usr/local/share/.yarn:
  69. symlink: $SNAP/lib/node_modules
  70. #$SNAP/lib/node_modules/zwavejs2mqtt/node_modules/@zwave-jspackages/zwave-js/src/lib/driver/
  71. parts:
  72. zwavejs2mqtt:
  73. after: [nodejs]
  74. plugin: dump
  75. source: https://github.com/zwave-js/zwavejs2mqtt.git
  76. #source-branch: "fix#1274"
  77. source-tag: $SNAPCRAFT_PROJECT_VERSION
  78. build-packages:
  79. - gcc
  80. - build-essential
  81. override-build: |
  82. set -x
  83. if [ -n "${http_proxy-}" ]; then
  84. export GLOBAL_AGENT_HTTP_PROXY="${http_proxy}"
  85. export GLOBAL_AGENT_HTTPS_PROXY="${http_proxy}"
  86. fi
  87. yarn install
  88. yarn run build \
  89. && mkdir -p $SNAPCRAFT_PART_INSTALL/lib/node_modules \
  90. && cp --archive --link --no-dereference $SNAPCRAFT_PART_BUILD \
  91. $SNAPCRAFT_PART_INSTALL/lib/node_modules/zwavejs2mqtt \
  92. organize:
  93. lib/node_modules/zwavejs2mqtt/node_modules/@zwave-js/config: snap/zwave-js/config
  94. lib/node_modules/zwavejs2mqtt/dist: lib/node_modules/zwavejs2mqtt/server/dist
  95. lib/node_modules/zwavejs2mqtt/views: lib/node_modules/zwavejs2mqtt/server/views
  96. filesets:
  97. zwavejs2mqtt-include:
  98. - lib/node_modules/zwavejs2mqtt/.git
  99. - lib/node_modules/zwavejs2mqtt/LICENSE
  100. - lib/node_modules/zwavejs2mqtt/*.md
  101. - lib/node_modules/zwavejs2mqtt/node_modules
  102. - lib/node_modules/zwavejs2mqtt/server
  103. - lib/node_modules/zwavejs2mqtt/package.json
  104. - lib/node_modules/zwavejs2mqtt/yarn.lock
  105. stage:
  106. - snap
  107. - $zwavejs2mqtt-include
  108. dependencies:
  109. plugin: nil
  110. stage-snaps:
  111. - jq
  112. - yq
  113. stage-packages:
  114. - git
  115. - udev
  116. - rsync
  117. nodejs:
  118. plugin: dump
  119. source:
  120. - on amd64: https://nodejs.org/dist/v15.14.0/node-v15.14.0-linux-x64.tar.gz
  121. - on arm64: https://nodejs.org/dist/v15.14.0/node-v15.14.0-linux-arm64.tar.gz
  122. - on armhf: https://nodejs.org/dist/v15.14.0/node-v15.14.0-linux-armv7l.tar.gz
  123. stage-packages:
  124. - on armhf:
  125. - libatomic1
  126. override-stage: |
  127. npm install --global yarn
  128. snapcraftctl stage
  129. organize:
  130. '*.md' : nodejs/
  131. LICENSE : nodejs/
  132. prime:
  133. - -include
  134. - -share
  135. local:
  136. plugin: dump
  137. source: src/
  138. stage-packages:
  139. - uuid
  140. organize:
  141. hooks: snap/hooks