snapcraft.yaml 5.1 KB

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