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