Rearrange feedbackd.service from multi-user.target to delayed.target
[platform/core/system/feedbackd.git] / packaging / feedbackd.spec
1
2 #These options are DEACTIVATED by default.
3 %bcond_with wayland
4 %bcond_with emulator
5
6 Name:       feedbackd
7 Summary:    Feedbackd
8 Version:    1.0.0
9 Release:    1
10 Group:      System/Management
11 License:    Apache-2.0
12 Source0:    %{name}-%{version}.tar.gz
13 Source1:    feedbackd.manifest
14
15 BuildRequires:  cmake
16 BuildRequires:  pkgconfig(vconf)
17 BuildRequires:  pkgconfig(dlog)
18 BuildRequires:  pkgconfig(capi-base-common)
19 BuildRequires:  pkgconfig(gio-2.0)
20 BuildRequires:  pkgconfig(glib-2.0)
21 BuildRequires:  pkgconfig(gio-unix-2.0)
22 BuildRequires:  pkgconfig(capi-system-info)
23 BuildRequires:  pkgconfig(capi-system-peripheral-io)
24 BuildRequires:  pkgconfig(libsyscommon)
25 BuildRequires:  pkgconfig(libsystemd)
26 BuildRequires:  pkgconfig(capi-system-device)
27
28 Requires(post): /usr/bin/vconftool
29
30 Requires:       %{name}-compat = %{version}-%{release}
31 Recommends:     %{name}-driver-standard = %{version}-%{release}
32
33 Requires:       configuration-compat = %{version}-%{release}
34 Recommends:     %{name}-conf-level6 = %{version}-%{release}
35
36 %description
37 feedback daemon
38
39 %package feedbackd
40 Summary:    feedback daemon
41 Group:      main
42
43 %description feedbackd
44 feedback daemon.
45
46 # if driver = external or undefined
47 %package driver-external 
48 Summary:        Feedbackd binaries targeting external plugin
49 Provides:       %{name}-compat = %{version}-%{release}
50 Conflicts:      %{name}-driver-emulator
51 Conflicts:      %{name}-driver-gpio
52 Conflicts:      %{name}-driver-standard
53 Conflicts:      %{name}-driver-circle
54 %description driver-external
55 Feedbackd binaries with external plugin. Required by main feedbackd package
56 # if driver = emulator or undefined
57 %package driver-emulator 
58 Summary:        Feedbackd binaries targeting emulator plugin
59 Provides:       %{name}-compat = %{version}-%{release}
60 Conflicts:      %{name}-driver-external
61 Conflicts:      %{name}-driver-gpio
62 Conflicts:      %{name}-driver-standard
63 Conflicts:      %{name}-driver-circle
64 %description driver-emulator
65 Feedbackd binaries with emulator plugin. Required by main feedbackd package
66 # if driver = gpio or undefined
67 %package driver-gpio 
68 Summary:        Feedbackd binaries targeting gpio plugin
69 Provides:       %{name}-compat = %{version}-%{release}
70 Conflicts:      %{name}-driver-external
71 Conflicts:      %{name}-driver-emulator
72 Conflicts:      %{name}-driver-standard
73 Conflicts:      %{name}-driver-circle
74 %description driver-gpio
75 Feedbackd binaries with gpio plugin. Required by main feedbackd package
76 # if driver = standard or undefined
77 %package driver-standard
78 Summary:        Feedbackd binaries targeting emulator plugin
79 Provides:       %{name}-compat = %{version}-%{release}
80 Conflicts:      %{name}-driver-external
81 Conflicts:      %{name}-driver-emulator
82 Conflicts:      %{name}-driver-gpio
83 Conflicts:      %{name}-driver-circle
84 %description driver-standard
85 Feedbackd binaries with standard plugin. Required by main feedbackd package
86 # if driver = circle or undefined
87 %package driver-circle
88 Summary:        Feedbackd binaries targeting circle plugin
89 Provides:       %{name}-compat = %{version}-%{release}
90 Conflicts:      %{name}-driver-external
91 Conflicts:      %{name}-driver-emulator
92 Conflicts:      %{name}-driver-gpio
93 Conflicts:      %{name}-driver-standard
94 %description driver-circle
95 Feedbackd binaries with circle plugin. Required by main feedbackd package
96
97 %package conf-level3
98 Summary:        Feedbackd level configuration file
99 Provides:       configuration-compat = %{version}-%{release}
100 Conflicts:      %{name}-conf-level6
101 %description conf-level3
102 Feedbackd level configuration file. Required by main feedbackd package
103
104 %package conf-level6
105 Summary:        Feedbackd level configuration file
106 Provides:       configuration-compat = %{version}-%{release}
107 Conflicts:      %{name}-conf-level3
108 %description conf-level6
109 Feedbackd level configuration file. Required by main feedbackd package
110
111 %package auto-test
112 Summary:  Feedbackd auto test tool
113 Group:    System/Utilities
114 %description auto-test
115 Feedbackd helper programs.
116 This package can be installed optional for auto dbus test.
117
118 %prep
119 %setup -q
120
121 # Build per driver 
122 # if driver = external or undefined
123 mkdir -p build_external
124 pushd build_external
125 %cmake .. \
126         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
127         -DDRIVER=external \
128         #eol
129 popd
130
131 # if driver = emulator or undefined
132 mkdir -p build_emulator
133 pushd build_emulator
134 %cmake .. \
135         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
136         -DDRIVER=emulator \
137         #eol
138 popd
139
140 # if driver = gpio or undefined
141 mkdir -p build_gpio
142 pushd build_gpio
143 %cmake .. \
144         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
145         -DDRIVER=gpio \
146         #eol
147 popd
148
149 # if driver = standard or undefined
150 mkdir -p build_standard
151 pushd build_standard
152 %cmake .. \
153         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
154         -DDRIVER=standard \
155         #eol
156 popd
157
158 # if driver = circle or undefined
159 mkdir -p build_circle
160 pushd build_circle
161 %cmake .. \
162         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
163         -DDRIVER=circle \
164         #eol
165 popd
166
167 %build
168 cp %{SOURCE1} .
169
170 # Build per driver 
171 # if driver = external or undefined
172 pushd build_external
173 make %{?jobs:-j%jobs}
174 popd
175
176 # if driver = emulator or undefined
177 pushd build_emulator
178 make %{?jobs:-j%jobs}
179 popd
180
181 # if driver = gpio or undefined
182 pushd build_gpio
183 make %{?jobs:-j%jobs}
184 popd
185
186 # if driver = standard or undefined
187 pushd build_standard
188 make %{?jobs:-j%jobs}
189 popd
190
191 # if driver = circle or undefined
192 pushd build_circle
193 make %{?jobs:-j%jobs}
194 popd
195
196 %install
197 rm -rf %{buildroot}
198 # Build per driver
199 pushd build_external
200 %make_install
201 mv %{buildroot}%{_bindir}/feedbackd %{buildroot}%{_bindir}/feedbackd.external
202 popd
203
204 pushd build_emulator
205 %make_install
206 mv %{buildroot}%{_bindir}/feedbackd %{buildroot}%{_bindir}/feedbackd.emulator
207 popd
208
209 pushd build_gpio
210 %make_install
211 mv %{buildroot}%{_bindir}/feedbackd %{buildroot}%{_bindir}/feedbackd.gpio
212 popd
213
214 pushd build_standard
215 %make_install
216 mv %{buildroot}%{_bindir}/feedbackd %{buildroot}%{_bindir}/feedbackd.standard
217 popd
218
219 pushd build_circle
220 %make_install
221 mv %{buildroot}%{_bindir}/feedbackd %{buildroot}%{_bindir}/feedbackd.circle
222 popd
223
224 %install_service delayed.target.wants feedbackd.service
225
226 %post
227 systemctl daemon-reload
228 if [ "$1" == "1" ]; then
229     systemctl restart feedbackd.service
230 fi
231
232 %post driver-external
233 mv %{_bindir}/feedbackd.external %{_bindir}/feedbackd
234
235 %preun driver-external
236 mv %{_bindir}/feedbackd %{_bindir}/feedbackd.external
237
238 if [ "$1" == "0" ]; then
239     systemctl stop feedbackd.service
240 fi
241
242 %post driver-emulator
243 mv %{_bindir}/feedbackd.emulator %{_bindir}/feedbackd
244
245 %preun driver-emulator
246 mv %{_bindir}/feedbackd %{_bindir}/feedbackd.emulator
247
248 if [ "$1" == "0" ]; then
249     systemctl stop feedbackd.service
250 fi
251
252 %post driver-gpio
253 mv %{_bindir}/feedbackd.gpio %{_bindir}/feedbackd
254
255 %preun driver-gpio
256 mv %{_bindir}/feedbackd %{_bindir}/feedbackd.gpio
257
258 if [ "$1" == "0" ]; then
259     systemctl stop feedbackd.service
260 fi
261
262 %post driver-standard
263 mv %{_bindir}/feedbackd.standard %{_bindir}/feedbackd
264
265 %preun driver-standard
266 mv %{_bindir}/feedbackd %{_bindir}/feedbackd.standard
267
268 if [ "$1" == "0" ]; then
269     systemctl stop feedbackd.service
270 fi
271
272 %post driver-circle
273 mv %{_bindir}/feedbackd.circle %{_bindir}/feedbackd
274
275 %preun driver-circle
276 mv %{_bindir}/feedbackd %{_bindir}/feedbackd.circle
277
278 if [ "$1" == "0" ]; then
279     systemctl stop feedbackd.service
280 fi
281
282 %post conf-level3
283 mv %{_sysconfdir}/feedbackd/haptic-level3.conf %{_sysconfdir}/feedbackd/haptic.conf
284
285 %post conf-level6
286 mv %{_sysconfdir}/feedbackd/haptic-level6.conf %{_sysconfdir}/feedbackd/haptic.conf
287
288 %files -n feedbackd
289 %manifest %{name}.manifest
290 %license LICENSE.Apache-2.0
291 %config %{_sysconfdir}/dbus-1/system.d/feedbackd.conf
292 %{_unitdir}/feedbackd.service
293 %{_unitdir}/delayed.target.wants/feedbackd.service
294 %{_datadir}/dbus-1/system-services/org.tizen.system.vibrator.service
295
296 %files driver-external
297 %license LICENSE.Apache-2.0
298 %manifest %{name}.manifest
299 %{_bindir}/feedbackd.external
300
301 %files driver-emulator
302 %license LICENSE.Apache-2.0
303 %manifest %{name}.manifest
304 %{_bindir}/feedbackd.emulator
305
306 %files driver-gpio
307 %license LICENSE.Apache-2.0
308 %manifest %{name}.manifest
309 %{_bindir}/feedbackd.gpio
310
311 %files driver-standard
312 %license LICENSE.Apache-2.0
313 %manifest %{name}.manifest
314 %{_bindir}/feedbackd.standard
315
316 %files driver-circle
317 %license LICENSE.Apache-2.0
318 %manifest %{name}.manifest
319 %{_bindir}/feedbackd.circle
320
321 %files conf-level3
322 %license LICENSE.Apache-2.0
323 %manifest %{name}.manifest
324 %config %{_sysconfdir}/feedbackd/haptic-level3.conf
325
326 %files conf-level6
327 %license LICENSE.Apache-2.0
328 %manifest %{name}.manifest
329 %config %{_sysconfdir}/feedbackd/haptic-level6.conf
330
331 %files auto-test
332 %license LICENSE.Apache-2.0
333 %manifest %{name}.manifest
334 %{_bindir}/feedbackd-auto-test