summaryrefslogtreecommitdiff
path: root/packaging/aul.spec
blob: 56cdf4d71497a660b521c873e29138f10d68015c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
Name:       aul
Summary:    App utility library
Version:    0.34.1
Release:    1
Group:      Application Framework/Libraries
License:    Apache-2.0
Source0:    %{name}-%{version}.tar.gz
Source1001: %{name}.manifest
Source1002: %{name}-server.manifest

Requires(post):   /sbin/ldconfig
Requires(post):   /usr/bin/systemctl
Requires(postun): /sbin/ldconfig
Requires(postun): /usr/bin/systemctl
Requires(preun):  /usr/bin/systemctl
Requires:   tizen-platform-config

BuildRequires:  cmake
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(bundle)
BuildRequires:  pkgconfig(dlog)
BuildRequires:  xdgmime-devel, pkgconfig(xdgmime)
BuildRequires:  pkgconfig(vconf)
BuildRequires:  pkgconfig(pkgmgr-info)
BuildRequires:  libattr-devel
BuildRequires:  pkgconfig(libtzplatform-config)
BuildRequires:  pkgconfig(capi-system-info)
BuildRequires:  pkgconfig(iniparser)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  pkgconfig(storage)
BuildRequires:  pkgconfig(ttrace)
BuildRequires:  pkgconfig(pkgmgr-installer)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(uuid)
BuildRequires:  pkgconfig(libsmack)
BuildRequires:  pkgconfig(gmock)
BuildRequires:  pkgconfig(parcel)

%if 0%{?gcov:1}
BuildRequires:  lcov
BuildRequires:  zip
%endif

Recommends: amd
Recommends: amd-mod-component-manager
Recommends: amd-mod-watchdog

%description
Application utility library

%package devel
Summary:    App utility library (devel)
Group:      Development/Libraries
Requires:   %{name} = %{version}-%{release}

%description devel
Application utility library (devel)

%package test
Summary:    App utility test tools
Group:      Development/Libraries
Requires:   %{name} = %{version}-%{release}

%description test
Application utility library (test tools)

#################################################
# aul-gcov
#################################################
%if 0%{?gcov:1}
%package gcov
Summary:    AUL (gcov)
Group:      Application Framework/Testing

%description gcov
AUL gcov objects
%endif

#################################################
# aul-server
#################################################
%package server
Summary:    Application Utility Library (Server)
Group:      Development/Libraries

%description server
Application Utility Library (Server)

%package server-devel
Summary:    Application Utility Library (Server)
Group:      Development/Libraries
Requires:   %{name}-server = %{version}-%{release}

%description server-devel
Application Utility Library (devel)

%if "%{?_prelink_enable}" == "y"
%define tizen_feature_prelink 1
%else
%define tizen_feature_prelink 0
%endif

%define _aulresdir /opt/usr/home/owner/share/aul/res

%prep
%setup -q
sed -i 's|TZ_SYS_DB|%{TZ_SYS_DB}|g' %{SOURCE1001}
cp %{SOURCE1001} .
cp %{SOURCE1002} .

%build
%if 0%{?gcov:1}
export CFLAGS+=" -fprofile-arcs -ftest-coverage"
export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
export FFLAGS+=" -fprofile-arcs -ftest-coverage"
export LDFLAGS+=" -lgcov"
%endif

%if 0%{?simulator}
CFLAGS="%{optflags} -D__emul__"; export CFLAGS
%endif

%if 0%{?tizen_feature_prelink}
_TIZEN_FEATURE_PRELINK=ON
%endif

MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%cmake -DFULLVER=%{version} \
	-DMAJORVER=${MAJORVER} \
	-D_TIZEN_FEATURE_PRELINK:BOOL=${_TIZEN_FEATURE_PRELINK} \
	-DAUL_RES_DIR=%{_aulresdir} \
	.

%__make %{?_smp_mflags}

sqlite3 .appsvc.db < ./data/appsvc_db.sql
sqlite3 .component.db < ./parser/component/data/component_db.sql

%if 0%{?gcov:1}
mkdir -p gcov-obj
find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
%endif

%check
export LD_LIBRARY_PATH="../../"
ctest -V
%if 0%{?gcov:1}
lcov -c --ignore-errors graph --no-external -q -d . -o %{name}.info
genhtml %{name}.info -o %{name}.out
zip -r %{name}.zip %{name}.out %{name}.info
install -m 0644 %{name}.zip %{buildroot}%{_datadir}/gcov/
%endif

%install
rm -rf %{buildroot}
%make_install

mkdir -p %{buildroot}%{TZ_SYS_DB}
install -m 0644 .appsvc.db %{buildroot}%{TZ_SYS_DB}
install -m 0644 .appsvc.db-journal %{buildroot}%{TZ_SYS_DB}
install -m 0644 .component.db %{buildroot}%{TZ_SYS_DB}
install -m 0644 .component.db-journal %{buildroot}%{TZ_SYS_DB}

mkdir -p %{buildroot}%{_datadir}/appsvc
cp -R %{_builddir}/%{name}-%{version}/alias/* %{buildroot}%{_datadir}/appsvc

mkdir -p %{buildroot}%{_sysconfdir}/gumd/useradd.d
cp -f scripts/12_appsvc-add.post %{buildroot}%{_sysconfdir}/gumd/useradd.d/12_appsvc-add.post

%if 0%{?gcov:1}
mkdir -p %{buildroot}%{_datadir}/gcov/obj
install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
%endif

%preun

%post
/sbin/ldconfig

chmod 666 %{TZ_SYS_DB}/.appsvc.db
chmod 666 %{TZ_SYS_DB}/.appsvc.db-journal
chsmack -a 'User::Home' %{TZ_SYS_DB}/.appsvc.db
chsmack -a 'User::Home' %{TZ_SYS_DB}/.appsvc.db-journal
chmod 666 %{TZ_SYS_DB}/.component.db
chmod 666 %{TZ_SYS_DB}/.component.db-journal
chsmack -a 'User::Home' %{TZ_SYS_DB}/.component.db
chsmack -a 'User::Home' %{TZ_SYS_DB}/.component.db-journal

%postun
/sbin/ldconfig

%post test
%if 0%{?gcov:1}
%{_bindir}/aul-unit-tests
%endif
chmod +x %{_aulresdir}/tpk/install.sh
%{_aulresdir}/tpk/install.sh

%postun server
/sbin/ldconfig

%post server
/sbin/ldconfig

%files
%license LICENSE
%manifest %{name}.manifest
%attr(0644,root,root) %{_libdir}/libaul.so.*
%config %{_sysconfdir}/dbus-1/system.d/aul.conf
%{_bindir}/aul_test
%{_bindir}/app_launcher
%{_bindir}/appgroup_info
%{_bindir}/app_com_tool
%{_bindir}/launch_app
%{_bindir}/appid2pid
%{_bindir}/launch_debug
%{_bindir}/compmgr_tool
%{_bindir}/appsvc-db-recovery
%{_bindir}/component-db-recovery
%{_datadir}/aul/miregex/*
%{_datadir}/aul/preexec_list.txt
%{_datadir}/appsvc/*
%{_datadir}/parser-plugins/*
%{TZ_SYS_DB}/.appsvc.db*
%{TZ_SYS_DB}/.component.db*
%{_sysconfdir}/package-manager/parserlib/metadata/*.so
%{_sysconfdir}/package-manager/parserlib/libcomponent-based-application.so
%attr(0755,root,root) %{_sysconfdir}/gumd/useradd.d/*
%attr(0755,root,root) %{_datadir}/upgrade/scripts/501.component_upgrade.sh

%files test
%{_bindir}/app-control-tests
%{_bindir}/aul-unit-tests
%{_bindir}/open_app
%{_aulresdir}/*

%files devel
%{_includedir}/aul/*.h
%{_includedir}/aul/api/*.h
%{_libdir}/libaul.so
%{_libdir}/pkgconfig/aul.pc

#################################################
# aul-gcov
#################################################
%if 0%{?gcov:1}
%files gcov
%{_datadir}/gcov/*
%endif

%files server
%manifest %{name}-server.manifest
%attr(0644,root,root) %{_libdir}/libaul-server.so.*

%files server-devel
%{_includedir}/aul/server/*.h
%{_libdir}/libaul-server.so
%{_libdir}/pkgconfig/aul-server.pc