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