snapcraft.yaml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. name: zwavejs2mqtt
  2. base: core20
  3. version: 'v7.2.0'
  4. summary: Fully configurable Zwave to MQTT Gateway and Control Panel.
  5. description: |
  6. ** Fully configurable Zwave to MQTT Gateway and Control Panel**
  7. - Zwave to Mqtt Gateway: Configure how nodes and nodes values are mapped between the two protocols
  8. - Secured: Supports HTTPS and users authentication
  9. - Control Panel UI: Directly control all your nodes and their
  10. values from the UI, some of control panel features:
  11. - Nodes management: check all nodes discovered in the z-wave network and manage their values
  12. - Firmware updates: update devices firmware, just select the controller action
  13. _Begin Firmware Update_ and upload the firmware file
  14. - Groups associations: add/edit nodes associations
  15. - Full zwave-js APIs support
  16. - Custom scenes management: create scenes and trigger them by using MQTT apis (also supports timeouts)
  17. - Log debug in UI: See debug logs directly from the UI
  18. - Store directory management: all files are stored in store folder, you can download/edit files
  19. inside this folder directly from the UI
  20. - Network graph: see how nodes are communicating with the controller, useful for diagnostics purposes
  21. - Home Assistant integration: you can use official Zwavejs integration by enabling zwavejs server or
  22. use integrated MQTT discovery integration
  23. **Channels in `latest`**
  24. This is how we use the different of channels in the `latest` track, to give the user a chance to choose
  25. how often they want updates.
  26. - `latest/stable`: Latest version of the last *major* release. Will only update once per major release
  27. and most likely by the end of that release cycle. E.g when there is a new version `b.a.a` then version
  28. `a.b.c` will be will be available in this track.
  29. - `latest/candidate`: Latest minor or patch release of latest major release. E.g when version `a.b.c`
  30. changes to `a.b.d` or `a.c.a`, then version `a.b.d` or `a.c.a` will be available. Consider this the
  31. track for rolling releases.
  32. - `latest/edge` and `latest/edge/dev`: Every build (including tests) might be pushed to these channels.
  33. A.K.A **Do NOT** use it if you don't know what you're up to - **and** expect problems: Do not report bugs!
  34. grade: stable
  35. confinement: strict
  36. license: MIT
  37. assumes:
  38. - command-chain
  39. architectures:
  40. - build-on: amd64
  41. - build-on: arm64
  42. - build-on: armhf
  43. apps:
  44. zwavejs2mqtt:
  45. daemon: simple
  46. restart-condition: always
  47. environment:
  48. STORE_DIR: $SNAP_DATA
  49. ZWAVEJS_EXTERNAL_CONFIG: $SNAP_DATA/.ext-config
  50. DAEMONIZED: 1
  51. command: bin/yarn start
  52. command-chain:
  53. - helper/env-wrapper
  54. plugs:
  55. - network
  56. - network-bind
  57. - raw-usb
  58. - serial-port
  59. - hardware-observe
  60. - log-observe
  61. exec:
  62. environment:
  63. STORE_DIR: $SNAP_DATA
  64. ZWAVEJS_EXTERNAL_CONFIG: $SNAP_DATA/.ext-config
  65. command: bin/yarn start
  66. command-chain:
  67. - helper/env-wrapper
  68. plugs:
  69. - network
  70. - network-bind
  71. - raw-usb
  72. - serial-port
  73. - hardware-observe
  74. help:
  75. command: helper/env-wrapper --help
  76. enable:
  77. command: bin/daemonize
  78. disable:
  79. command: bin/de-daemonize
  80. restart:
  81. command: bin/restart
  82. copy-2-zui:
  83. command: bin/cpy-2-zui
  84. layout:
  85. /usr/local/share/.cache/yarn:
  86. bind: $SNAP/.cache/yarn
  87. /usr/local/share/.yarn:
  88. symlink: $SNAP/lib/node_modules
  89. #plugs:
  90. # zui-store:
  91. # interface: content
  92. # content: vscs-content
  93. # target: $SNAP_COMMON/zui-store
  94. slots: # ZUI offers new config dir within data
  95. store-dir:
  96. interface: content
  97. content: vscs-content
  98. write:
  99. - $SNAP_DATA
  100. parts:
  101. zwavejs2mqtt:
  102. after: [nodejs, dependencies]
  103. plugin: dump
  104. source: https://github.com/zwave-js/zwave-js-ui.git
  105. #source-branch: "master"
  106. #source-tag: "v7.1.0"
  107. source-tag: $SNAPCRAFT_PROJECT_VERSION
  108. build-packages:
  109. - gcc
  110. - build-essential
  111. build-environment:
  112. - LD_LIBRARY_PATH: "${LD_LIBRARY_PATH}:$(dirname $(find ${SNAPCRAFT_STAGE} -name libonig.so.2 -print0))"
  113. - PATH: "${PATH}:${SNAPCRAFT_PART_BUILD}/bin"
  114. override-build: |
  115. # Used when testing an unreleased version of Z-wavejs
  116. # sed -i 's/"zwave-js".*$/"zwave-js"\: "10.0.5-0-pr-4836-ed10b36"/g' ${SNAPCRAFT_PART_BUILD}/package.json
  117. # Link the bundled yarn
  118. cd "${SNAPCRAFT_PART_BUILD}/bin"
  119. YARN="$(find ${SNAPCRAFT_PART_BUILD} -name yarn-*.cjs -print0)"
  120. ln -s "../${YARN:${#SNAPCRAFT_PART_BUILD}+1}" ./yarn
  121. chmod +x ./yarn
  122. cd "${SNAPCRAFT_PART_BUILD}"
  123. # Necessary for the remote build; sometimes.
  124. if [ -n "${http_proxy-}" ]; then
  125. yarn config set httpProxy "${http_proxy}"
  126. fi
  127. if [ -n "${https_proxy-}" ]; then
  128. yarn config set httpsProxy "${https_proxy}"
  129. fi
  130. yarn install
  131. yarn build:server
  132. yarn build:ui
  133. yarn remove $(cat "${SNAPCRAFT_PART_BUILD}/package.json" | jq -r '.devDependencies | keys | join(" ")')
  134. # Copy built version into install directory
  135. mkdir -p "${SNAPCRAFT_PART_INSTALL}/lib/" \
  136. && cp --archive --link --no-dereference "${SNAPCRAFT_PART_BUILD}" \
  137. "${SNAPCRAFT_PART_INSTALL}/lib/zwavejs2mqtt"
  138. # Link yarn in install directory
  139. mkdir "${SNAPCRAFT_PART_INSTALL}/bin" \
  140. && cd "${SNAPCRAFT_PART_INSTALL}/bin" \
  141. && ln -s "../lib/zwavejs2mqtt/bin/yarn" "yarn"
  142. filesets:
  143. zwavejs2mqtt-include:
  144. - bin
  145. - lib/zwavejs2mqtt/.git
  146. - lib/zwavejs2mqtt/*.md
  147. - lib/zwavejs2mqtt/bin/yarn
  148. - lib/zwavejs2mqtt/dist
  149. - lib/zwavejs2mqtt/hass
  150. - lib/zwavejs2mqtt/node_modules
  151. - lib/zwavejs2mqtt/server
  152. - lib/zwavejs2mqtt/snippets
  153. - lib/zwavejs2mqtt/package.json
  154. - lib/zwavejs2mqtt/views
  155. - lib/zwavejs2mqtt/.yarn
  156. - lib/zwavejs2mqtt/yarn.lock
  157. - lib/zwavejs2mqtt/.yarnrc.yml
  158. - lib/zwavejs2mqtt/LICENSE
  159. stage:
  160. - $zwavejs2mqtt-include
  161. dependencies:
  162. plugin: nil
  163. stage-snaps:
  164. - jq
  165. - yq
  166. stage-packages:
  167. - git
  168. - udev
  169. - iproute2
  170. nodejs:
  171. plugin: dump
  172. source:
  173. - on amd64: https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-x64.tar.gz
  174. - on arm64: https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-arm64.tar.gz
  175. - on armhf: https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-armv7l.tar.gz
  176. stage-packages:
  177. - on armhf:
  178. - libatomic1
  179. organize:
  180. '*.md': nodejs/
  181. LICENSE: nodejs/
  182. prime:
  183. - -include
  184. - -share
  185. - -lib/node_modules
  186. - -bin/npm
  187. - -bin/npx
  188. - -bin/corepack
  189. override-stage: |
  190. corepack disable
  191. snapcraftctl stage
  192. local:
  193. plugin: dump
  194. source: src/
  195. stage-packages:
  196. - uuid
  197. organize:
  198. hooks: snap/hooks