/
usb-moded.spec
347 lines (280 loc) · 10.7 KB
/
usb-moded.spec
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
Name: usb-moded
Version: 0.70
Release: 0
Summary: USB mode controller
Group: System/System Control
License: LGPLv2
URL: https://github.com/nemomobile/usb-moded
Source0: %{name}-%{version}.tar.bz2
Source1: %{name}.service
Source2: usb_moded.conf
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(gconf-2.0)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(udev)
BuildRequires: pkgconfig(libkmod)
BuildRequires: doxygen
BuildRequires: GConf2
Requires: lsof
Requires: usb-moded-configs
Requires: usb-moded-diagnostics-config
Requires(post): GConf2
Requires(pre): GConf2
Requires(preun): GConf2
Requires(post): systemd
Requires(postun): systemd
%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.
%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
Requires: buteo-mtp
%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.
%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.
%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.
%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.
%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.
%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.
%package defaults
Summary: USB mode controller - default configuration
Group: Config
Provides: usb-moded-configs
Requires: usb-moded-developer-mode
%description defaults
This package provides the default configuration for usb-moded, so
basic functionality is provided (i.e. usb networking, ask and charging
modes)
%package defaults-android
Summary: USB mode controller - default configuration
Group: Config
Provides: usb-moded-configs
Requires: usb-moded-developer-mode-android
%description defaults-android
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)
%package diagnostics-config
Summary: USB mode controller - config data for diagnostics mode
Group: Config
%description diagnostics-config
This package contains the diagnostics info needed to configure a
diagnotic mode
%prep
%setup -q
%build
%autogen
%configure --enable-app-sync --enable-udev --enable-n900 --enable-meegodevlock
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
install -m 644 -D usb_moded.pc %{buildroot}/%{_libdir}/pkgconfig/usb_moded.pc
install -d %{buildroot}/%{_docdir}/%{name}/html/
install -m 644 docs/html/* %{buildroot}/%{_docdir}/%{name}/html/
install -m 644 -D debian/%{name}.schemas %{buildroot}/%{_sysconfdir}/gconf/schemas/%{name}.schemas
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
install -m 644 -D %{SOURCE2} %{buildroot}/%{_sysconfdir}/modprobe.d/usb_moded.conf
install -m 644 -D %{SOURCE1} %{buildroot}/lib/systemd/system/%{name}.service
install -d %{buildroot}/%{_sysconfdir}/usb-moded
install -d %{buildroot}/%{_sysconfdir}/usb-moded/run
install -d %{buildroot}/%{_sysconfdir}/usb-moded/dyn-modes
install -d %{buildroot}/%{_sysconfdir}/usb-moded/diag
install -m 644 -D config/dyn-modes/* %{buildroot}/%{_sysconfdir}/usb-moded/dyn-modes/
install -m 644 -D config/diag/* %{buildroot}/%{_sysconfdir}/usb-moded/diag/
install -m 644 -D config/run/* %{buildroot}/%{_sysconfdir}/usb-moded/run/
install -d $RPM_BUILD_ROOT/lib/systemd/system/basic.target.wants/
ln -s ../%{name}.service $RPM_BUILD_ROOT/lib/systemd/system/basic.target.wants/%{name}.service
# Sync mode not packaged for now.
rm %{buildroot}/etc/usb-moded/dyn-modes/sync_mode.ini
%pre
if [ "$1" -gt 1 ]; then
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-uninstall-rule \
%{_sysconfdir}/gconf/schemas/usb-moded.schemas \
> /dev/null || :
fi
%preun
if [ "$1" -eq 0 ]; then
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-uninstall-rule \
%{_sysconfdir}/gconf/schemas/usb-moded.schemas \
> /dev/null || :
fi
systemctl daemon-reload
%post
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule \
%{_sysconfdir}/gconf/schemas/usb-moded.schemas > /dev/null || :
systemctl daemon-reload
%files
%defattr(-,root,root,-)
%doc debian/copyright
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/usb_moded.conf
%config(noreplace) %{_sysconfdir}/gconf/schemas/%{name}.schemas
%config(noreplace) %{_sysconfdir}/modprobe.d/usb_moded.conf
%{_sbindir}/usb_moded
%{_sbindir}/usb_moded_util
%{_mandir}/man1/usb-moded.1.gz
/lib/systemd/system/%{name}.service
/lib/systemd/system/basic.target.wants/%{name}.service
%files devel
%defattr(-,root,root,-)
%doc debian/copyright
%{_includedir}/%{name}/*
%{_libdir}/pkgconfig/usb_moded.pc
%files doc
%defattr(-,root,root,-)
%doc debian/changelog debian/copyright LICENSE
%{_docdir}/%{name}/html/*
%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
%files diag-mode-android
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/diag_mode.ini
%{_sysconfdir}/usb-moded/run/adb-diag.ini
%files acm-mode-android
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/android_acm.ini
%files developer-mode-android
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/developer_mode-android.ini
%files adb-mode
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/adb_mode.ini
%{_sysconfdir}/usb-moded/run/adb.ini
%files mtp-mode-android
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/mtp_mode-android.ini
%files pc-suite-mode-android
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/pc_suite-android.ini
%files at-mode-android
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/dyn-modes/android_at.ini
%files defaults
%defattr(-,root,root,-)
%files defaults-android
%defattr(-,root,root,-)
%files diagnostics-config
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/diag/qa_diagnostic_mode.ini
%{_sysconfdir}/usb-moded/run/qa-diagnostic.ini