-
Notifications
You must be signed in to change notification settings - Fork 0
/
snapcraft.yaml
469 lines (444 loc) · 23.4 KB
/
snapcraft.yaml
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
name: kura
version: "3.x"
version-script: |
[ "x$(grep -E '^version=.*SNAPSHOT' prime/kura/kura/kura.properties)" != "x" ] \
&& echo $(grep '^version=' prime/kura/kura/kura.properties | awk -F '=' '{ print $2}')-$(git --git-dir=parts/kura/build/.git describe --tags | awk -F '-' '{ print $2"-"$3}') \
|| grep '^version=' prime/kura/kura/kura.properties | awk -F '=' '{ print $2}'
summary: kura
description: |
kura
confinement: strict
grade: stable
hooks:
install:
plugs:
- network-setup-control
post-refresh:
plugs:
- network-setup-control
plugs:
client:
interface: bluez
slots:
service:
interface: bluez
passthrough:
layout:
/etc/sysconfig:
bind: $SNAP_COMMON/etc/sysconfig
/etc/bind:
bind: $SNAP_COMMON/etc/bind
/etc/hostapd:
bind: $SNAP_COMMON/etc/hostapd
/etc/network:
bind: $SNAP_COMMON/etc/network
/etc/wpa_supplicant:
bind: $SNAP_COMMON/etc/wpa_supplicant
/etc/init.d/firewall:
bind-file: $SNAP/etc/init.d/firewall
/etc/adjtime:
bind-file: $SNAP_COMMON/etc/adjtime
apps:
# service:
# command: kura-control start_kura_backgroud.sh
# daemon: simple
# plugs:
# - home
# - io-ports-control
# - hardware-observe
# - firewall-control
# - network-bind
# - network-control
# - network-setup-control
# - process-control
# - removable-media
# - system-observe
# - time-control
kura:
command: kura/bin/start_kura.sh
plugs: &default-plugs [home , io-ports-control, hardware-observe, firewall-control, network-bind, network-control, network-setup-control, process-control, removable-media, system-observe, time-control, ppp, log-observe, mount-observe]
kura-daemon:
command: kura/bin/start_kura_debug.sh
stop-command: kura-init stop
daemon: simple
plugs: *default-plugs
kura-debug:
command: kura/bin/start_kura_debug.sh
plugs: *default-plugs
bash:
command: bin/bash
plugs: *default-plugs
help:
command: bin/help
bluez:
command: "usr/lib/bluetooth/bluetoothd -E"
daemon: simple
plugs:
- uhid
slots:
- service
obex:
command: "usr/lib/bluetooth/obexd"
daemon: simple
slots:
- service
named:
command: "usr/sbin/named -f -c $SNAP_COMMON/etc/bind/named.conf"
daemon: simple
stop-command: usr/sbin/rndc stop
plugs: *default-plugs
# hostapd:
# command: "usr/sbin/hostapd --pidfile ${SNAP_DATA}/run/hostapd.pid"
# daemon: simple
# plugs: *default-plugs
# wpa-supplicant:
# command: "/sbin/wpa_supplicant -u -s -O $SNAP_COMMON/run/wpa_supplicant"
# daemon: simple
# plugs: *default-plugs
parts:
kura:
# use custom pluging, it will build what we need
plugin: nil
source: https://github.com/eclipse/kura.git
# source: https://github.com/kubiko/kura.git
source-branch: develop
build-packages:
- unzip
- openjdk-8-jdk-headless
- maven
- gawk
# first tweak source for snap building
override-pull: |
snapcraftctl pull
sed -i \
-e '/int result;/a logger.info("OK:" + OS_VERSION + "raspi-Name:" + KuraConstants.Raspberry_Pi.getImageName() );' \
-e '/int result;/a logger.info("OK: snap: " + System.getProperty("kura.os.snap") );' \
-e '/int result;/a logger.info("OK: snap.data: " + System.getProperty("kura.data.snap.data") );' \
-e '/int result;/a logger.info("OK: snap.common: " + System.getProperty("kura.data.snap.common") );' \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/dns/LinuxNamed.java
sed -i \
-e '/String OS_VERSION/a \ private static final String SNAP_COMMON = System.getProperty("kura.data.snap.common");' \
-e 's/\"\/etc\/bind\/named.conf\"/SNAP_COMMON + &/' \
-e 's/\"\/etc\/named.rfc1912.zones\"/SNAP_COMMON + \"\/etc\/bind\/named.rfc1912.zones\"/g' \
-e 's/\"\/var\/log\/named.log\"/SNAP_COMMON + &/' \
-e 's#/usr/sbin/named#named -f#g' \
-e 's#/etc/init.d/bind9 start#snapctl start --enable '"${SNAPCRAFT_PROJECT_NAME}"'.named#g' \
-e 's#/etc/init.d/bind9 stop#snapctl stop --disable '"${SNAPCRAFT_PROJECT_NAME}"'.named#g' \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/dns/LinuxNamed.java
sed -i \
-e '/String OS_VERSION/a \ private static final String SNAP_COMMON = System.getProperty("kura.data.snap.common");' \
-e '/String OS_VERSION/a \ private static final String SNAP = System.getProperty("kura.os.snap");' \
-e 's#systemctl start hostapd#snapctl start --enable '"${SNAPCRAFT_PROJECT_NAME}"'.hostapd#g' \
-e 's#systemctl stop hostapd#snapctl stop --disable '"${SNAPCRAFT_PROJECT_NAME}"'.hostapd#g' \
-e 's#\"/etc/hostapd#SNAP_COMMON + \"/etc/hostapd/hostapd-#g' \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/wifi/HostapdManager.java
sed -i \
-e 's#systemctl start wpa_supplicant#snapctl start --enable '"${SNAPCRAFT_PROJECT_NAME}"'.wpa-supplicant#g' \
-e 's#systemctl stop hostapd#snapctl stop --disable '"${SNAPCRAFT_PROJECT_NAME}"'.hostapd#g' \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/wifi/WpaSupplicantManager.java
sed -i \
-e '/Logger logger/a \ private static final String SNAP_COMMON = System.getProperty("kura.data.snap.common");' \
-e 's/\"\/etc\/network\/interfaces\"/SNAP_COMMON + &/' \
-e 's/\"\/etc\/network\/\"/SNAP_COMMON + &/' \
-e 's#/etc/network/interfaces.tmp#/tmp/network_interfaces.tmp#g' \
kura/org.eclipse.kura.net.admin/src/main/java/org/eclipse/kura/net/admin/visitor/linux/IfcfgConfigWriter.java \
kura/org.eclipse.kura.net.admin/src/main/java/org/eclipse/kura/net/admin/visitor/linux/IfcfgConfigReader.java \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/util/LinuxNetworkUtil.java \
kura/org.eclipse.kura.net.admin/src/main/java/org/eclipse/kura/net/admin/NetworkAdminServiceImpl.java
sed -i \
-e 's#name="target.device" value=".*"#name="target.device" value="ubuntu-core"#g' \
-e 's#name="native.tag" value=".*"#name="native.tag" value="x86_64"#g' \
-e 's#name="kura.os.version" value=".*"#name="kura.os.version" value="ubuntu-core"#g' \
-e 's#name="kura.arch" value=".*"#name="kura.arch" value="x86_64"#g' \
-e 's#name="kura.install.dir" value=".*"#name="kura.install.dir" value="/snap/'"${SNAPCRAFT_PROJECT_NAME}"'/current"#g' \
kura/distrib/pom.xml
sed -i \
-e 's#raspbian#ubuntu-core#g' \
-e 's#raspberry-pi#ubuntu-core#g' \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/util/KuraConstants.java
sed -i \
-e 's#/etc/dhcpd-#/etc/hostapd/dhcpd-#g' \
-e 's#/etc/hostapd.conf#/etc/hostapd/hostapd.conf#g' \
kura/org.eclipse.kura.net.admin/src/main/java/org/eclipse/kura/net/admin/NetworkAdminServiceImpl.java
sed -i \
-e 's#/etc/hostapd-#/etc/hostapd/hostapd-#g' \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/wifi/HostapdManager.java
sed -i \
-e '/Logger logger/a \ private static final String SNAP_COMMON = System.getProperty("kura.data.snap.common");' \
-e '/Logger logger/a \ private static final String SNAP_DATA = System.getProperty("kura.data.snap.data");' \
-e '/Logger logger/a \ private static final String SNAP = System.getProperty("kura.os.snap");' \
-e 's/\"\/var\/run\"/SNAP_DATA + \"\/var\/run\"/g' \
-e 's/\"\/var\/run\/\"/SNAP_DATA + \"\/var\/run\/\"/g' \
-e 's/\"\/var\/lib\/dhclient\"/SNAP_DATA + &/' \
-e 's/\"\/var\/lib\/dhcp\"/SNAP_DATA + &/' \
-e 's/\"\/etc\/\"/SNAP_COMMON + &/g' \
-e '/if (useLeasesFile)/i \ sb.append(\"-sf \" + SNAP_COMMON + "\/sbin\/dhclient-script \");' \
-e '/if (useLeasesFile)/i \ sb.append(\"-cf \" + SNAP_COMMON + \"\/etc\/dhcp\/dhclient.conf \");' \
-e '/sb.append(\" -r \");/a \ sb.append(formLeasesOption(interfaceName));' \
-e '/sb.append(\" -r \");/a \ sb.append(\" -sf \" + SNAP_COMMON + "\/sbin\/dhclient-script \");' \
-e '/sb.append(\" -r \");/a \ sb.append(\"-cf \" + SNAP_COMMON + \"\/etc\/dhcp\/dhclient.conf \");' \
-e 's/dhcpClientTool = DhcpClientTool.NONE/dhcpClientTool = DhcpClientTool.DHCLIENT/g' \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/dhcp/DhcpClientLeases.java \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/dhcp/DhcpClientManager.java \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/dhcp/DhcpServerImpl.java \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/dhcp/DhcpServerManager.java
sed -i \
-e '/Logger logger/a \ private static final String SNAP_DATA = System.getProperty("kura.data.snap.data");' \
-e '/Logger logger/a \ private static final String SNAP_COMMON = System.getProperty("kura.data.snap.common");' \
-e 's/\"\/etc\/resolv.conf/SNAP_COMMON + &/' \
-e 's/\"\/var\/run\/ppp\/resolv.conf\"/SNAP_DATA + &/' \
-e 's/\"\/etc\/ppp\/resolv.conf\"/SNAP_COMMON + &/' \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/dns/LinuxDns.java
sed -i \
-e '/Logger logger/a \ private static final String SNAP_DATA = System.getProperty("kura.data.snap.data");' \
-e '/Logger logger/a \ private static final String SNAP = System.getProperty("kura.os.snap");' \
-e 's/\"\/var\/lock\/LCK/SNAP_DATA + &/' \
-e 's/\"\/usr\/sbin\/pppd\"/SNAP + &/' \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/ppp/PppLinux.java \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/modem/SerialModemDriver.java
sed -i \
-e '/Logger logger/a \ private static final String SNAP = System.getProperty("kura.os.snap");' \
-e '/Logger logger/a \ private static final String SNAP_COMMON = System.getProperty("kura.data.snap.common");' \
-e 's/\"\/etc\/init.d\/firewall_cust/SNAP + &/' \
-e 's/\"\/etc\/sysconfig/SNAP_COMMON + &/' \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/iptables/IptablesConfig.java \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/iptables/LinuxFirewall.java
sed -i \
-e '/Logger logger/a \ private static final String SNAP_COMMON = System.getProperty("kura.data.snap.common");' \
-e 's/\"\/etc\/wpa_supplicant/SNAP_COMMON + &/' \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/wifi/WpaSupplicantManager.java
sed -i \
-e 's#systemctl start bluetooth#snapctl start --enable '"${SNAPCRAFT_PROJECT_NAME}"'.bluez #g' \
kura/org.eclipse.kura.ble.provider/src/main/java/org/eclipse/kura/internal/ble/BluetoothLeServiceImpl.java
sed -i \
-e '/for (IPAddress router : routers) {/i \ if (routers != null && !routers.isEmpty()) {' \
-e '/for (IPAddress dnsServer : dnsServers) {/i \ if (dnsServers != null && !dnsServers.isEmpty()) {' \
-e '/servers.add(dnsServer);/a \ }' \
-e '/gateways.add(router);/a \ }' \
kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/dhcp/DhcpClientLeases.java
sed -i \
-e 's#osgi.instance.area=.*#osgi.instance.area=/var/snap/'"${SNAPCRAFT_PROJECT_NAME}"'/current/data#g' \
-e 's#org.osgi.framework.storage=.*#org.osgi.framework.storage=/var/snap/'"${SNAPCRAFT_PROJECT_NAME}"'/current/data#g' \
kura/distrib/src/main/osgi/equinox_3.11.1/configuration/config.ini
sed -i \
-e 's#Raspberry-Pi#ubuntu-core#g' \
kura/distrib/src/main/resources/raspberry-pi-2*/kura.properties
sed -i \
-e 's#/var/log/kura#/var/snap/'"${SNAPCRAFT_PROJECT_NAME}"'/current/log/kura#g' \
kura/distrib/src/main/resources/raspberry-pi-2*/log4j.properties
sed -i \
-e 's#iptables_config_file=.*#iptables_config_file=${SNAP_COMMON}/etc/sysconfig/iptables#g' \
-e 's#/etc/init.d/firewall_cust#${SNAP_COMMON}/etc/init.d/firewall_cust#g' \
kura/distrib/src/main/resources/raspberry-pi-2*/firewall.init
sed -i \
-e 's#/var/run/#${SNAP_DATA}/var/run/#g' \
kura/distrib/src/main/resources/common/*.init.raspbian
awk -i inplace \
'1;/export PATH/{ print \
"export JAVA_HOME=$SNAP/jre\nexport PATH=$SNAP/jre/bin:$PATH"}' \
kura/distrib/src/main/resources/common/kura.init.raspbian
sed -i \
-e 's#/var/.monit.state#/var/snap/'"${SNAPCRAFT_PROJECT_NAME}"'/current/.monit.state#g' \
-e 's#/etc/init.d/kura#/snap/'"${SNAPCRAFT_PROJECT_NAME}"'/current/bin/kura-init#g' \
kura/distrib/src/main/resources/common/monitrc.raspbian
sed -i \
-e 's#monit=/usr/bin/monit#monit=${SNAP}/usr/bin/monit#g' \
-e 's#/etc/monitrc#${SNAP_COMMON}/etc/monitrc#g' \
kura/distrib/src/main/resources/common/monit.init.raspbian
sed -i \
-e 's#/etc/network/interfaces#${SNAP_COMMON}/etc/network/interfaces#g' \
kura/distrib/src/main/resources/common/i*
override-build: |
./build-all.sh $(mvn -N -f kura/distrib/pom.xml help:all-profiles | grep "Profile Id" | awk \
-v profile=raspberry-pi-2-$(if [ "$(echo $SNAPCRAFT_PROJECT_NAME | tail -c 4)" = "-nn" ];then echo "3-nn"; else echo "3";fi) \
'{ if($3 == profile){print "-P"$3}else{print "-P!"$3 }}' | sort -u | tr '\n' ' ')
unzip kura/distrib/target/kura_*_raspberry-pi-2$(if [ "$(echo $SNAPCRAFT_PROJECT_NAME | tail -c 4)" = "-nn" ];then echo "*-nn";fi).zip -d $SNAPCRAFT_PART_INSTALL/
mv $SNAPCRAFT_PART_INSTALL/kura_* $SNAPCRAFT_PART_INSTALL/kura
# tweak some config settings
sed -i -e 's#-consoleLog >> /var/log/kura-.*#-consoleLog#g' \
-e 's#${DIR}/data#${SNAP_COMMON}/data#g' \
-e '/-Dkura.data.dir=/a \ -Dkura.data.snap.common=${SNAP_COMMON}\/ \\' \
-e '/-Dkura.data.dir=/a \ -Dkura.data.snap.data=${SNAP_DATA}\/ \\' \
-e '/-Dkura.data.dir=/a \ -Dkura.os.snap=${SNAP}\/ \\' \
-e 's#/var/log#${SNAP_DATA}/log#g' \
-e 's#-Dkura.configuration\=.*#-Dkura.configuration=file:${SNAP_COMMON}/conf/kura.properties \\#g' \
-e 's#-Dkura.custom.configuration\=.*#-Dkura.custom.configuration=file:${SNAP_COMMON}/conf/kura_custom.properties \\#g' \
-e 's#-Ddpa.configuration\=.*#-Ddpa.configuration=${SNAP_COMMON}/conf/dpa.properties \\#g' \
-e 's#-Dlog4j.configuration\=.*#-Dlog4j.configuration=file:${SNAP_COMMON}/conf/log4j.properties \\#g' \
-e 's#-Dkura.os.version\=.*#-Dkura.os.version=ubuntu-core \\#g' \
-e 's#-Dtarget.device\=.*#-Dtarget.device=core \\#g' \
-e 's#/var/run/kura.pid#/$SNAP_DATA/var/run/kura.pid#g' \
-e 's#-Xms[0-9]*m#-Xms${JAVA_MEMORY}m#g' \
-e 's#-Xmx[0-9]*m#-Xmx${JAVA_MEMORY}m#g' \
-e '/kura\/config.ini/a . $SNAP\/bin/read-config' \
-e '/PATH/s/^/#/g' \
$SNAPCRAFT_PART_INSTALL/kura/bin/start_kura*.sh
chmod +x $SNAPCRAFT_PART_INSTALL/kura/install/*.raspbian
chmod +x $SNAPCRAFT_PART_INSTALL/kura/install/*.init
chmod +x $SNAPCRAFT_PART_INSTALL/kura/install/if*-local*
sed -i \
-e '/directory.*/a \ bindkeys-file "${SNAP_COMMON}/etc/bind/bind.keys";' \
-e '/directory.*/a \ session-keyfile "${SNAP_COMMON}/var/run/named/session.key";' \
-e '/directory.*/a \ pid-file "${SNAP_COMMON}/var/run/named/named.pid";' \
-e 's#/var/named#${SNAP_COMMON}/var/named#g' \
-e 's#/var/log/named.log#${SNAP_COMMON}/var/log/named.log#g' \
-e 's#/etc/named.rfc1912.zones#${SNAP_COMMON}/etc/bind/named.rfc1912.zones#g' \
-e 's#named.ca#${SNAP_COMMON}/var/named/named.ca#g' \
$SNAPCRAFT_PART_INSTALL/kura/install/named.conf
organize:
kura/install/kura.init.raspbian: bin/kura-init
kura/install/monit.init.raspbian: bin/monit-init
kura/install/firewall.init: etc/init.d/firewall
kura/install/iptables.init: etc/sysconfig/iptables
kura/install/ifup-local.raspbian: etc/network/if-up.d/ifup-local
kura/install/ifdown-local: etc/network/if-down.d/ifdown-local
kura/install/network.interfaces.raspbian: etc/network/interfaces
kura/install/named.conf: etc/bind/named.conf
kura/install/named.rfc1912.zones: etc/bind/named.rfc1912.zones
kura-tools:
plugin: nil
stage-packages:
- libudev1
- dos2unix
- telnet
- minicom
- setserial
- powertop
- openvpn
- monit
- coreutils
- unzip
- inetutils-telnet
- socat
- usbutils
- nano
- bash
- libx11-6
- libxau6
- libxdmcp6
- libxext6
- libxi6
- libxrender1
- libxtst6
- libxcb1
- libatm1
# start-stop-daemon
start-stop-daemon:
plugin: nil
stage-packages:
- dpkg
stage:
- -urs
- -var
- -etc
# network
net:
plugin: nil
stage-packages:
- bind9
- bind9-host
- iptables
- hostapd
- isc-dhcp-server
- isc-dhcp-client
- iw
- ethtool
- wireless-tools
- wpasupplicant
- ppp
stage:
- -etc/bind/named.conf
- -etc/bind/zones.rfc1918
- -etc/network/if-down.d/upstart
- -etc/network/if-up.d/upstart
override-build: |
snapcraftctl build
# fix bind9 and dependencies
sed -i -e 's#/usr/sbin/#${SNAP}/usr/sbin/#g' \
-e 's#/run/named#${SNAP_DATA}/run/named#g' \
-e 's#/run/hostapd#${SNAP_DATA}/run/hostapd#g' \
-e 's#/run/openvpn#${SNAP_DATA}/run/openvpn#g' \
-e 's#/var/run/#${SNAP_DATA}/var/run/#g' \
-e 's#/etc/default#${SNAP_DATA}/etc/default#g' \
-e 's|chown.*|# chown: not allowed from snap|g' \
$SNAPCRAFT_PART_INSTALL/etc/init.d/*
sed -i -e 's#/sbin/if#${SNAP}/sbin/if#g' \
$SNAPCRAFT_PART_INSTALL/etc/wpa_supplicant/functions.sh
awk -i inplace '1;/RESOLVCONF=no/{ print "echo \"SNAP=${SNAP}\""}' \
$SNAPCRAFT_PART_INSTALL/etc/init.d/bind9
sed -i -e 's#/usr/sbin/#${SNAP}/usr/sbin/#g' \
-e 's#/run/hostapd#${SNAP_DATA}/run/hostapd#g' \
-e 's#/run/sendsigs#${SNAP_DATA}/run/sendsigs#g' \
$SNAPCRAFT_PART_INSTALL/etc/hostapd/*
sed -i -e 's#/etc/dhc#${SNAP_COMMON}/etc/dhc#g' \
-e 's#/etc/resolv.conf#${SNAP_COMMON}/etc/resolv.conf#g' \
-e '/PATH/s/^/#/g' \
$SNAPCRAFT_PART_INSTALL/sbin/dhclient-script
find $SNAPCRAFT_PART_INSTALL/etc/network/ -type f -exec sed -i 's#=/sbin/#=${SNAP}/sbin/#g' {} \;
find $SNAPCRAFT_PART_INSTALL/etc/network/ -type f -exec sed -i 's#/usr/sbin/#${SNAP}/usr/sbin/#g' {} \;
ifupdown:
source: https://git.launchpad.net/ubuntu/+source/ifupdown
source-branch: ubuntu/xenial-devel
source-type: git
plugin: make
override-pull: |
snapcraftctl pull
git apply ../../../ifupdown.patch
override-build: |
snapcraftctl build
ln -sf ifup $SNAPCRAFT_PART_INSTALL/sbin/ifdown
ln -sf ifup $SNAPCRAFT_PART_INSTALL/sbin/ifquery
# java run time
jre:
plugin: zulu-jre
# zulu supported architectures(armhf, amd64) are already handled by plugin itself
# define here overide for pluging's defaults, or to add additional architectures
# example overide:
# zulu:
# amd64: https://www.azul.com/downloads/zulu/zdk-8-ga-linux_x64.tar.gz
helpers:
plugin: dump
source: scripts
bluez:
plugin: autotools
source: https://git.launchpad.net/~snappy-hwe-team/snappy-hwe-snaps/+git/bluez
source-type: git
source-branch: bluez/5.44
configflags:
- --prefix=/usr
- --libexec=/usr/lib/
- --enable-experimental
- --enable-threads
- --disable-cups
- --enable-obex
- --disable-systemd
- --disable-silent-rules
- --enable-test
- --enable-deprecated
build-packages:
- libglib2.0-dev
- libdbus-1-dev
- libical-dev
- libreadline6-dev
- libudev-dev
- udev
- pkg-config
stage-packages:
- libical1a
filesets:
libical1a:
- usr/lib/*/libical*
stage:
- usr/lib/bluetooth/bluetoothd
- usr/lib/bluetooth/obexd
- usr/bin/bluetoothctl
- usr/bin/obexctl
- usr/bin/hciconfig
- usr/bin/hcidump
- usr/bin/hciattach
- usr/bin/hcitool
- usr/bin/sdptool
- usr/bin/btmon
- usr/bin/btmgmt
- usr/share/doc/libical1a/copyright
- $libical1a