summaryrefslogtreecommitdiff
path: root/packages/net/homeassistant/homeassistant-0.51.2.exheres-0
blob: d637b929f16aff4aced9f16b59150489060bb8ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# Copyright 2016-2017 Timo Gurr <tgurr@exherbo.org>
# Distributed under the terms of the GNU General Public License v2

require pypi setup-py [ import=setuptools has_bin=true multibuild=false blacklist="2 3.3" test=pytest ] \
    systemd-service

SUMMARY="Open-source home automation platform running on Python 3"
DESCRIPTION="
The goal of Home Assistant is to be able to track and control all devices at home and offer a
platform for automating control.
"
HOMEPAGE+=" https://home-assistant.io"

LICENCES="Apache-2.0"
SLOT="0"
PLATFORMS="~amd64"
MYOPTIONS=""

# Need to figure out
RESTRICT="test"

DEPENDENCIES="
    build+run:
        group/${PN}
        user/${PN}
        dev-python/Jinja2[>=2.9.5][python_abis:*(-)?]
        dev-python/PyYAML[>=3.11&<4][python_abis:*(-)?]
        dev-python/aiohttp[>=2.2.5][python_abis:*(-)?]
        dev-python/astral[>=1.4][python_abis:*(-)?]
        dev-python/async-timeout[>=1.2.1][python_abis:*(-)?]
        dev-python/chardet[>=3.0.4][python_abis:*(-)?]
        dev-python/pip[>=8.0.3][python_abis:*(-)?]
        dev-python/pytz[>=2017.2][python_abis:*(-)?]
        dev-python/requests[>=2.14.2&<3][python_abis:*(-)?]
        dev-python/voluptuous[>=0.10.5][python_abis:*(-)?]
        python_abis:3.4? (
            dev-python/typing[>=3&<4][python_abis:3.4]
        )
    run:
        dev-python/SQLAlchemy[>=1.1.13][python_abis:*(-)?]
        dev-python/aiohttp-cors[>=0.5.3][python_abis:*(-)?]
        dev-python/distro[>=1.0.4][python_abis:*(-)?]
        dev-python/fuzzywuzzy[>=0.15.1][python_abis:*(-)?]
        dev-python/netdisco[>=1.1.0][python_abis:*(-)?]
        dev-python/xmltodict[>=0.11.0][python_abis:*(-)?]
    suggestion:
        app-speech/svox [[
            description = [ Required for Home Assistant component: tts.picotts ]
        ]]
        dev-python/PyChromecast[>=0.8.2][python_abis:*(-)?] [[
            description = [ Required for Home Assistant component: media_player.cast ]
        ]]
        dev-python/beautifulsoup4[>=4.6.0][python_abis:*(-)?] [[
            description = [ Required for Home Assistant component: device_tracker.linksys_ap, sensor.geizhals, sensor.scrape ]
        ]]
        dev-python/jsonrpc-async[>=0.6][python_abis:*(-)?] [[
            description = [ Required for Home Assistant component: media_player.kodi, notify.kodi ]
        ]]
        dev-python/jsonrpc-websocket[>=0.5][python_abis:*(-)?] [[
            description = [ Required for Home Assistant component: media_player.kodi ]
        ]]
        dev-python/limitlessled[>=1.0.8][python_abis:*(-)?] [[
            description = [ Required for Home Assistant component: light.limitlessled ]
        ]]
        dev-python/mutagen[>=1.38][python_abis:*(-)?] [[
            description = [ Required for Home Assistant component: tts ]
        ]]
        dev-python/paho-mqtt[>=1.3.0][python_abis:*(-)?] [[
            description = [ Required for Home Assistant component: mqtt, shiftr ]
        ]]
        dev-python/psutil[>=5.2.2][python_abis:*(-)?] [[
            description = [ Required for Home Assistant component: sensor.systemmonitor ]
        ]]
        dev-python/pylast[>=1.9.0][python_abis:*(-)?] [[
            description = [ Required for Home Assistant component: sensor.lastfm ]
        ]]
        dev-python/python-mpd2[>=0.5.5][python_abis:*(-)?] [[
            description = [ Required for Home Assistant component: media_player.mpd ]
        ]]
        dev-python/python-nmap[>=0.6.1][python_abis:*(-)?] [[
            description = [ Required for Home Assistant component: device_tracker.nmap_tracker ]
        ]]
        dev-python/snapcast[>=2.0.6][python_abis:*(-)?] [[
            description = [ Required for Home Assistant component: media_player.snapcast ]
        ]]
        dev-python/spotipy[>=2.4.4][python_abis:*(-)?] [[
            description = [ Required for Home Assistant component: media_player.spotify ]
        ]]
        dev-python/wakeonlan[>=0.2.2][python_abis:*(-)?] [[
            description = [ Required for Home Assistant component: media_player.panasonic_viera, media_player.samsungtv, media_player.webostv, switch.wake_on_lan ]
        ]]
        dev-python/zeroconf[>=0.19.1][python_abis:*(-)?] [[
            description = [ Required for Home Assistant component: zeroconf ]
        ]]
        sys-apps/net-tools [[
            description = [ Required for Home Assistant component: device_tracker.nmap_tracker ]
        ]]
        net-misc/iputils [[
            description = [ Required for Home Assistant component: switch.wake_on_lan ]
        ]]
"

src_prepare() {
    setup-py_src_prepare

    # Setup
    # typing is included in Python >= 3.5
    if [[ $(python_get_abi) == 3.5 ]] || [[ $(python_get_abi) == 3.6 ]] ; then
        edo sed \
            -e "/typing/d" \
            -i setup.py
    fi
    # can be more recent
    edo sed \
        -e 's:requests==2.14.2:requests>=2.14.2:g' \
        -e 's:voluptuous==0.10.5:voluptuous>=0.10.5:g' \
        -e 's:aiohttp==2.2.5:aiohttp>=2.2.5:g' \
        -e 's:async_timeout==1.2.1:async_timeout>=1.2.1:g' \
        -e 's:chardet==3.0.4:chardet>=3.0.4:g' \
        -e 's:astral==1.4:astral>=1.4:g' \
        -i homeassistant/package_constraints.txt \
        -i setup.py

    # Core components
    # homeassistant.components.recorder
    # homeassistant.scripts.db_migrator
    edo sed \
        -e 's:sqlalchemy==1.1.13:sqlalchemy>=1.1.13:g' \
        -i homeassistant/components/recorder/__init__.py
    # homeassistant.components.emulated_hue
    # homeassistant.components.http
    edo sed \
        -e 's:aiohttp_cors==0.5.3:aiohttp_cors>=0.5.3:g' \
        -i homeassistant/components/__init__.py
    # homeassistant.components.updater
    edo sed \
        -e 's:distro==1.0.4:distro>=1.0.4:g' \
        -i homeassistant/components/updater.py
    # homeassistant.components.sensor.swiss_hydrological_data
    # homeassistant.components.sensor.ted5000
    # homeassistant.components.sensor.yr
    edo sed \
        -e 's:xmltodict==0.11.0:xmltodict>=0.11.0:g' \
        -i homeassistant/components/sensor/{swiss_hydrological_data,ted5000,yr}.py
    # homeassistant.components.conversation
    edo sed \
        -e 's:fuzzywuzzy==0.15.1:fuzzywuzzy>=0.15.1:g' \
        -i homeassistant/components/conversation.py
    # homeassistant.components.discovery
    edo sed \
        -e 's:netdisco==1.1.0:netdisco>=1.1.0:g' \
        -i homeassistant/components/discovery.py

    # Additional components
    # homeassistant.components.media_player.cast
    edo sed \
        -e 's:pychromecast==0.8.2:pychromecast>=0.8.2:g' \
        -i homeassistant/components/media_player/cast.py
    # homeassistant.components.device_tracker.linksys_ap
    # homeassistant.components.sensor.scrape
    edo sed \
        -e 's:beautifulsoup4==4.6.0:beautifulsoup4>=4.6.0:g' \
        -i homeassistant/components/device_tracker/linksys_ap.py \
        -i homeassistant/components/sensor/scrape.py
    # homeassistant.components.media_player.kodi
    # homeassistant.components.notify.kodi
    edo sed \
        -e 's:jsonrpc-async==0.6:jsonrpc-async>=0.6:g' \
        -i homeassistant/components/media_player/kodi.py
    # homeassistant.components.media_player.kodi
    edo sed \
        -e 's:jsonrpc-websocket==0.5:jsonrpc-websocket>=0.5:g' \
        -i homeassistant/components/media_player/kodi.py
    # homeassistant.components.light.limitlessled
    edo sed \
        -e 's:limitlessled==1.0.8:limitlessled>=1.0.8:g' \
        -i homeassistant/components/light/limitlessled.py
    # homeassistant.components.tts
    edo sed \
        -e 's:mutagen==1.38.0:mutagen>=1.38.0:g' \
        -i homeassistant/components/tts/__init__.py
    # homeassistant.components.mqtt
    # homeassistant.components.shiftr
    edo sed \
        -e 's:paho-mqtt==1.3.0:paho-mqtt>=1.3.0:g' \
        -i homeassistant/components/mqtt/__init__.py \
        -i homeassistant/components/shiftr.py
    # homeassistant.components.sensor.systemmonitor
    edo sed \
        -e 's:psutil==5.2.2:psutil>=5.2.2:g' \
        -i homeassistant/components/sensor/systemmonitor.py
    # homeassistant.components.sensor.lastfm
    edo sed \
        -e 's:pylast==1.9.0:pylast>=1.9.0:g' \
        -i homeassistant/components/sensor/lastfm.py
    # homeassistant.components.media_player.mpd
    edo sed \
        -e 's:python-mpd2==0.5.5:python-mpd2>=0.5.5:g' \
        -i homeassistant/components/media_player/mpd.py
    # homeassistant.components.device_tracker.nmap_tracker
    edo sed \
        -e 's:python-nmap==0.6.1:python-nmap>=0.6.1:g' \
        -i homeassistant/components/device_tracker/nmap_tracker.py
    # homeassistant.components.media_player.snapcast
    edo sed \
        -e 's:snapcast==2.0.6:snapcast>=2.0.6:g' \
        -i homeassistant/components/media_player/snapcast.py
    # homeassistant.components.media_player.spotify
    edo sed \
        -e "s:.*REQUIREMENTS.*:REQUIREMENTS = ['spotipy>=2.4.4']:g" \
        -e '/spotipy==2.4.4/d' \
        -i homeassistant/components/media_player/spotify.py
    # homeassistant.components.wake_on_lan
    # homeassistant.components.media_player.panasonic_viera
    # homeassistant.components.media_player.samsungtv
    # homeassistant.components.media_player.webostv
    # homeassistant.components.switch.wake_on_lan
    edo sed \
        -e 's:wakeonlan==0.2.2:wakeonlan>=0.2.2:g' \
        -i homeassistant/components/wake_on_lan.py \
        -i homeassistant/components/media_player/{panasonic_viera,samsungtv,webostv}.py \
        -i homeassistant/components/switch/wake_on_lan.py
    # homeassistant.components.zeroconf
    edo sed \
        -e 's:zeroconf==0.19.1:zeroconf>=0.19.1:g' \
        -i homeassistant/components/zeroconf.py
}

src_install() {
    setup-py_src_install

    keepdir /var/lib/homeassistant
    edo chown homeassistant:homeassistant "${IMAGE}"/var/lib/homeassistant

    install_systemd_files
}

pkg_postinst() {
    einfo "After upgrading Home Assistant to a newer version run the database migrator:"
    einfo "su -c \"hass --script db_migrator --config /var/lib/homeassistant\" -s /bin/bash homeassistant"
}