Fix Coverity issues
[apps/native/ug-nfc-efl.git] / packaging / ug-nfc-efl.spec
1 Name:       ug-nfc-efl
2 Summary:    NFC Setting UI
3 Version:    3.1.9
4 Release:    0
5 Group:      App/Network
6 License:    Flora-1.1
7 Source0:    %{name}-%{version}.tar.gz
8
9
10 BuildRequires:  pkgconfig(ui-gadget-1)
11 BuildRequires:  pkgconfig(notification)
12 BuildRequires:  pkgconfig(capi-content-mime-type)
13 BuildRequires:  pkgconfig(capi-appfw-app-manager)
14 BuildRequires:  pkgconfig(sqlite3)
15
16 BuildRequires:  pkgconfig(glib-2.0)
17 BuildRequires:  pkgconfig(pkgmgr-info)
18 BuildRequires:  pkgconfig(syspopup)
19
20 BuildRequires:  pkgconfig(capi-network-nfc)
21 BuildRequires:  pkgconfig(capi-appfw-application)
22 BuildRequires:  pkgconfig(dlog)
23 BuildRequires:  pkgconfig(vconf)
24 BuildRequires:  pkgconfig(efl-extension)
25 BuildRequires:  pkgconfig(elementary)
26 BuildRequires:  cmake
27 BuildRequires:  edje-tools
28 BuildRequires:  gettext-tools
29 Requires(post): /sbin/ldconfig
30 Requires(postun): /sbin/ldconfig
31 Requires:       %{name}-compat = %{version}-%{release}
32 Recommends:     %{name}-profile_common = %{version}-%{release}
33
34 %description
35 NFC Setting UI
36
37 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
38 # if common || tv || ivi || "undefined"
39 %if "%{?profile}" != "wearable" && "%{?profile}" != "mobile"
40 %package profile_common
41 Summary:        NFC Setting UI for Common (+TV, +IVI)
42 Provides:       %{name}-compat = %{version}-%{release}
43 Provides:       %{name}-profile_tv = %{version}-%{release}
44 Provides:       %{name}-profile_ivi = %{version}-%{release}
45 Conflicts:      %{name}-profile_mobile
46 Conflicts:      %{name}-profile_wearable
47 Requires:       %{name}-resource_common
48 %description profile_common
49 NFC Setting UI for common profile. TV/IVI profile may share this if needed.
50 Note that as of 2016/10/07, TV/IVI do not include ug-nfc-efl.
51 But, for future usage, we assume that they will be based on this profile
52 if someone adds ug-nfc-efl for TV/IVI.
53 %endif
54
55 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
56 # if wearable || "undefined"
57 %if "%{?profile}" != "common" && "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
58 %package profile_wearable
59 Summary:        NFC Setting UI for Wearable
60 Provides:       %{name}-compat = %{version}-%{release}
61 Conflicts:      %{name}-profile_mobile
62 Conflicts:      %{name}-profile_common
63 %description profile_wearable
64 NFC Setting UI for wearable profile.
65 %endif
66
67 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
68 # if mobile || "undefined"
69 %if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
70 %package profile_mobile
71 Summary:        NFC Setting UI for Mobile
72 Provides:       %{name}-compat = %{version}-%{release}
73 Conflicts:      %{name}-profile_wearable
74 Conflicts:      %{name}-profile_common
75 Requires:       %{name}-resource_common
76 %description profile_mobile
77 NFC Setting UI for mobile profile.
78 Note that againve wearable, only the .so is different.
79 %endif
80
81 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
82 # if wearable || "undefined"
83 %if "%{?profile}" != "wearable"
84 %package resource_common
85 Summary:        NFC Setting UI Resource for Common/Mobile/TV/IVI
86 %description resource_common
87 Common resource files of common and mobile.
88 %endif
89
90 %prep
91 %setup -q
92
93 %build
94
95 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
96 # if mobile || "undefined"
97 %if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
98 # reinstall (ln -sf) /usr/ug/mobile to /usr/ug at post
99 mkdir -p mobile
100 pushd mobile
101
102 cmake .. -DCMAKE_INSTALL_PREFIX=/usr/ug/mobile -DTIZEN_MOBILE=1
103 make %{?jobs:-j%jobs}
104 %make_install
105
106 popd
107 mkdir -p mobile_ins
108 mv %{buildroot}/usr/ug/mobile/* mobile_ins/
109 %endif
110
111 mkdir -p common
112 pushd common
113
114 # reinstall (ln -sf) /usr/ug/common to /usr/ug at post
115 cmake .. -DCMAKE_INSTALL_PREFIX=/usr/ug/common -DTIZEN_COMMON=1
116 make %{?jobs:-j%jobs}
117 %make_install
118
119 popd
120 mkdir -p common_ins
121 mkdir -p common_ins/packages
122 mv %{buildroot}/usr/ug/common/* common_ins/
123 mv %{buildroot}/usr/share/packages/* common_ins/packages/
124
125 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
126 # if wearable || "undefined"
127 %if "%{?profile}" != "common" && "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
128 mkdir -p wearable
129 pushd wearable
130 cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix}/apps/org.tizen.nfc-setting-app/ -DTIZEN_WEARABLE=1
131 make %{?jobs:-j%jobs}
132 %make_install
133
134 popd
135 mkdir -p wearable_ins
136 mkdir -p wearable_ins/packages
137 mv %{buildroot}/%{_prefix}/apps/org.tizen.nfc-setting-app/* wearable_ins/
138 mv %{buildroot}/usr/share/packages/* wearable_ins/packages/
139 %endif
140
141 %install
142 mkdir -p %{buildroot}/usr/share/license
143 cp -af %{_builddir}/%{name}-%{version}/LICENSE.Flora %{buildroot}/usr/share/license/
144
145 mkdir -p %{buildroot}/usr/share/packages
146 mv common_ins/packages/* %{buildroot}/usr/share/packages/
147 mv wearable_ins/packages/* %{buildroot}/usr/share/packages/
148
149 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
150 # if common || tv || ivi || "undefined"
151 %if "%{?profile}" != "wearable" && "%{?profile}" != "mobile"
152 mkdir -p %{buildroot}/usr/ug/common
153 mv common_ins/lib %{buildroot}/usr/ug/common/
154 %endif
155
156 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
157 # if mobile || "undefined"
158 %if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
159 mkdir -p %{buildroot}/usr/ug/mobile
160 mv mobile_ins/lib %{buildroot}/usr/ug/mobile/
161 %endif
162
163 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
164 # if common || mobile || tv || ivi || "undefined"
165 # resource from common == resource from mobile
166 %if "%{?profile}" != "wearable"
167 mv common_ins/res %{buildroot}/usr/ug/
168 %endif
169
170 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
171 # if wearable || "undefined"
172 %if "%{?profile}" != "common" && "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
173 mkdir -p %{buildroot}/%{_prefix}/apps/org.tizen.nfc-setting-app
174 mv wearable_ins/* %{buildroot}/%{_prefix}/apps/org.tizen.nfc-setting-app/
175 %endif
176
177 %post
178 /sbin/ldconfig
179
180 %postun -p /sbin/ldconfig
181
182 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
183 # if common || tv || ivi || "undefined"
184 %if "%{?profile}" != "wearable" && "%{?profile}" != "mobile"
185 %post profile_common
186 mkdir -p /usr/ug/bin/
187 ln -sf /usr/bin/ug-client /usr/ug/bin/ug-nfc-efl
188 mkdir -p /usr/ug/lib
189 ln -sf /usr/ug/common/lib/libug-nfc-efl* /usr/ug/lib/
190
191 %preun profile_common
192 rm /usr/ug/lib/libug-nfc-efl*
193 %endif
194
195 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
196 # if mobile || "undefined"
197 %if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
198 %post profile_mobile
199 mkdir -p /usr/ug/bin/
200 ln -sf /usr/bin/ug-client /usr/ug/bin/ug-nfc-efl
201 mkdir -p /usr/ug/lib
202 ln -sf /usr/ug/mobile/lib/libug-nfc-efl* /usr/ug/lib/
203
204 %preun profile_mobile
205 rm /usr/ug/lib/libug-nfc-efl*
206 %endif
207
208 %files
209 %defattr(-,root,root,-)
210 %{_datadir}/license/LICENSE.Flora
211
212 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
213 # if common || tv || ivi || "undefined"
214 %if "%{?profile}" != "wearable" && "%{?profile}" != "mobile"
215 %files profile_common
216 /usr/ug/common/lib/*
217 %{_datadir}/packages/ug-nfc-efl.xml
218 %endif
219
220 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
221 # if mobile || "undefined"
222 %if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
223 %files profile_mobile
224 /usr/ug/mobile/lib/*
225 %{_datadir}/packages/ug-nfc-efl.xml
226 %endif
227
228 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
229 # if wearable || "undefined"
230 %if "%{?profile}" != "common" && "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
231 %files profile_wearable
232 %{_prefix}/apps/org.tizen.nfc-setting-app/*
233 %{_datadir}/packages/org.tizen.nfc-setting-app.xml
234 %endif
235
236 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
237 # if common || mobile || tv || ivi || "undefined"
238 %if "%{?profile}" != "wearable"
239 %files resource_common
240 /usr/ug/res/*
241 %endif