Browse Source

Init commit

Joachim M. Giæver 5 năm trước cách đây
mục cha
commit
e966b43935
2 tập tin đã thay đổi với 85 bổ sung1 xóa
  1. 31 1
      README.md
  2. 54 0
      snap/snapcraft.yaml

+ 31 - 1
README.md

@@ -1,3 +1,33 @@
 # home-assistant-snap
 
-Snap recipe the Open source home automation software that puts local control and privacy first.
+Snap (Snapcraft.yaml) recipe for the Open source home automation software that puts local control and privacy first.
+
+Current Home Assistant version: 0.90.1
+
+# Install
+1. Make sure you have all [necessary tools](https://docs.snapcraft.io/installing-snapd/6735) to build a snap
+2. Clone this repo ```git clone git.giaever.org@git.giaever.org:joachimmg/home-assistant-snap.git```
+3. Go into the directoy ```cd home-assistant-snap``` and issue ``` snapcraft ``` to start building.
+
+A file named ```home-assistant-snap[...].snap``` should now be in the folder and now you can install it with
+
+```bash
+snap install [file] --devmode
+```
+
+## Issues
+
+For issues directly related to Home Assistant, please read their article on [Reporting Issues](https://www.home-assistant.io/help/reporting_issues/). 
+
+Issues with building or issues that is caused by missing dependencies etc and therefore cause problems with the running software, use the [issue tracker](https://git.giaever.org/joachimmg/home-assistant-snap/issues).
+
+### Known problems
+
+The build process reports a dependency issue with Selenium/Webdriver.
+
+```wiki
+Unable to determine library dependencies for 'prime/selenium/webdriver/firefox/x86/x_ignore_nofocus.so'
+Unable to determine library dependencies for 'prime/lib/python3.6/site-packages/selenium/webdriver/firefox/x86/x_ignore_nofocus.so'
+```
+
+Feel free  to help out solving it!

+ 54 - 0
snap/snapcraft.yaml

@@ -0,0 +1,54 @@
+name: home-assistant
+version: git
+summary: Open source home automation that puts local control and privacy first
+description:
+    Home Assistant is a home automation platform running on Python 3. 
+    It is able to track and control all devices at home and offer a 
+    platform for automating control.
+grade: devel
+base: core18
+confinement: devmode
+apps:
+    hass:
+        command: hass --config $SNAP_DATA
+        daemon: simple
+        restart-condition: always
+        plugs: [network, network-bind]
+
+parts:
+    home-assistant:
+        plugin: python
+        source: https://github.com/home-assistant/home-assistant.git
+        source-tag: "0.90.1"
+        python-version: python3
+        python-packages:
+            - Cython
+        build-packages:
+            - python3-dev
+            - pkg-config
+        stage-packages:
+            - libavformat-dev
+            - libavcodec-dev
+            - libavdevice-dev
+            - libavutil-dev 
+            - libswscale-dev
+            - libswresample-dev
+            - libavfilter-dev
+            - libslang2-dev
+            - libglu1-mesa-dev
+            - freeglut3-dev
+            - cython3
+        override-build: |
+            # Remove LICENCE-part of insteonplm, which causes pip to fail
+            echo "Fixing broken insteonplm install"
+            PPACKAGES="$(pwd)/../python-packages/"
+            INSTEONPLM=$(basename "$(ls ${PPACKAGES} | grep insteonplm --max-count=1)")
+            echo "* Extracting ${INSTEONPLM}"
+            SCFG=$(tar -xvzf "${PPACKAGES}/${INSTEONPLM}" | grep setup.cfg --max-count=1)
+            sed '/^license_file/d' "${SCFG}" > ${SCFG}
+            echo "* Compressing ${INSTEONPLM}"
+            tar -zcvf "${PPACKAGES}/${INSTEONPLM}" $(dirname "${SCFG}")
+            echo "* Updated ${INSTEONPLM}"
+            rm -rf $(dirname "${SCFG}")
+            snapcraftctl build
+        requirements: requirements_all.txt