Change the return value to execute the dispatch only once when no instance
[platform/core/multimedia/mmsvc-core.git] / packaging / mused.spec
1 Name:       mused
2 Summary:    A multimedia daemon
3 Version:    0.3.135
4 Release:    0
5 Group:      System/Libraries
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1:    muse-server.service
9 Source2:    gtest.input
10 Source3:    muse-server-vd_product_tv.path
11 Source4:    muse-server-vd_product_tv.service
12 Source5:    muse-server-vd_product_audio.service
13 Source6:    %{name}.notstrip
14 BuildRequires: cmake
15 BuildRequires: pkgconfig(libsystemd)
16 BuildRequires: pkgconfig(capi-system-info)
17 BuildRequires: pkgconfig(capi-system-runtime-info)
18 BuildRequires: pkgconfig(cynara-client)
19 BuildRequires: pkgconfig(cynara-creds-socket)
20 BuildRequires: pkgconfig(cynara-session)
21 BuildRequires: pkgconfig(dlog)
22 BuildRequires: pkgconfig(gio-2.0)
23 BuildRequires: pkgconfig(glib-2.0)
24 BuildRequires: pkgconfig(gmodule-2.0)
25 BuildRequires: pkgconfig(gstreamer-1.0)
26 BuildRequires: pkgconfig(gstreamer-base-1.0)
27 BuildRequires: pkgconfig(iniparser)
28 BuildRequires: pkgconfig(json-c)
29 BuildRequires: pkgconfig(libtbm)
30 BuildRequires: pkgconfig(libtzplatform-config)
31 BuildRequires: pkgconfig(mm-common)
32 BuildRequires: pkgconfig(storage)
33 %if "%{tizen_profile_name}" == "tv"
34 BuildRequires: pkgconfig(libresourced)
35 BuildRequires: pkgconfig(lwipc)
36 BuildRequires: pkgconfig(ttrace)
37 %else
38 BuildRequires: pkgconfig(mm-resource-manager)
39 %endif
40 %if 0%{?gtests:1}
41 BuildRequires: pkgconfig(gmock)
42 %endif
43
44 Requires(post): /sbin/ldconfig
45 Requires(postun): /sbin/ldconfig
46 Requires: security-config
47
48 %description
49
50
51 %package devel
52 Summary:  A Media Daemon library in Tizen (Development)
53 Group:    Multimedia/Service
54 Requires: %{name} = %{version}-%{release}
55 %description devel
56
57 %prep
58 %setup -q
59
60 %build
61 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
62 export CFLAGS="$CFLAGS -DSYSCONFDIR=\\\"%{_sysconfdir}\\\""
63 export CXXFLAGS="$CXXFLAGS -DSYSCONFDIR=\\\"%{_sysconfdir}\\\""
64
65 %if 0%{?sec_build_binary_debug_enable}
66 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE -D_GNU_SOURCE"
67 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE -D_GNU_SOURCE"
68 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE -D_GNU_SOURCE"
69 %endif
70
71 %if 0%{?gcov:1}
72 export CFLAGS+=" -fprofile-arcs -ftest-coverage -DMUSE_GCOV_TEST "
73 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage -DMUSE_GCOV_TEST "
74 export LDFLAGS+=" -lgcov "
75 %endif
76
77 %if ("%{_vd_cfg_product_type}" == "AUDIO") || ("%{_vd_cfg_product_type}" == "TV") || ("%{_vd_cfg_product_type}" == "LFD") || ("%{_vd_cfg_product_type}" == "HTV") || ("%{_vd_cfg_product_type}" == "AV") || ("%{_vd_cfg_product_type}" == "IWB") || ("%{_vd_cfg_product_type}" == "WALL")
78 export CFLAGS+=" -DMUSE_REGISTER_VIP -DMUSE_USE_LWIPC -DMUSE_TTRACE_LOG"
79 %cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DLIBDIR=%{_libdir} -DTZ_SYS_DATA=%TZ_SYS_DATA -DMUSE_REGISTER_VIP=1 -DMUSE_TTRACE_LOG=1 -DMUSE_USE_LWIPC=1
80 %else
81 export CFLAGS+=" -DMUSE_USE_POWER_OFF_STATE_CHANGE -DMUSE_USE_EXTERNAL_STORAGE_STATE_CHANGE -DMUSE_USE_WATCHDOG"
82 %cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DLIBDIR=%{_libdir} -DTZ_SYS_DATA=%TZ_SYS_DATA -DMUSE_GTESTS_BUILD=%{?gtests:1}%{!?gtests:0}
83 %endif
84
85 make %{?jobs:-j%jobs}
86
87 %install
88 rm -rf %{buildroot}
89
90 %make_install
91
92 %if ("%{_vd_cfg_product_type}" == "AUDIO")
93 mkdir -p %{buildroot}%{_unitdir}/stater.target.wants
94 install -m 0644 %SOURCE5 %{buildroot}%{_unitdir}/muse-server.service
95 %install_service starter.target.wants muse-server.service
96
97 mkdir -p %{buildroot}%{_sysconfdir}/notstrip
98 install -m 0644 %SOURCE6 %{buildroot}%{_sysconfdir}/notstrip/%{name}.notstrip
99 %else
100 %if ("%{_vd_cfg_product_type}" == "TV") || ("%{_vd_cfg_product_type}" == "LFD") || ("%{_vd_cfg_product_type}" == "HTV") || ("%{_vd_cfg_product_type}" == "AV") || ("%{_vd_cfg_product_type}" == "IWB") || ("%{_vd_cfg_product_type}" == "WALL")
101 mkdir -p %{buildroot}%{_unitdir}/basic.target.wants
102 install -m 0644 %SOURCE4 %{buildroot}%{_unitdir}/muse-server.service
103 %install_service basic.target.wants muse-server.service
104
105 mkdir -p %{buildroot}%{_sysconfdir}/notstrip
106 install -m 0644 %SOURCE6 %{buildroot}%{_sysconfdir}/notstrip/%{name}.notstrip
107 install -m 0644 %SOURCE3 %{buildroot}%{_unitdir}/muse-server.path
108 %else
109 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
110 install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}/muse-server.service
111 %install_service multi-user.target.wants muse-server.service
112
113 %endif
114 %endif
115
116 mkdir -p %{buildroot}/var/log/%{name}
117 mkdir -p %{buildroot}%{TZ_SYS_DATA}/%{name}
118
119 %if 0%{?gtests:1}
120 install -m 0644 %SOURCE2 %{buildroot}%{TZ_SYS_DATA}/%{name}/gtest.input
121 %endif
122
123 %post
124 /sbin/ldconfig
125
126 chown multimedia_fw:multimedia_fw %{TZ_SYS_DATA}/%{name}
127 chown multimedia_fw:multimedia_fw /var/log/%{name}
128 chsmack -a "System::Shared" %{TZ_SYS_DATA}/%{name}
129 chsmack -a "System::Shared" /var/log/%{name}
130
131 %postun -p /sbin/ldconfig
132
133
134 %files
135 %manifest %{name}.manifest
136 %{_libdir}/libmuse-*.so.*
137 %license LICENSE.APLv2
138 %{_unitdir}/muse-server.service
139 %if ("%{_vd_cfg_product_type}" == "AUDIO")
140 %{_unitdir}/starter.target.wants/muse-server.service
141 %else
142 %if ("%{_vd_cfg_product_type}" == "TV") || ("%{_vd_cfg_product_type}" == "LFD") || ("%{_vd_cfg_product_type}" == "HTV") || ("%{_vd_cfg_product_type}" == "AV") || ("%{_vd_cfg_product_type}" == "IWB") || ("%{_vd_cfg_product_type}" == "WALL")
143 %{_unitdir}/basic.target.wants/muse-server.service
144 %else
145 %{_unitdir}/multi-user.target.wants/muse-server.service
146 %endif
147 %endif
148 %if ("%{_vd_cfg_product_type}" == "TV") || ("%{_vd_cfg_product_type}" == "LFD") || ("%{_vd_cfg_product_type}" == "HTV") || ("%{_vd_cfg_product_type}" == "AV") || ("%{_vd_cfg_product_type}" == "IWB") || ("%{_vd_cfg_product_type}" == "WALL")
149 %{_unitdir}/muse-server.path
150 %endif
151 %if ("%{_vd_cfg_product_type}" == "AUDIO") || ("%{_vd_cfg_product_type}" == "TV") || ("%{_vd_cfg_product_type}" == "LFD") || ("%{_vd_cfg_product_type}" == "HTV") || ("%{_vd_cfg_product_type}" == "AV") || ("%{_vd_cfg_product_type}" == "IWB") || ("%{_vd_cfg_product_type}" == "WALL")
152 %{_sysconfdir}/notstrip/%{name}.notstrip
153 %endif
154 %{TZ_SYS_DATA}/%{name}
155 /var/log/%{name}
156 %{_bindir}/*
157
158 %if 0%{?gtests:1}
159 %{TZ_SYS_DATA}/%{name}/gtest.input
160 %{_bindir}/gtest-muse-server
161 %endif
162
163 %files devel
164 %{_includedir}/media/*.h
165 %{_libdir}/pkgconfig/*.pc
166 %{_libdir}/*.so