90308f2ec973ba82f0c21c11a1e55d44d6341f11
[platform/core/multimedia/media-server.git] / packaging / media-server.spec
1 Name:       media-server
2 Summary:    A server for media content management
3 Version:    0.3.48
4 Release:    0
5 Group:      Multimedia/Service
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1:    media-server.service
9 Source2:        media-server-user.service
10 Source3:    media-server-user.path
11 Source4:    media-server.path
12 Source5:    500.media-server.upgrade.sh
13 Source1001:     %{name}.manifest
14 Source1002:     libmedia-utils.manifest
15 Source1003:     libmedia-utils-devel.manifest
16 Requires(post): /usr/bin/buxton2ctl
17 BuildRequires:  pkgconfig(glib-2.0)
18 BuildRequires:  pkgconfig(vconf)
19 BuildRequires:  pkgconfig(dlog)
20 BuildRequires:  pkgconfig(aul)
21 BuildRequires:  pkgconfig(deviced)
22 BuildRequires:  pkgconfig(dbus-glib-1)
23 BuildRequires:  pkgconfig(sqlite3)
24 BuildRequires:  pkgconfig(db-util)
25 BuildRequires:  pkgconfig(notification)
26 BuildRequires:  pkgconfig(iniparser)
27 BuildRequires:  pkgconfig(libsmack)
28 BuildRequires:  pkgconfig(libsystemd-login)
29 BuildRequires:  pkgconfig(libtzplatform-config)
30 BuildRequires:  pkgconfig(cynara-client)
31 BuildRequires:  pkgconfig(cynara-session)
32 BuildRequires:  pkgconfig(capi-system-info)
33 BuildRequires:  gettext-tools
34
35 %if "%{tizen_profile_name}" == "tv"
36 BuildRequires:  pkgconfig(capi-system-usbdevice)
37 BuildRequires:  pkgconfig(power-defs)
38 BuildRequires:  pkgconfig(capi-system-power-tv)
39 %define product_tv 1
40 %else
41 %define product_tv 0
42 %endif
43 Provides:       %{name}-profile_common = %{version}-%{release}
44 Provides:       %{name}-profile_wearable = %{version}-%{release}
45 Provides:       %{name}-profile_tv = %{version}-%{release}
46 Provides:       %{name}-profile_ivi = %{version}-%{release}
47
48 %define upgrade_script_path /usr/share/upgrade/scripts
49
50 %description
51 Description: A server for media content management.
52
53 %package service-extension
54 Summary:       media-server service extension for Tizen mobile profile
55 Requires:      %{name} = %{version}-%{release}
56 Provides:      %{name}-profile_mobile = %{version}-%{release}
57 %description service-extension
58 Media-server's modified service files for mobile profile.
59 Note that this package overwrites some of %{name} and you need to
60 reinstall %{name} if you want to keep using %{name} after uninstalling this.
61
62 %package -n libmedia-utils
63 Summary:   The media server runtime library
64 Group:     Multimedia/Libraries
65 Requires:  media-server = %{version}-%{release}
66
67 %description -n libmedia-utils
68 Description : The media server runtime library.
69
70 %package -n libmedia-utils-devel
71 Summary:   The media server runtime library (development)
72 Group:     Multimedia/Development
73 Requires:  libmedia-utils = %{version}-%{release}
74 Requires:  libtzplatform-config-devel
75
76 %description -n libmedia-utils-devel
77 Description: The media server runtime library. (Development files included)
78
79 %prep
80 %setup -q
81 cp %{SOURCE1001} %{SOURCE1002} %{SOURCE1003} .
82 cp po/* .
83
84 %build
85 %if "%{asan}" == "1"
86 %restore_fcommon
87 %endif
88 %if 0%{?product_tv}
89 export CFLAGS="$CFLAGS -D_USE_SENIOR_MODE -D_USE_RECORDED_CONTENT -D_USE_SUSPEND_MODE -D_SET_VIP_PROCESS"
90 %else
91 export CFLAGS="$CFLAGS -D_USE_MULTI_USER -D_USE_META_UPDATE -D_USE_DEVICED_DBUS"
92 %endif
93 export CFLAGS="$CFLAGS -D_GNU_SOURCE -DTIZEN_DEBUG_ENABLE -DSYSCONFDIR=\\\"%{_sysconfdir}\\\""
94 export CFLAGS+=" -DPATH_LIBDIR=\\\"%{_libdir}\\\""
95 rm -rf autom4te.cache
96 rm -f aclocal.m4 ltmain.sh
97 mkdir -p m4
98 %reconfigure --prefix=%{_prefix} \
99 %if 0%{?product_tv}
100         --enable-product-tv \
101 %else
102         --disable-product-tv \
103 %endif
104         --disable-static
105 %__make %{?jobs:-j%jobs}
106
107 #install .po files
108 /usr/bin/msgfmt -o ar.mo ar.po
109 /usr/bin/msgfmt -o az.mo az.po
110 /usr/bin/msgfmt -o bg.mo bg.po
111 /usr/bin/msgfmt -o ca.mo ca.po
112 /usr/bin/msgfmt -o cs.mo cs.po
113 /usr/bin/msgfmt -o da.mo da.po
114 /usr/bin/msgfmt -o el_GR.mo el_GR.po
115 /usr/bin/msgfmt -o en.mo en.po
116 /usr/bin/msgfmt -o en_PH.mo en_PH.po
117 /usr/bin/msgfmt -o en_US.mo en_US.po
118 /usr/bin/msgfmt -o es_ES.mo es_ES.po
119 /usr/bin/msgfmt -o et.mo et.po
120 /usr/bin/msgfmt -o eu.mo eu.po
121 /usr/bin/msgfmt -o fi.mo fi.po
122 /usr/bin/msgfmt -o fr_CA.mo fr_CA.po
123 /usr/bin/msgfmt -o ga.mo ga.po
124 /usr/bin/msgfmt -o gl.mo gl.po
125 /usr/bin/msgfmt -o hi.mo hi.po
126 /usr/bin/msgfmt -o hr.mo hr.po
127 /usr/bin/msgfmt -o hu.mo hu.po
128 /usr/bin/msgfmt -o hy.mo hy.po
129 /usr/bin/msgfmt -o is.mo is.po
130 /usr/bin/msgfmt -o it_IT.mo it_IT.po
131 /usr/bin/msgfmt -o ja_JP.mo ja_JP.po
132 /usr/bin/msgfmt -o ka.mo ka.po
133 /usr/bin/msgfmt -o kk.mo kk.po
134 /usr/bin/msgfmt -o ko_KR.mo ko_KR.po
135 /usr/bin/msgfmt -o lt.mo lt.po
136 /usr/bin/msgfmt -o lv.mo lv.po
137 /usr/bin/msgfmt -o mk.mo mk.po
138 /usr/bin/msgfmt -o nb.mo nb.po
139 /usr/bin/msgfmt -o pl.mo pl.po
140 /usr/bin/msgfmt -o pt_BR.mo pt_BR.po
141 /usr/bin/msgfmt -o pt_PT.mo pt_PT.po
142 /usr/bin/msgfmt -o ro.mo ro.po
143 /usr/bin/msgfmt -o ru_RU.mo ru_RU.po
144 /usr/bin/msgfmt -o sk.mo sk.po
145 /usr/bin/msgfmt -o sl.mo sl.po
146 /usr/bin/msgfmt -o sr.mo sr.po
147 /usr/bin/msgfmt -o sv.mo sv.po
148 /usr/bin/msgfmt -o tr_TR.mo tr_TR.po
149 /usr/bin/msgfmt -o uk.mo uk.po
150 /usr/bin/msgfmt -o uz.mo uz.po
151 /usr/bin/msgfmt -o zh_CN.mo zh_CN.po
152 /usr/bin/msgfmt -o zh_HK.mo zh_HK.po
153 /usr/bin/msgfmt -o zh_TW.mo zh_TW.po
154
155 %install
156 rm -rf %{buildroot}
157
158 mkdir -p %{buildroot}%{_datadir}/locale/ar/LC_MESSAGES/
159 mkdir -p %{buildroot}%{_datadir}/locale/az/LC_MESSAGES/
160 mkdir -p %{buildroot}%{_datadir}/locale/bg/LC_MESSAGES/
161 mkdir -p %{buildroot}%{_datadir}/locale/ca/LC_MESSAGES/
162 mkdir -p %{buildroot}%{_datadir}/locale/cs/LC_MESSAGES/
163 mkdir -p %{buildroot}%{_datadir}/locale/da/LC_MESSAGES/
164 mkdir -p %{buildroot}%{_datadir}/locale/el_GR/LC_MESSAGES/
165 mkdir -p %{buildroot}%{_datadir}/locale/en/LC_MESSAGES/
166 mkdir -p %{buildroot}%{_datadir}/locale/en_PH/LC_MESSAGES/
167 mkdir -p %{buildroot}%{_datadir}/locale/en_US/LC_MESSAGES/
168 mkdir -p %{buildroot}%{_datadir}/locale/es_ES/LC_MESSAGES/
169 mkdir -p %{buildroot}%{_datadir}/locale/et/LC_MESSAGES/
170 mkdir -p %{buildroot}%{_datadir}/locale/eu/LC_MESSAGES/
171 mkdir -p %{buildroot}%{_datadir}/locale/fi/LC_MESSAGES/
172 mkdir -p %{buildroot}%{_datadir}/locale/fr_CA/LC_MESSAGES/
173 mkdir -p %{buildroot}%{_datadir}/locale/ga/LC_MESSAGES/
174 mkdir -p %{buildroot}%{_datadir}/locale/gl/LC_MESSAGES/
175 mkdir -p %{buildroot}%{_datadir}/locale/hi/LC_MESSAGES/
176 mkdir -p %{buildroot}%{_datadir}/locale/hr/LC_MESSAGES/
177 mkdir -p %{buildroot}%{_datadir}/locale/hu/LC_MESSAGES/
178 mkdir -p %{buildroot}%{_datadir}/locale/hy/LC_MESSAGES/
179 mkdir -p %{buildroot}%{_datadir}/locale/is/LC_MESSAGES/
180 mkdir -p %{buildroot}%{_datadir}/locale/it_IT/LC_MESSAGES/
181 mkdir -p %{buildroot}%{_datadir}/locale/ja_JP/LC_MESSAGES/
182 mkdir -p %{buildroot}%{_datadir}/locale/ka/LC_MESSAGES/
183 mkdir -p %{buildroot}%{_datadir}/locale/kk/LC_MESSAGES/
184 mkdir -p %{buildroot}%{_datadir}/locale/ko_KR/LC_MESSAGES/
185 mkdir -p %{buildroot}%{_datadir}/locale/lt/LC_MESSAGES/
186 mkdir -p %{buildroot}%{_datadir}/locale/lv/LC_MESSAGES/
187 mkdir -p %{buildroot}%{_datadir}/locale/mk/LC_MESSAGES/
188 mkdir -p %{buildroot}%{_datadir}/locale/nb/LC_MESSAGES/
189 mkdir -p %{buildroot}%{_datadir}/locale/pl/LC_MESSAGES/
190 mkdir -p %{buildroot}%{_datadir}/locale/pt_BR/LC_MESSAGES/
191 mkdir -p %{buildroot}%{_datadir}/locale/pt_PT/LC_MESSAGES/
192 mkdir -p %{buildroot}%{_datadir}/locale/ro/LC_MESSAGES/
193 mkdir -p %{buildroot}%{_datadir}/locale/ru_RU/LC_MESSAGES/
194 mkdir -p %{buildroot}%{_datadir}/locale/sk/LC_MESSAGES/
195 mkdir -p %{buildroot}%{_datadir}/locale/sl/LC_MESSAGES/
196 mkdir -p %{buildroot}%{_datadir}/locale/sr/LC_MESSAGES/
197 mkdir -p %{buildroot}%{_datadir}/locale/sv/LC_MESSAGES/
198 mkdir -p %{buildroot}%{_datadir}/locale/tr_TR/LC_MESSAGES/
199 mkdir -p %{buildroot}%{_datadir}/locale/uk/LC_MESSAGES/
200 mkdir -p %{buildroot}%{_datadir}/locale/uz/LC_MESSAGES/
201 mkdir -p %{buildroot}%{_datadir}/locale/zh_CN/LC_MESSAGES/
202 mkdir -p %{buildroot}%{_datadir}/locale/zh_HK/LC_MESSAGES/
203 mkdir -p %{buildroot}%{_datadir}/locale/zh_TW/LC_MESSAGES/
204
205 cp ar.mo %{buildroot}%{_datadir}/locale/ar/LC_MESSAGES/media_svr.mo
206 cp az.mo %{buildroot}%{_datadir}/locale/az/LC_MESSAGES/media_svr.mo
207 cp bg.mo %{buildroot}%{_datadir}/locale/bg/LC_MESSAGES/media_svr.mo
208 cp ca.mo %{buildroot}%{_datadir}/locale/ca/LC_MESSAGES/media_svr.mo
209 cp cs.mo %{buildroot}%{_datadir}/locale/cs/LC_MESSAGES/media_svr.mo
210 cp da.mo %{buildroot}%{_datadir}/locale/da/LC_MESSAGES/media_svr.mo
211 cp el_GR.mo %{buildroot}%{_datadir}/locale/el_GR/LC_MESSAGES/media_svr.mo
212 cp en.mo %{buildroot}%{_datadir}/locale/en/LC_MESSAGES/media_svr.mo
213 cp en_PH.mo %{buildroot}%{_datadir}/locale/en_PH/LC_MESSAGES/media_svr.mo
214 cp en_US.mo %{buildroot}%{_datadir}/locale/en_US/LC_MESSAGES/media_svr.mo
215 cp es_ES.mo %{buildroot}%{_datadir}/locale/es_ES/LC_MESSAGES/media_svr.mo
216 cp et.mo %{buildroot}%{_datadir}/locale/et/LC_MESSAGES/media_svr.mo
217 cp eu.mo %{buildroot}%{_datadir}/locale/eu/LC_MESSAGES/media_svr.mo
218 cp fi.mo %{buildroot}%{_datadir}/locale/fi/LC_MESSAGES/media_svr.mo
219 cp fr_CA.mo %{buildroot}%{_datadir}/locale/fr_CA/LC_MESSAGES/media_svr.mo
220 cp ga.mo %{buildroot}%{_datadir}/locale/ga/LC_MESSAGES/media_svr.mo
221 cp gl.mo %{buildroot}%{_datadir}/locale/gl/LC_MESSAGES/media_svr.mo
222 cp hi.mo %{buildroot}%{_datadir}/locale/hi/LC_MESSAGES/media_svr.mo
223 cp hr.mo %{buildroot}%{_datadir}/locale/hr/LC_MESSAGES/media_svr.mo
224 cp hu.mo %{buildroot}%{_datadir}/locale/hu/LC_MESSAGES/media_svr.mo
225 cp hy.mo %{buildroot}%{_datadir}/locale/hy/LC_MESSAGES/media_svr.mo
226 cp is.mo %{buildroot}%{_datadir}/locale/is/LC_MESSAGES/media_svr.mo
227 cp it_IT.mo %{buildroot}%{_datadir}/locale/it_IT/LC_MESSAGES/media_svr.mo
228 cp ja_JP.mo %{buildroot}%{_datadir}/locale/ja_JP/LC_MESSAGES/media_svr.mo
229 cp ka.mo %{buildroot}%{_datadir}/locale/ka/LC_MESSAGES/media_svr.mo
230 cp kk.mo %{buildroot}%{_datadir}/locale/kk/LC_MESSAGES/media_svr.mo
231 cp ko_KR.mo %{buildroot}%{_datadir}/locale/ko_KR/LC_MESSAGES/media_svr.mo
232 cp lt.mo %{buildroot}%{_datadir}/locale/lt/LC_MESSAGES/media_svr.mo
233 cp lv.mo %{buildroot}%{_datadir}/locale/lv/LC_MESSAGES/media_svr.mo
234 cp mk.mo %{buildroot}%{_datadir}/locale/mk/LC_MESSAGES/media_svr.mo
235 cp nb.mo %{buildroot}%{_datadir}/locale/nb/LC_MESSAGES/media_svr.mo
236 cp pl.mo %{buildroot}%{_datadir}/locale/pl/LC_MESSAGES/media_svr.mo
237 cp pt_BR.mo %{buildroot}%{_datadir}/locale/pt_BR/LC_MESSAGES/media_svr.mo
238 cp pt_PT.mo %{buildroot}%{_datadir}/locale/pt_PT/LC_MESSAGES/media_svr.mo
239 cp ro.mo %{buildroot}%{_datadir}/locale/ro/LC_MESSAGES/media_svr.mo
240 cp ru_RU.mo %{buildroot}%{_datadir}/locale/ru_RU/LC_MESSAGES/media_svr.mo
241 cp sk.mo %{buildroot}%{_datadir}/locale/sk/LC_MESSAGES/media_svr.mo
242 cp sl.mo %{buildroot}%{_datadir}/locale/sl/LC_MESSAGES/media_svr.mo
243 cp sr.mo %{buildroot}%{_datadir}/locale/sr/LC_MESSAGES/media_svr.mo
244 cp sv.mo %{buildroot}%{_datadir}/locale/sv/LC_MESSAGES/media_svr.mo
245 cp tr_TR.mo %{buildroot}%{_datadir}/locale/tr_TR/LC_MESSAGES/media_svr.mo
246 cp uk.mo %{buildroot}%{_datadir}/locale/uk/LC_MESSAGES/media_svr.mo
247 cp uz.mo %{buildroot}%{_datadir}/locale/uz/LC_MESSAGES/media_svr.mo
248 cp zh_CN.mo %{buildroot}%{_datadir}/locale/zh_CN/LC_MESSAGES/media_svr.mo
249 cp zh_HK.mo %{buildroot}%{_datadir}/locale/zh_HK/LC_MESSAGES/media_svr.mo
250 cp zh_TW.mo %{buildroot}%{_datadir}/locale/zh_TW/LC_MESSAGES/media_svr.mo
251
252 %make_install
253
254 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
255 install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/media-server.service
256 %if !0%{?product_tv}
257 mkdir -p %{buildroot}%{_unitdir_user}
258 install -m 644 %{SOURCE2} %{buildroot}%{_unitdir_user}/media-server-user.service
259 install -m 644 %{SOURCE3} %{buildroot}%{_unitdir_user}/media-server-user.path
260 %endif
261
262 # for mobile
263 install -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/media-server.path
264 # for non-mobile
265 ln -s ../media-server.service %{buildroot}%{_unitdir}/multi-user.target.wants/media-server.service
266
267 #ini file
268 mkdir -p %{buildroot}/etc/multimedia
269 %if 0%{?product_tv}
270 cp -rf %{_builddir}/%{name}-%{version}/media_content_config_product.ini %{buildroot}/etc/multimedia/media_content_config.ini
271 %else
272 cp -rf %{_builddir}/%{name}-%{version}/media_content_config.ini %{buildroot}/etc/multimedia/media_content_config.ini
273 %endif
274 cp -rf %{_builddir}/%{name}-%{version}/media-server-plugin %{buildroot}/etc/multimedia/media-server-plugin
275 mkdir -p %{buildroot}/etc/gumd/useradd.d
276 cp -rf %{_builddir}/%{name}-%{version}/30_media-server-add.post %{buildroot}/etc/gumd/useradd.d/30_media-server-add.post
277 #dummy db file for reset media DB
278 %if 0%{?product_tv}
279 cp -rf %{_builddir}/%{name}-%{version}/data/media_product.db %{buildroot}/etc/multimedia/.media.db
280 %else
281 cp -rf %{_builddir}/%{name}-%{version}/data/media.db %{buildroot}/etc/multimedia/.media.db
282 %endif
283
284 #OS Upgrade
285 mkdir -p %{buildroot}%{upgrade_script_path}
286 cp -f %{SOURCE5} %{buildroot}%{upgrade_script_path}
287
288 %post
289 # setup dbupdate in user session
290 mkdir -p %{_unitdir_user}/basic.target.wants/
291 ln -sf ../media-server-user.path  %{_unitdir_user}/basic.target.wants/
292
293 chmod 755 /etc/gumd/useradd.d/30_media-server-add.post
294 buxton2ctl -i -d create-int32 "system" "db/filemanager/dbupdate" "1" "http://tizen.org/privilege/internal/default/public" "http://tizen.org/privilege/internal/default/public"
295 buxton2ctl -i -d create-int32 "memory" "memory/filemanager/Mmc" "0" "http://tizen.org/privilege/internal/default/public" "http://tizen.org/privilege/internal/default/public"
296 buxton2ctl -i -d create-int32 "system" "db/private/extractstatus" "1" "http://tizen.org/privilege/internal/default/public" "http://tizen.org/privilege/internal/default/public"
297 buxton2ctl -i -d create-int32 "system" "file/private/mediaserver/scan_internal" "1" "http://tizen.org/privilege/internal/default/public" "http://tizen.org/privilege/internal/default/public"
298 buxton2ctl -i -d create-int32 "system" "file/private/mediaserver/scan_directory" "1" "http://tizen.org/privilege/internal/default/public" "http://tizen.org/privilege/internal/default/public"
299 buxton2ctl -i -d create-int32 "system" "file/private/mediaserver/db_limit" "0" "http://tizen.org/privilege/internal/default/public" "http://tizen.org/privilege/internal/default/public"
300 buxton2ctl -i -d create-int32 "system" "file/private/mediaserver/db_reset" "0" "http://tizen.org/privilege/internal/default/public" "http://tizen.org/privilege/internal/default/public"
301 buxton2ctl -i -d create-int32 "memory" "memory/private/mediaserver/server_status" "0" "http://tizen.org/privilege/internal/default/public" "http://tizen.org/privilege/internal/default/public"
302 buxton2ctl -i -d create-int32 "system" "db/mediascanner/poweroff_status" "0" "http://tizen.org/privilege/internal/default/public" "http://tizen.org/privilege/internal/default/public"
303
304 %post -n libmedia-utils -p /sbin/ldconfig
305
306 %postun -n libmedia-utils -p /sbin/ldconfig
307
308 %files
309 %manifest %{name}.manifest
310 %defattr(-,root,root,-)
311 %{_bindir}/media-server
312 %{_bindir}/media-scanner
313 %{_bindir}/media-scanner-v2
314 %{_bindir}/mediadb-update
315 %{_unitdir}/media-server.service
316 %{_unitdir}/multi-user.target.wants/media-server.service
317 %if !0%{?product_tv}
318 %{_unitdir_user}/media-server-user.service
319 %{_unitdir_user}/media-server-user.path
320 %endif
321 /etc/multimedia/media_content_config.ini
322 /etc/multimedia/media-server-plugin
323 /etc/gumd/useradd.d/30_media-server-add.post
324 /etc/multimedia/.media.db
325 %{_datadir}/locale/*/LC_MESSAGES/*
326 %license LICENSE.APLv2.0
327 %{upgrade_script_path}/500.media-server.upgrade.sh
328
329 %files -n libmedia-utils
330 %manifest libmedia-utils.manifest
331 %license LICENSE.APLv2.0
332 %defattr(-,root,root,-)
333 %{_libdir}/libmedia-utils.so.0
334 %{_libdir}/libmedia-utils.so.0.0.0
335
336 %files -n libmedia-utils-devel
337 %manifest libmedia-utils-devel.manifest
338 %defattr(-,root,root,-)
339 %{_libdir}/libmedia-utils.so
340 %{_libdir}/pkgconfig/libmedia-utils.pc
341 %{_includedir}/media-utils/*.h
342
343 %post service-extension
344 rm %{_unitdir}/multi-user.target.wants/media-server.service
345 ln -sf ../media-server.path  %{_unitdir}/multi-user.target.wants/
346 %preun service-extension
347 rm %{_unitdir}/multi-user.target.wants/media-server.path
348
349 %files service-extension
350 %{_unitdir}/media-server.path