refactoring by removing '-e' options to remove keys forcefully
[platform/core/appfw/vconf-internal-keys.git] / packaging / vconf-internal-keys.spec
1 Name:       vconf-internal-keys
2 Summary:    Internal shared keys for vconf
3 Version:    0.0.159
4 Release:    0
5 Group:      Application Framework/Configuration
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 BuildRequires:  cmake
9 BuildRequires:  xsltproc
10 BuildRequires:  libxml2-tools
11 Requires:  vconf
12 Requires:  coreutils
13 Requires: tizen-platform-config
14 Requires: tizen-platform-config-tools
15
16 #Requires:  findutils
17 Requires:  vconf-internal-keys-config
18
19 Requires(post): /sbin/ldconfig
20 Requires(postun): /sbin/ldconfig
21
22 %description
23 configuration internal shared keys
24
25 %package devel
26 Summary:    Vconf internal keys (devel)
27 Group:      Application Framework/Configuration
28 Requires:  pkgconfig(capi-base-common)
29
30 %description devel
31 Vconf internal key header files (devel)
32
33 %package config-profile_mobile
34 Summary:    Configure vconf internal shared keys for mobile
35 Group:      Application Framework/Configuration
36 Provides:   vconf-internal-keys-config
37
38 %description config-profile_mobile
39 The vconf-internal-keys configurator for mobile.
40 Vconf-internal-keys requires one of config-profile_* packages
41 installed to execute vconf configuration for buxton2.
42
43 %package config-profile_common
44 Summary:    Configure vconf internal shared keys for common
45 Group:      Application Framework/Configuration
46 Provides:   vconf-internal-keys-config
47
48 %description config-profile_common
49 The vconf-internal-keys configurator for common
50 Vconf-internal-keys requires one of config-profile_* packages
51 installed to execute vconf configuration for buxton2.
52
53 %package config-profile_tv
54 Summary:    Configure vconf internal shared keys for tv
55 Group:      Application Framework/Configuration
56 Provides:   vconf-internal-keys-config
57
58 %description config-profile_tv
59 The vconf-internal-keys configurator for tv
60 Vconf-internal-keys requires one of config-profile_* packages
61 installed to execute vconf configuration for buxton2.
62
63 %package config-profile_wearable
64 Summary:    Configure vconf internal shared keys for wearable
65 Group:      Application Framework/Configuration
66 Provides:   vconf-internal-keys-config
67
68 %description config-profile_wearable
69 The vconf-internal-keys configurator for wearable
70 Vconf-internal-keys requires one of config-profile_* packages
71 installed to execute vconf configuration for buxton2.
72
73 %package config-profile_ivi
74 Summary:    Configure vconf internal shared keys for ivi
75 Group:      Application Framework/Configuration
76 Provides:   vconf-internal-keys-config
77
78 %description config-profile_ivi
79 The vconf-internal-keys configurator for ivi
80 Vconf-internal-keys requires one of config-profile_* packages
81 installed to execute vconf configuration for buxton2.
82
83 %prep
84 %setup -q -n %{name}-%{version}
85
86 %build
87
88 make check
89
90 mkdir -p scripts_mobile
91 mkdir -p scripts_common
92 mkdir -p scripts_tv
93 mkdir -p scripts_wearable
94 mkdir -p scripts_ivi
95
96 %ifarch %arm aarch64
97 make model=mobile
98 awk '{ if ($5 == "\"memory\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_memory.txt
99 awk '{ if ($5 == "\"system\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_system.txt
100 cp scripts/*.sh scripts_mobile/
101 cp remove_keys.sh scripts_mobile/
102 cp scripts/*.txt scripts_mobile/
103 make clean
104 make model=tv
105 awk '{ if ($5 == "\"memory\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_memory.txt
106 awk '{ if ($5 == "\"system\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_system.txt
107 cp scripts/*.sh scripts_tv/
108 cp remove_keys.sh scripts_tv/
109 cp scripts/*.txt scripts_tv/
110 make clean
111 make model=wearable
112 awk '{ if ($5 == "\"memory\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_memory.txt
113 awk '{ if ($5 == "\"system\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_system.txt
114 cp scripts/*.sh scripts_wearable/
115 cp remove_keys.sh scripts_wearable/
116 cp scripts/*.txt scripts_wearable/
117 make clean
118 make model=ivi
119 awk '{ if ($5 == "\"memory\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_memory.txt
120 awk '{ if ($5 == "\"system\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_system.txt
121 cp scripts/*.sh scripts_ivi/
122 cp remove_keys.sh scripts_ivi/
123 cp scripts/*.txt scripts_ivi/
124 make clean
125 make model=common
126 awk '{ if ($5 == "\"memory\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_memory.txt
127 awk '{ if ($5 == "\"system\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_system.txt
128 cp scripts/*.sh scripts_common/
129 cp remove_keys.sh scripts_common/
130 cp scripts/*.txt scripts_common/
131
132 %else
133 make model=mobile/emulator
134 awk '{ if ($5 == "\"memory\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_memory.txt
135 awk '{ if ($5 == "\"system\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_system.txt
136 cp scripts/*.sh scripts_mobile/
137 cp remove_keys.sh scripts_mobile/
138 cp scripts/*.txt scripts_mobile/
139 make clean
140 make model=tv/emulator
141 awk '{ if ($5 == "\"memory\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_memory.txt
142 awk '{ if ($5 == "\"system\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_system.txt
143 cp scripts/*.sh scripts_tv/
144 cp remove_keys.sh scripts_tv/
145 cp scripts/*.txt scripts_tv/
146 make clean
147 make model=wearable/emulator
148 awk '{ if ($5 == "\"memory\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_memory.txt
149 awk '{ if ($5 == "\"system\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_system.txt
150 cp scripts/*.sh scripts_wearable/
151 cp remove_keys.sh scripts_wearable/
152 cp scripts/*.txt scripts_wearable/
153 make clean
154 make model=ivi/emulator
155 awk '{ if ($5 == "\"memory\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_memory.txt
156 awk '{ if ($5 == "\"system\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_system.txt
157 cp scripts/*.sh scripts_ivi/
158 cp remove_keys.sh scripts_ivi/
159 cp scripts/*.txt scripts_ivi/
160 make clean
161 make model=common/emulator
162 awk '{ if ($5 == "\"memory\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_memory.txt
163 awk '{ if ($5 == "\"system\"" ) print $LR }' ./scripts/all.sh | awk '{ print $6}' | sed -e 's/^"//' -e 's/"$//' | sort > ./scripts/vk_system.txt
164 cp scripts/*.sh scripts_common/
165 cp remove_keys.sh scripts_common/
166 cp scripts/*.txt scripts_common/
167 %endif
168
169 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
170 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DCMAKE_LIBDIR=%{_libdir}
171
172 make %{?jobs:-j%jobs}
173
174 %install
175 rm -rf %{buildroot}
176
177 mkdir -p %{buildroot}
178 mkdir -p %{buildroot}/opt/usr
179 mkdir -p %{buildroot}/opt/usr/vconf-internal-keys_scripts_mobile
180 mkdir -p %{buildroot}/opt/usr/vconf-internal-keys_scripts_common
181 mkdir -p %{buildroot}/opt/usr/vconf-internal-keys_scripts_tv
182 mkdir -p %{buildroot}/opt/usr/vconf-internal-keys_scripts_wearable
183 mkdir -p %{buildroot}/opt/usr/vconf-internal-keys_scripts_ivi
184 install -m 755 scripts_mobile/*.sh %{buildroot}/opt/usr/vconf-internal-keys_scripts_mobile
185 install scripts_mobile/*.txt %{buildroot}/opt/usr/vconf-internal-keys_scripts_mobile
186 install -m 755 scripts_tv/*.sh %{buildroot}/opt/usr/vconf-internal-keys_scripts_tv
187 install scripts_tv/*.txt %{buildroot}/opt/usr/vconf-internal-keys_scripts_tv
188 install -m 755 scripts_common/*.sh %{buildroot}/opt/usr/vconf-internal-keys_scripts_common
189 install scripts_common/*.txt %{buildroot}/opt/usr/vconf-internal-keys_scripts_common
190 install -m 755 scripts_wearable/*.sh %{buildroot}/opt/usr/vconf-internal-keys_scripts_wearable
191 install scripts_wearable/*.txt %{buildroot}/opt/usr/vconf-internal-keys_scripts_wearable
192 install -m 755 scripts_ivi/*.sh %{buildroot}/opt/usr/vconf-internal-keys_scripts_ivi
193 install scripts_ivi/*.txt %{buildroot}/opt/usr/vconf-internal-keys_scripts_ivi
194
195 mkdir -p %{buildroot}/usr/include/vconf
196 install -m 644 include/*.h %{buildroot}/usr/include/vconf
197
198 %make_install
199
200 %post
201 /sbin/ldconfig
202
203 TMP=/opt/.installing_vconf_internal_keys
204 TMP_AFTER=/opt/.runtime_vconf_internal_keys
205
206 touch $TMP
207
208 filelist=("/opt/usr/all.sh")
209 for file in ${filelist[@]} ; do
210         echo "running ---------------------------------------------------- $file"
211         if [ -e $file ]
212         then
213                 chmod a+x $file
214                 . $file
215                 rm $file
216         fi
217 done
218
219 #filelist=`find /opt/usr -name "vconf-internal-*.sh"`
220 filelist=`ls /opt/usr/vconf-internal-*.sh`
221 for file in $filelist
222 do
223 chmod a+x  $file
224 #/bin/sh $file
225 echo "running ---------------------------------------------------- $file"
226 . $file
227 rm $file
228 done
229
230 rm $TMP
231
232 %postun -p /sbin/ldconfig
233
234 %post config-profile_mobile
235 cp /opt/usr/vconf-internal-keys_scripts_mobile/*.sh /opt/usr/
236 cp /opt/usr/vconf-internal-keys_scripts_mobile/*.txt /opt/usr/
237 rm -rf /opt/usr/vconf-internal-keys_scripts_mobile
238
239 %post config-profile_common
240 cp /opt/usr/vconf-internal-keys_scripts_common/*.sh /opt/usr/
241 cp /opt/usr/vconf-internal-keys_scripts_common/*.txt /opt/usr/
242 rm -rf /opt/usr/vconf-internal-keys_scripts_common
243
244 %post config-profile_tv
245 cp /opt/usr/vconf-internal-keys_scripts_tv/*.sh /opt/usr/
246 cp /opt/usr/vconf-internal-keys_scripts_tv/*.txt /opt/usr/
247 rm -rf /opt/usr/vconf-internal-keys_scripts_tv
248
249 %post config-profile_wearable
250 cp /opt/usr/vconf-internal-keys_scripts_wearable/*.sh /opt/usr/
251 cp /opt/usr/vconf-internal-keys_scripts_wearable/*.txt /opt/usr/
252 rm -rf /opt/usr/vconf-internal-keys_scripts_wearable
253
254 %post config-profile_ivi
255 cp /opt/usr/vconf-internal-keys_scripts_ivi/*.sh /opt/usr/
256 cp /opt/usr/vconf-internal-keys_scripts_ivi/*.txt /opt/usr/
257 rm -rf /opt/usr/vconf-internal-keys_scripts_ivi
258
259 %posttrans config-profile_mobile
260 TMP_AFTER=/opt/.runtime_vconf_internal_keys
261 echo "running -------------------- ENABLE remove_keys.sh"
262 . /opt/usr/remove_keys.sh
263 touch $TMP_AFTER
264
265 %posttrans config-profile_common
266 TMP_AFTER=/opt/.runtime_vconf_internal_keys
267 echo "running -------------------- ENABLE remove_keys.sh"
268 . /opt/usr/remove_keys.sh
269 touch $TMP_AFTER
270
271 %posttrans config-profile_tv
272 TMP_AFTER=/opt/.runtime_vconf_internal_keys
273 echo "running -------------------- ENABLE remove_keys.sh"
274 . /opt/usr/remove_keys.sh
275 touch $TMP_AFTER
276
277 %posttrans config-profile_wearable
278 TMP_AFTER=/opt/.runtime_vconf_internal_keys
279 echo "running -------------------- ENABLE remove_keys.sh"
280 . /opt/usr/remove_keys.sh
281 touch $TMP_AFTER
282
283 %posttrans config-profile_ivi
284 TMP_AFTER=/opt/.runtime_vconf_internal_keys
285 echo "running -------------------- ENABLE remove_keys.sh"
286 . /opt/usr/remove_keys.sh
287 touch $TMP_AFTER
288
289 %files
290 %license LICENSE
291
292 %files devel
293 %defattr(-,root,root,-)
294 /usr/include/vconf/*.h
295 %{_libdir}/pkgconfig/*.pc
296
297 %files config-profile_mobile
298 /opt/usr/vconf-internal-keys_scripts_mobile/*.sh
299 /opt/usr/vconf-internal-keys_scripts_mobile/*.txt
300 %license LICENSE
301
302 %files config-profile_common
303 /opt/usr/vconf-internal-keys_scripts_common/*.sh
304 /opt/usr/vconf-internal-keys_scripts_common/*.txt
305 %license LICENSE
306
307 %files config-profile_wearable
308 /opt/usr/vconf-internal-keys_scripts_wearable/*.sh
309 /opt/usr/vconf-internal-keys_scripts_wearable/*.txt
310 %license LICENSE
311
312 %files config-profile_tv
313 /opt/usr/vconf-internal-keys_scripts_tv/*.sh
314 /opt/usr/vconf-internal-keys_scripts_tv/*.txt
315 %license LICENSE
316
317 %files config-profile_ivi
318 /opt/usr/vconf-internal-keys_scripts_ivi/*.sh
319 /opt/usr/vconf-internal-keys_scripts_ivi/*.txt
320 %license LICENSE