snapcraft.yaml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. name: zwavejs2mqtt
  2. base: core20
  3. version: 'v6.16.0-zwjs10-beta'
  4. summary: Fully configurable Zwave to MQTT Gateway and Control Panel.
  5. description: "** Fully configurable Zwave to MQTT Gateway and Control Panel**\n\n- Zwave to Mqtt Gateway: Configure how nodes and nodes values are \n mapped between the two protocols\n- Secured: Supports HTTPS and users authentication\n- Control Panel UI: Directly control all your nodes and their \n values from the UI, some of control panel features:\n - Nodes management: check all nodes discovered in the z-wave \n network and manage their values\n - Firmware updates: update devices firmware, just select the \n controller action _Begin Firmware Update_ and upload the \n firmware file\n - Groups associations: add/edit nodes associations\n - Full zwave-js APIs support\n- Custom scenes management: create scenes and trigger them by using\n MQTT apis (also supports timeouts)\n- Log debug in UI: See debug logs directly from the UI\n- Store directory management: all files are stored in store folder, \n you can download/edit files inside this folder directly from the UI\n- Network graph: see how nodes are communicating with the controller,\n useful for diagnostics purposes\n- Home Assistant integration: you can use official Zwavejs integration \n by enabling zwavejs server or use integrated MQTT discovery integration\n\n**Channels in `latest`**\n\nThis is how we use the different of channels in the `latest` track, \nto give the user a chance to choose how often they want updates.\n\n- `latest/stable`: Latest version of the last *major* release. Will\n only update once per major release and most likely by the end of\n that release cycle. E.g when there is a new version `b.a.a` then\n version `a.b.c` will be will be available.\n\n- `latest/candidate`: Latest minor or patch release of latest major\n release. E.g when version `a.b.c` changes to `a.b.d` or `a.c.a`, then\n version `a.b.d` or `a.c.a` will be available. Consider this rolling\n releases.\n\n- `latest/edge` and `latest/edge/dev`: Every build (including tests) \\n might be pushed to these channels.\n"
  6. grade: stable
  7. confinement: strict
  8. license: MIT
  9. assumes:
  10. - command-chain
  11. architectures:
  12. - build-on: amd64
  13. - build-on: arm64
  14. - build-on: armhf
  15. apps:
  16. zwavejs2mqtt:
  17. daemon: simple
  18. restart-condition: always
  19. environment:
  20. STORE_DIR: $SNAP_DATA
  21. ZWAVEJS_EXTERNAL_CONFIG: $SNAP_DATA/.ext-config
  22. DAEMONIZED: 1
  23. command: bin/yarn start
  24. command-chain:
  25. - helper/env-wrapper
  26. plugs:
  27. - network
  28. - network-bind
  29. - raw-usb
  30. - serial-port
  31. - hardware-observe
  32. exec:
  33. environment:
  34. STORE_DIR: $SNAP_DATA
  35. ZWAVEJS_EXTERNAL_CONFIG: $SNAP_DATA/.ext-config
  36. command: bin/yarn --cwd $SNAP/lib/node_modules/zwavejs2mqtt start
  37. command-chain:
  38. - helper/env-wrapper
  39. plugs:
  40. - network
  41. - network-bind
  42. - raw-usb
  43. - serial-port
  44. - hardware-observe
  45. help:
  46. command: helper/env-wrapper --help
  47. enable:
  48. command: bin/daemonize
  49. disable:
  50. command: bin/de-daemonize
  51. restart:
  52. command: bin/restart
  53. layout:
  54. /usr/local/share/.cache/yarn:
  55. bind: $SNAP/.cache/yarn
  56. /usr/local/share/.yarn:
  57. symlink: $SNAP/lib/node_modules
  58. parts:
  59. zwavejs2mqtt:
  60. after: [yarn]
  61. plugin: dump
  62. source: https://github.com/zwave-js/zwavejs2mqtt.git
  63. source-branch: "zjs-v10"
  64. #source-tag: $SNAPCRAFT_PROJECT_VERSION
  65. build-packages:
  66. - gcc
  67. - build-essential
  68. - jq
  69. override-build: |
  70. # Used when testing an unreleased version of Z-wavejs
  71. sed -i 's/"zwave-js".*$/"zwave-js"\: "10.0.4-0-pr-4836-362e8eb"/g' ${SNAPCRAFT_PART_BUILD}/package.json
  72. if [ -n "${http_proxy-}" ]; then
  73. yarn config set httpProxy "${http_proxy}"
  74. fi
  75. if [ -n "${https_proxy-}" ]; then
  76. yarn config set httpsProxy "${https_proxy}"
  77. fi
  78. yarn set version berry
  79. yarn install \
  80. && yarn run build \
  81. && yarn remove $(cat "${SNAPCRAFT_PART_BUILD}/package.json" | jq -r '.devDependencies | keys | join(" ")') \
  82. && mkdir -p "${SNAPCRAFT_PART_INSTALL}/lib/node_modules" \
  83. && cp --archive --link --no-dereference "${SNAPCRAFT_PART_BUILD}" \
  84. "${SNAPCRAFT_PART_INSTALL}/lib/node_modules/zwavejs2mqtt" \
  85. organize:
  86. lib/node_modules/zwavejs2mqtt/dist: lib/node_modules/zwavejs2mqtt/server/dist
  87. lib/node_modules/zwavejs2mqtt/views: lib/node_modules/zwavejs2mqtt/server/views
  88. filesets:
  89. zwavejs2mqtt-include:
  90. - lib/node_modules/zwavejs2mqtt/.git
  91. - lib/node_modules/zwavejs2mqtt/*.md
  92. - lib/node_modules/zwavejs2mqtt/LICENSE
  93. - lib/node_modules/zwavejs2mqtt/node_modules
  94. - lib/node_modules/zwavejs2mqtt/server
  95. - lib/node_modules/zwavejs2mqtt/package.json
  96. - lib/node_modules/zwavejs2mqtt/.yarn
  97. - lib/node_modules/zwavejs2mqtt/yarn.lock
  98. - lib/node_modules/zwavejs2mqtt/.yarnrc.yml
  99. stage:
  100. - $zwavejs2mqtt-include
  101. dependencies:
  102. plugin: nil
  103. stage-snaps:
  104. - jq
  105. - yq
  106. stage-packages:
  107. - git
  108. - udev
  109. - iproute2
  110. # stage-snaps:
  111. # - duplicity
  112. nodejs:
  113. plugin: dump
  114. source:
  115. - on amd64: https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-x64.tar.gz
  116. - on arm64: https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-arm64.tar.gz
  117. - on armhf: https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-armv7l.tar.gz
  118. stage-packages:
  119. - on armhf:
  120. - libatomic1
  121. organize:
  122. '*.md': nodejs/
  123. LICENSE: nodejs/
  124. prime:
  125. - -include
  126. - -share
  127. yarn:
  128. after: [nodejs]
  129. plugin: nil
  130. override-build: |
  131. npm install yarn
  132. snapcraftctl build
  133. cp -r $SNAPCRAFT_PART_BUILD/* $SNAPCRAFT_PART_INSTALL
  134. organize:
  135. node_modules/yarn: lib/node_modules/yarn
  136. stage:
  137. - lib/node_modules/yarn
  138. override-stage: |
  139. snapcraftctl stage
  140. PWD=$(pwd)
  141. cd $SNAPCRAFT_STAGE/bin
  142. ln -sf ../lib/node_modules/yarn/bin/yarn yarn
  143. cd "${PWD}"
  144. prime:
  145. - lib/node_modules/yarn
  146. - bin/yarn
  147. local:
  148. plugin: dump
  149. source: src/
  150. stage-packages:
  151. - uuid
  152. organize:
  153. hooks: snap/hooks