/
usb-moded.spec
510 lines (409 loc) · 17.1 KB
1
Name: usb-moded
2
Version: 0.86.0+mer31
3
Release: 2
4
5
6
Summary: USB mode controller
Group: System/System Control
License: LGPLv2
7
URL: https://git.merproject.org/mer-core/usb-moded
8
Source0: %{name}-%{version}.tar.bz2
9
Source1: usb_moded.conf
10
11
12
13
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(glib-2.0)
14
BuildRequires: pkgconfig(libudev)
15
16
BuildRequires: pkgconfig(libkmod)
BuildRequires: doxygen
17
BuildRequires: pkgconfig(libsystemd)
18
BuildRequires: pkgconfig(ssu-sysinfo)
19
BuildRequires: pkgconfig(dsme) >= 0.65.0
20
21
Requires: lsof
22
Requires: usb-moded-configs
23
Requires: busybox-symlinks-dhcp
24
25
Requires(post): systemd
Requires(postun): systemd
26
Conflicts: dsme < 0.79.0
27
28
29
Conflicts: buteo-mtp-qt5-sync-plugin
Conflicts: buteo-mtp-qt5 < 0.5.0
Recommends: buteo-mtp-qt5
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
%description
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
%package devel
Summary: USB mode controller - development files
Group: Development/Libraries
%description devel
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the files needed to program for usb_moded.
%package doc
Summary: USB mode controller - documentation
Group: Documentation
%description doc
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the documentation.
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
%package developer-mode
Summary: USB mode controller - developer mode config
Group: Config
%description developer-mode
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the developer mode config, which enables
usb networking.
%package mtp-mode
Summary: USB mode controller - mtp mode config
Group: Config
77
Requires: buteo-mtp-qt5
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
%description mtp-mode
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the mtp mode config.
%package mass-storage-mode
Summary: USB mode controller - mass-storage mode config
Group: Config
%description mass-storage-mode
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the mass-storage mode config.
%package adb-mode
Summary: USB mode controller - android adb mode config
Group: Config
%description adb-mode
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the adb config for use with the android
gadget driver.
112
113
114
115
116
117
118
119
120
121
122
123
124
%package diag-mode-android
Summary: USB mode controller - android diag mode config
Group: Config
%description diag-mode-android
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the diag config for use with the android
gadget driver.
125
%package diag-mode-androidv5-qcom
126
127
128
Summary: USB mode controller - android v5 or newer diag mode config for qcom
Group: Config
129
%description diag-mode-androidv5-qcom
130
131
132
133
134
135
136
137
138
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the diag config for use with the android
gadget driver.
139
140
141
142
143
144
145
146
147
148
149
150
151
%package acm-mode-android
Summary: USB mode controller - android acm mode config
Group: Config
%description acm-mode-android
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the acm config for use with the android
gadget driver.
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
%package developer-mode-android
Summary: USB mode controller - android developer mode config
Group: Config
%description developer-mode-android
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the developer mode config for use with
the android gadget. This will provide usb networking.
%package mtp-mode-android
Summary: USB mode controller - android mtp mode config
Group: Config
%description mtp-mode-android
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the mtp mode config.
177
178
179
180
181
182
183
184
185
186
187
188
189
190
%package mtp-mode-android-ffs
Summary: USB mode controller - droid mtp mode config
Group: Config
%description mtp-mode-android-ffs
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the mtp mode config for devices that
have android kernel but still implement mtp functionality
via ffs.
191
192
193
194
195
196
197
198
199
200
201
202
%package pc-suite-mode-android
Summary: USB mode controller - android pc suite mode config
Group: Config
%description pc-suite-mode-android
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the android pc suite mode config.
203
204
205
206
207
208
209
210
211
212
213
214
%package at-mode-android
Summary: USB mode controller - android at modem mode config
Group: Config
%description at-mode-android
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the android at modem port mode config.
215
216
217
218
219
220
221
222
223
224
225
226
227
%package host-mode-jolla
Summary: USB mode controller - host mode switch for Jolla
Group: Config
%description host-mode-jolla
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the config to switch the first Jolla phone
in host mode.
228
%package defaults
229
230
231
232
233
Summary: USB mode controller - default configuration
Group: Config
Provides: usb-moded-configs
Requires: usb-moded-developer-mode
234
%description defaults
235
236
237
238
This package provides the default configuration for usb-moded, so
basic functionality is provided (i.e. usb networking, ask and charging
modes)
239
%package defaults-android
240
241
242
243
244
Summary: USB mode controller - default configuration
Group: Config
Provides: usb-moded-configs
Requires: usb-moded-developer-mode-android
245
%description defaults-android
246
247
248
249
This package provides the default configuration for usb-moded, so
basic functionality is provided (i.e. usb networking, ask and charging
modes with the android gadget driver)
250
%package diagnostics-config
251
252
253
Summary: USB mode controller - config data for diagnostics mode
Group: Config
254
%description diagnostics-config
255
256
257
This package contains the diagnostics info needed to configure a
diagnotic mode
258
259
260
261
262
263
264
265
266
267
268
269
270
%package connection-sharing-android-config
Summary: USB mode controller - USB/cellular data connection sharing config
Group: Config
%description connection-sharing-android-config
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains configuration to enable sharing the cellular data
connection over the USB with the android gadget driver.
271
272
273
274
275
276
277
278
279
280
281
282
283
%package connection-sharing-android-connman-config
Summary: USB mode controller - USB/cellular data connection sharing config
Group: Config
%description connection-sharing-android-connman-config
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains configuration to enable sharing the cellular data
connection over the USB with the connman gadget driver.
284
285
286
287
288
289
290
291
292
293
294
295
%package mass-storage-android-config
Summary: USB mode controller - mass-storage config with android gadget
Group: Config
%description mass-storage-android-config
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains configuration to enable sharing over mass-storage
with the android gadget driver.
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
%package vfat-android-config
Summary: USB mode controller - vfat config with tojblockd
Group: Config
Requires: tojblockd
%description vfat-android-config
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains configuration to enable sharing over vfat
emulation with tojblockd and nbd.
311
312
313
314
315
316
317
318
319
320
321
322
323
324
%package systemd-rescue-mode
Summary: USB mode controller - systemd rescue mode support
Group: Config
%Description systemd-rescue-mode
Usb_moded is a daemon to control the USB states. For this
it loads unloads the relevant usb gadget modules, keeps track
of the filesystem(s) and notifies about changes on the DBUS
system bus.
This package contains the configuration files for systemd to
provide the rescue mode, so device does not get locked down
when the UI fails.
325
326
327
328
%prep
%setup -q
%build
329
330
test -e Makefile || (%autogen)
test -e Makefile || (%configure --enable-app-sync --enable-meegodevlock --enable-debug --enable-connman --enable-systemd --enable-mer-ssu)
331
332
333
334
335
336
337
make all doc %{?_smp_mflags}
%install
%make_install
install -m 644 -D src/usb_moded-dbus.h %{buildroot}/%{_includedir}/%{name}/usb_moded-dbus.h
install -m 644 -D src/usb_moded-modes.h %{buildroot}/%{_includedir}/%{name}/usb_moded-modes.h
install -m 644 -D src/usb_moded-appsync-dbus.h %{buildroot}/%{_includedir}/%{name}/usb_moded-appsync-dbus.h
338
install -m 644 -D src/com.meego.usb_moded.xml %{buildroot}/%{_includedir}/%{name}/com.meego.usb_moded.xml
339
install -m 644 -D usb_moded.pc %{buildroot}/%{_libdir}/pkgconfig/usb_moded.pc
340
341
342
install -d %{buildroot}/%{_docdir}/%{name}-%{version}/html/
install -m 644 docs/html/* %{buildroot}/%{_docdir}/%{name}-%{version}/html/
install -m 644 docs/usb_moded-doc.txt %{buildroot}/%{_docdir}/%{name}-%{version}/
343
344
install -m 644 -D debian/manpage.1 %{buildroot}/%{_mandir}/man1/usb-moded.1
install -m 644 -D debian/usb_moded.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/usb_moded.conf
345
install -m 644 -D %{SOURCE1} %{buildroot}/%{_sysconfdir}/modprobe.d/usb_moded.conf
346
347
install -d %{buildroot}/%{_sysconfdir}/usb-moded
install -d %{buildroot}/%{_sysconfdir}/usb-moded/run
348
install -d %{buildroot}/%{_sysconfdir}/usb-moded/run-diag
349
install -d %{buildroot}/%{_sysconfdir}/usb-moded/dyn-modes
350
install -d %{buildroot}/%{_sysconfdir}/usb-moded/diag
351
install -m 644 -D config/dyn-modes/* %{buildroot}/%{_sysconfdir}/usb-moded/dyn-modes/
352
install -m 644 -D config/diag/* %{buildroot}/%{_sysconfdir}/usb-moded/diag/
353
install -m 644 -D config/run/* %{buildroot}/%{_sysconfdir}/usb-moded/run/
354
install -m 644 -D config/run-diag/* %{buildroot}/%{_sysconfdir}/usb-moded/run-diag/
355
install -m 644 -D config/mass-storage-jolla.ini %{buildroot}/%{_sysconfdir}/usb-moded/
356
357
install -d %{buildroot}/%{_sharedstatedir}/usb-moded
358
359
touch %{buildroot}/%{_sysconfdir}/modprobe.d/g_ether.conf
360
touch %{buildroot}/%{_sysconfdir}/udhcpd.conf
361
362
363
364
#systemd stuff
install -d $RPM_BUILD_ROOT/lib/systemd/system/basic.target.wants/
install -m 644 -D systemd/%{name}.service %{buildroot}/lib/systemd/system/%{name}.service
ln -s ../%{name}.service $RPM_BUILD_ROOT/lib/systemd/system/basic.target.wants/%{name}.service
365
install -d %{buildroot}/usr/lib/systemd/user
366
install -m 644 -D systemd/usb-moded-args.conf %{buildroot}/var/lib/environment/usb-moded/usb-moded-args.conf
367
install -m 755 -D systemd/turn-usb-rescue-mode-off %{buildroot}/%{_bindir}/turn-usb-rescue-mode-off
368
369
install -m 644 -D systemd/usb-rescue-mode-off.service %{buildroot}/lib/systemd/system/usb-rescue-mode-off.service
install -m 644 -D systemd/usb-rescue-mode-off.service %{buildroot}/lib/systemd/system/graphical.target.wants/usb-rescue-mode-off.service
370
install -m 644 -D systemd/usb-moded.conf %{buildroot}/%{_sysconfdir}/tmpfiles.d/usb-moded.conf
371
372
373
install -m 644 -D systemd/adbd-prepare.service %{buildroot}/lib/systemd/system/adbd-prepare.service
install -m 644 -D systemd/adbd-prepare.service %{buildroot}/lib/systemd/system/graphical.target.wants/adbd-prepare.service
install -m 744 -D systemd/adbd-functionfs.sh %{buildroot}/usr/sbin/adbd-functionfs.sh
374
375
%preun
376
systemctl daemon-reload || :
377
378
%post
379
systemctl daemon-reload || :
380
381
382
%files
%defattr(-,root,root,-)
383
%license LICENSE
384
385
386
%dir %{_sysconfdir}/usb-moded
%dir %{_sysconfdir}/usb-moded/dyn-modes
%dir %{_sysconfdir}/usb-moded/run
387
388
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/usb_moded.conf
%config(noreplace) %{_sysconfdir}/modprobe.d/usb_moded.conf
389
%ghost %config(noreplace) %{_sysconfdir}/modprobe.d/g_ether.conf
390
%ghost %{_sysconfdir}/udhcpd.conf
391
%ghost %{_sysconfdir}/usb-moded/usb-moded.ini
392
393
394
%{_sbindir}/usb_moded
%{_sbindir}/usb_moded_util
/lib/systemd/system/%{name}.service
395
/lib/systemd/system/basic.target.wants/%{name}.service
396
%config %{_sysconfdir}/tmpfiles.d/usb-moded.conf
397
398
%dir %{_sharedstatedir}/usb-moded
%ghost %{_sharedstatedir}/usb-moded/usb-moded.ini
399
400
401
402
403
404
405
406
%files devel
%defattr(-,root,root,-)
%{_includedir}/%{name}/*
%{_libdir}/pkgconfig/usb_moded.pc
%files doc
%defattr(-,root,root,-)
407
408
%{_docdir}/%{name}-%{version}
%{_mandir}/man1/usb-moded.1.gz
409
410
411
412
413
414
415
416
417
418
419
420
421
422
%files developer-mode
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/developer_mode.ini
%files mtp-mode
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/mtp_mode.ini
%{_sysconfdir}/usb-moded/run/mtp.ini
%files mass-storage-mode
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/mass-storage.ini
423
424
%files diag-mode-android
%defattr(-,root,root,-)
425
426
427
%{_sysconfdir}/usb-moded/dyn-modes/diag_mode_old.ini
%{_sysconfdir}/usb-moded/run/adb-diag.ini
428
%files diag-mode-androidv5-qcom
429
%defattr(-,root,root,-)
430
431
%{_sysconfdir}/usb-moded/dyn-modes/diag_mode.ini
%{_sysconfdir}/usb-moded/run/adb-diag.ini
432
%{_sysconfdir}/usb-moded/run/diag-adb-prepare.ini
433
434
435
436
437
%files acm-mode-android
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/android_acm.ini
438
439
440
%files developer-mode-android
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/developer_mode-android.ini
441
%{_sysconfdir}/usb-moded/run/udhcpd-developer-mode.ini
442
443
444
445
%files adb-mode
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/adb_mode.ini
446
447
%{_sysconfdir}/usb-moded/run/adb-startserver.ini
%{_sysconfdir}/usb-moded/run/adb-prepare.ini
448
%{_sysconfdir}/usb-moded/run/udhcpd-adb-mode.ini
449
450
451
/lib/systemd/system/adbd-prepare.service
/lib/systemd/system/graphical.target.wants/adbd-prepare.service
/usr/sbin/adbd-functionfs.sh
452
453
454
455
456
%files mtp-mode-android
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/mtp_mode-android.ini
457
458
459
460
%files mtp-mode-android-ffs
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/mtp_mode-android-ffs.ini
461
462
463
464
%files pc-suite-mode-android
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/pc_suite-android.ini
465
466
467
468
%files at-mode-android
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/android_at.ini
469
%files defaults
470
471
%defattr(-,root,root,-)
472
%files defaults-android
473
474
%defattr(-,root,root,-)
475
%files diagnostics-config
476
%defattr(-,root,root,-)
477
478
%dir %{_sysconfdir}/usb-moded/diag
%dir %{_sysconfdir}/usb-moded/run-diag
479
%{_sysconfdir}/usb-moded/diag/qa_diagnostic_mode.ini
480
%{_sysconfdir}/usb-moded/run-diag/qa-diagnostic.ini
481
482
483
%files connection-sharing-android-config
%defattr(-,root,root,-)
484
485
486
%{_sysconfdir}/usb-moded/dyn-modes/connection_sharing.ini
%{_sysconfdir}/usb-moded/run/udhcpd-connection-sharing.ini
487
488
489
490
%files connection-sharing-android-connman-config
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/connection_sharing-android-connman.ini
491
492
493
494
%files mass-storage-android-config
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/mass_storage_android.ini
%{_sysconfdir}/usb-moded/mass-storage-jolla.ini
495
496
497
498
499
500
%files vfat-android-config
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/vfat_android.ini
%{_sysconfdir}/usb-moded/run/vfat.ini
501
502
503
%files host-mode-jolla
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/host_mode_jolla.ini
504
505
506
507
508
509
510
%files systemd-rescue-mode
%defattr(-,root,root,-)
/var/lib/environment/usb-moded/usb-moded-args.conf
%{_bindir}/turn-usb-rescue-mode-off
/lib/systemd/system/usb-rescue-mode-off.service
/lib/systemd/system/graphical.target.wants/usb-rescue-mode-off.service