Release version 0.33.2
[platform/core/appfw/aul-1.git] / packaging / aul.spec
1 Name:       aul
2 Summary:    App utility library
3 Version:    0.33.2
4 Release:    1
5 Group:      Application Framework/Libraries
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001: %{name}.manifest
9 Source1002: %{name}-server.manifest
10
11 Requires(post):   /sbin/ldconfig
12 Requires(post):   /usr/bin/systemctl
13 Requires(postun): /sbin/ldconfig
14 Requires(postun): /usr/bin/systemctl
15 Requires(preun):  /usr/bin/systemctl
16 Requires:   tizen-platform-config
17
18 BuildRequires:  cmake
19 BuildRequires:  pkgconfig(gio-2.0)
20 BuildRequires:  pkgconfig(glib-2.0)
21 BuildRequires:  pkgconfig(bundle)
22 BuildRequires:  pkgconfig(dlog)
23 BuildRequires:  xdgmime-devel, pkgconfig(xdgmime)
24 BuildRequires:  pkgconfig(vconf)
25 BuildRequires:  pkgconfig(pkgmgr-info)
26 BuildRequires:  libattr-devel
27 BuildRequires:  pkgconfig(libtzplatform-config)
28 BuildRequires:  pkgconfig(capi-system-info)
29 BuildRequires:  pkgconfig(iniparser)
30 BuildRequires:  pkgconfig(sqlite3)
31 BuildRequires:  pkgconfig(storage)
32 BuildRequires:  pkgconfig(ttrace)
33 BuildRequires:  pkgconfig(pkgmgr-installer)
34 BuildRequires:  pkgconfig(libxml-2.0)
35 BuildRequires:  pkgconfig(uuid)
36 BuildRequires:  pkgconfig(libsmack)
37 BuildRequires:  pkgconfig(gmock)
38 BuildRequires:  pkgconfig(parcel)
39
40 %if 0%{?gcov:1}
41 BuildRequires:  lcov
42 BuildRequires:  zip
43 %endif
44
45 Recommends: amd
46 Recommends: amd-mod-component-manager
47 Recommends: amd-mod-watchdog
48
49 %description
50 Application utility library
51
52 %package devel
53 Summary:    App utility library (devel)
54 Group:      Development/Libraries
55 Requires:   %{name} = %{version}-%{release}
56
57 %description devel
58 Application utility library (devel)
59
60 %package test
61 Summary:    App utility test tools
62 Group:      Development/Libraries
63 Requires:   %{name} = %{version}-%{release}
64
65 %description test
66 Application utility library (test tools)
67
68 #################################################
69 # aul-gcov
70 #################################################
71 %if 0%{?gcov:1}
72 %package gcov
73 Summary:    AUL (gcov)
74 Group:      Application Framework/Testing
75
76 %description gcov
77 AUL gcov objects
78 %endif
79
80 #################################################
81 # aul-server
82 #################################################
83 %package server
84 Summary:    Application Utility Library (Server)
85 Group:      Development/Libraries
86
87 %description server
88 Application Utility Library (Server)
89
90 %package server-devel
91 Summary:    Application Utility Library (Server)
92 Group:      Development/Libraries
93 Requires:   %{name}-server = %{version}-%{release}
94
95 %description server-devel
96 Application Utility Library (devel)
97
98 %if "%{?_prelink_enable}" == "y"
99 %define tizen_feature_prelink 1
100 %else
101 %define tizen_feature_prelink 0
102 %endif
103
104 %define _aulresdir /opt/usr/home/owner/share/aul/res
105
106 %prep
107 %setup -q
108 sed -i 's|TZ_SYS_DB|%{TZ_SYS_DB}|g' %{SOURCE1001}
109 cp %{SOURCE1001} .
110 cp %{SOURCE1002} .
111
112 %build
113 %if 0%{?gcov:1}
114 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
115 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
116 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
117 export LDFLAGS+=" -lgcov"
118 %endif
119
120 %if 0%{?simulator}
121 CFLAGS="%{optflags} -D__emul__"; export CFLAGS
122 %endif
123
124 %if 0%{?tizen_feature_prelink}
125 _TIZEN_FEATURE_PRELINK=ON
126 %endif
127
128 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
129 %cmake -DFULLVER=%{version} \
130         -DMAJORVER=${MAJORVER} \
131         -D_TIZEN_FEATURE_PRELINK:BOOL=${_TIZEN_FEATURE_PRELINK} \
132         -DAUL_RES_DIR=%{_aulresdir} \
133         .
134
135 %__make %{?_smp_mflags}
136
137 sqlite3 .appsvc.db < ./data/appsvc_db.sql
138 sqlite3 .component.db < ./parser/component/data/component_db.sql
139
140 %if 0%{?gcov:1}
141 mkdir -p gcov-obj
142 find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
143 %endif
144
145 %check
146 ctest --output-on-failure %{?_smp_mflags}
147 %if 0%{?gcov:1}
148 lcov -c --ignore-errors graph --no-external -q -d . -o %{name}.info
149 genhtml %{name}.info -o %{name}.out
150 zip -r %{name}.zip %{name}.out %{name}.info
151 install -m 0644 %{name}.zip %{buildroot}%{_datadir}/gcov/
152 %endif
153
154 %install
155 rm -rf %{buildroot}
156 %make_install
157
158 mkdir -p %{buildroot}%{TZ_SYS_DB}
159 install -m 0644 .appsvc.db %{buildroot}%{TZ_SYS_DB}
160 install -m 0644 .appsvc.db-journal %{buildroot}%{TZ_SYS_DB}
161 install -m 0644 .component.db %{buildroot}%{TZ_SYS_DB}
162 install -m 0644 .component.db-journal %{buildroot}%{TZ_SYS_DB}
163
164 mkdir -p %{buildroot}%{_datadir}/appsvc
165 cp -R %{_builddir}/%{name}-%{version}/alias/* %{buildroot}%{_datadir}/appsvc
166
167 mkdir -p %{buildroot}%{_sysconfdir}/gumd/useradd.d
168 cp -f scripts/12_appsvc-add.post %{buildroot}%{_sysconfdir}/gumd/useradd.d/12_appsvc-add.post
169
170 %if 0%{?gcov:1}
171 mkdir -p %{buildroot}%{_datadir}/gcov/obj
172 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
173 %endif
174
175 %preun
176
177 %post
178 /sbin/ldconfig
179
180 chmod 666 %{TZ_SYS_DB}/.appsvc.db
181 chmod 666 %{TZ_SYS_DB}/.appsvc.db-journal
182 chsmack -a 'User::Home' %{TZ_SYS_DB}/.appsvc.db
183 chsmack -a 'User::Home' %{TZ_SYS_DB}/.appsvc.db-journal
184 chmod 666 %{TZ_SYS_DB}/.component.db
185 chmod 666 %{TZ_SYS_DB}/.component.db-journal
186 chsmack -a 'User::Home' %{TZ_SYS_DB}/.component.db
187 chsmack -a 'User::Home' %{TZ_SYS_DB}/.component.db-journal
188
189 %postun
190 /sbin/ldconfig
191
192 %post test
193 %if 0%{?gcov:1}
194 %{_bindir}/aul-unit-tests
195 %endif
196 chmod +x %{_aulresdir}/tpk/install.sh
197 %{_aulresdir}/tpk/install.sh
198
199 %postun server
200 /sbin/ldconfig
201
202 %post server
203 /sbin/ldconfig
204
205 %files
206 %license LICENSE
207 %manifest %{name}.manifest
208 %attr(0644,root,root) %{_libdir}/libaul.so.*
209 %config %{_sysconfdir}/dbus-1/system.d/aul.conf
210 %{_bindir}/aul_test
211 %{_bindir}/app_launcher
212 %{_bindir}/appgroup_info
213 %{_bindir}/app_com_tool
214 %{_bindir}/launch_app
215 %{_bindir}/appid2pid
216 %{_bindir}/launch_debug
217 %{_bindir}/compmgr_tool
218 %{_bindir}/appsvc-db-recovery
219 %{_bindir}/component-db-recovery
220 %{_datadir}/aul/miregex/*
221 %{_datadir}/aul/preexec_list.txt
222 %{_datadir}/appsvc/*
223 %{_datadir}/parser-plugins/*
224 %{TZ_SYS_DB}/.appsvc.db*
225 %{TZ_SYS_DB}/.component.db*
226 %{_sysconfdir}/package-manager/parserlib/metadata/*.so
227 %{_sysconfdir}/package-manager/parserlib/libcomponent-based-application.so
228 %attr(0755,root,root) %{_sysconfdir}/gumd/useradd.d/*
229 %attr(0755,root,root) %{_datadir}/upgrade/scripts/501.component_upgrade.sh
230
231 %files test
232 %{_bindir}/app-control-tests
233 %{_bindir}/aul-unit-tests
234 %{_bindir}/open_app
235 %{_aulresdir}/*
236
237 %files devel
238 %{_includedir}/aul/*.h
239 %{_includedir}/aul/api/*.h
240 %{_libdir}/libaul.so
241 %{_libdir}/pkgconfig/aul.pc
242
243 #################################################
244 # aul-gcov
245 #################################################
246 %if 0%{?gcov:1}
247 %files gcov
248 %{_datadir}/gcov/*
249 %endif
250
251 %files server
252 %manifest %{name}-server.manifest
253 %attr(0644,root,root) %{_libdir}/libaul-server.so.*
254
255 %files server-devel
256 %{_includedir}/aul/server/*.h
257 %{_libdir}/libaul-server.so
258 %{_libdir}/pkgconfig/aul-server.pc