123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- name: ozwdaemon
- base: core20
- adopt-info: set-version
- summary: "QT Wrapper for OpenZWave. Remotely manage a Z-Wave Network."
- description: |
- A dedicated snap package that contains only the ozwdaemon service.
- This snap contains only the ozwdaemon application and none of the management tools. Use Home Assistant or OZW Admin to connect to it.
- NOTE! To add secure devices through Home Assistant, you have to make service calls, with the payload:
- {
- "secure": true,
- "instance_id": <id given in configuration>
- }
- This is an issue with the OpenZWave integration of Home Assistant and will hopefully be fixed in the future.
- See `snap get ozwdaemon -d` for configuration options.
- grade: devel
- confinement: strict
- layout:
- /usr/local/share/OpenZWave/qt-openzwavedatabase.rcc:
- bind-file: $SNAP/usr/share/qt5/qt-openzwavedatabase.rcc
- apps:
- ozwdaemon:
- daemon: simple
- restart-condition: on-failure
- command: usr/local/bin/ozwdaemon
- command-chain:
- - bin/env-wrapper
- plugs:
- - network
- - network-bind
- - raw-usb
- exec:
- command: usr/local/bin/ozwdaemon
- command-chain:
- - bin/env-wrapper
- plugs:
- - network
- - network-bind
- - raw-usb
- parts:
- open-zwave:
- plugin: make
- source: https://github.com/OpenZWave/open-zwave.git
- qtmqtt:
- after: [open-zwave]
- plugin: make # aka qmake
- source: https://github.com/qt/qtmqtt.git
- source-tag: 5.12.8
- build-packages:
- - build-essential
- - qt5-default
- - qtbase5-private-dev
- override-build: |
- if [ -f "Makefile" ]; then
- echo "Clean $SNAPCRAFT_PART_BUILD"
- qmake -r
- make distclean
- fi
- qmake
- make -j$(nproc)
- make -j$(nproc) install
- make -j$(nproc) install INSTALL_ROOT="${SNAPCRAFT_PART_INSTALL}"
- override-prime: |
- snapcraftctl prime
- stage-packages:
- - libdouble-conversion3
- - libfreetype6
- - libgl1
- - libglvnd0
- - libglx0
- - libgraphite2-3
- - libharfbuzz0b
- - libicu66
- - libpcre2-16-0
- - libpng16-16
- - libqt5core5a
- - libqt5gui5
- - libqt5network5
- - libqt5websockets5
- - libqt5widgets5
- - libx11-6
- - libxau6
- - libxcb1
- - libxdmcp6
- qt-openzwave:
- after: [open-zwave, qtmqtt]
- plugin: make # aka qmake?
- source: https://github.com/OpenZWave/qt-openzwave.git
- build-packages:
- - build-essential
- - qt5-default
- - libqt5websockets5-dev
- - libqt5remoteobjects5-dev
- - libqt5remoteobjects5-bin
- - gcc-8-base
- - libgcc-8-dev
- - cmake
- - pkgconf
- - libunwind-dev
- - libcurl4-openssl-dev
- - rapidjson-dev
- stage-packages:
- - libdouble-conversion3
- - libicu66
- - libpcre2-16-0
- - libqt5core5a
- - libqt5network5
- - libqt5remoteobjects5
- - libqt5websockets5
- - libunwind8
- override-build: |
- if [ -f "Makefile" ]; then
- echo "Clean $SNAPCRAFT_PART_BUILD"
- qmake -r
- make distclean
- fi
- INSTALL_PATH="${HOME}"
- if [ ! -z ${container+x} ]; then
- INSTALL_PATH="/build/${SNAPCRAFT_PROJECT_NAME}"
- fi
- OZW_LIB_PATH="$(dirname $(find ${INSTALL_PATH}/parts/open-zwave/install -name libopenzwave.so -print0 -quit))"
- OZW_INCLUDE_PATH="$(dirname $(find ${INSTALL_PATH}/parts/open-zwave/install -name Manager.h -print0 -quit))"
- OZW_DATABASE_PATH="$(dirname $(find ${INSTALL_PATH}/parts/open-zwave/install -name manufacturer_specific.xml))"
- qmake -r "CONFIG+=release" \
- OZW_LIB_PATH="${OZW_LIB_PATH}" \
- OZW_INCLUDE_PATH="${OZW_INCLUDE_PATH}" \
- OZW_DATABASE_PATH="${OZW_DATABASE_PATH}"
- make -j$(nproc)
- make -j$(nproc) install INSTALL_ROOT="${SNAPCRAFT_PART_INSTALL}"
- local-src:
- after: [qt-openzwave]
- plugin: dump
- source: ./src
- source-type: local
- stage-packages:
- - coreutils
- - netcat-openbsd
- organize:
- hooks: snap/hooks
- set-version:
- after: [qt-openzwave]
- plugin: nil
- override-build: |
- set -ex
- INSTALL_PATH="${HOME}"
- if [ ! -z ${container+x} ]; then
- INSTALL_PATH="/build/${SNAPCRAFT_PROJECT_NAME}"
- fi
- LIBQT_OZW=$(dirname "$(find ${INSTALL_PATH}/prime -name libqt-openzwave.so.1 -print -quit)")
- LIB_OZW=$(dirname "$(find ${INSTALL_PATH}/prime -name libopenzwave.so* -print -quit)")
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIBQT_OZW:$LIB_OZW
- OZWD=$(find ${INSTALL_PATH}/prime -name ozwdaemon -print -quit)
- VERSION=$($OZWD --version | cut -f2 -d ' ')
- snapcraftctl set-version "${VERSION}"
|