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
|
Name: pkgmgr
Summary: Packager Manager client library package
Version: 0.20.3
Release: 0
Group: Application Framework/Package Management
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
Source1001: %{name}.manifest
Source1002: %{name}-client.manifest
Source1003: %{name}-client-devel.manifest
Source1004: %{name}-installer.manifest
Source1005: %{name}-installer-devel.manifest
Source1006: %{name}-types-devel.manifest
Source1007: %{name}.conf
Source1008: %{name}-installer-signal-agent.service
Source1009: %{name}-installer-signal-agent.socket
Requires(post): /usr/sbin/useradd
Requires(post): capi-system-info
BuildRequires: cmake
BuildRequires: unzip
BuildRequires: gettext-tools
BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(bundle)
BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(iniparser)
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(xdgmime)
BuildRequires: pkgconfig(db-util)
BuildRequires: pkgconfig(libsmack)
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(minizip)
BuildRequires: pkgconfig(rpc-port)
BuildRequires: pkgconfig(capi-appfw-event)
BuildRequires: pkgconfig(gmock)
BuildRequires: pkgmgr-info-parser-devel
BuildRequires: pkgmgr-info-parser
BuildRequires: fdupes
%description
Packager Manager client library package for packaging
%package client
Summary: Package Manager client library develpoment package
Requires: %{name} = %{version}-%{release}
Requires: shared-mime-info
Requires(post): pkgmgr
%description client
Package Manager client library develpoment package for packaging
%package client-devel
Summary: Package Manager client library develpoment package
Requires: %{name} = %{version}-%{release}
Requires: pkgmgr-client
%description client-devel
Package Manager client library develpoment package for packaging
%package installer
Summary: Library for installer frontend/backend
Requires: %{name} = %{version}-%{release}
%description installer
Library for installer frontend/backend for packaging.
%package installer-devel
Summary: Dev package for libpkgmgr-installer
Requires: %{name} = %{version}-%{release}
Requires: pkgmgr-installer = %{version}-%{release}
%description installer-devel
Dev package for libpkgmgr-installer for packaging.
%package types-devel
Summary: Package Manager manifest parser develpoment package
Requires: %{name} = %{version}-%{release}
%description types-devel
Package Manager client types develpoment package for packaging
%prep
%setup -q
cp %{SOURCE1001} %{SOURCE1002} %{SOURCE1003} %{SOURCE1004} %{SOURCE1005} %{SOURCE1006} .
%build
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
%__make %{?_smp_mflags}
%install
%make_install
rm -f %{buildroot}%{_bindir}/pkgmgr_backend_sample
rm -f %{buildroot}%{_libdir}/libpkgmgr_backend_lib_sample.so
rm -f %{buildroot}%{_libdir}/libpkgmgr_parser_lib_sample.so
mkdir -p %{buildroot}%{_tmpfilesdir}/
install -m 0644 %{SOURCE1007} %{buildroot}%{_tmpfilesdir}/pkgmgr.conf
mkdir -p %{buildroot}%{_unitdir_user}/sockets.target.wants
install -m 0644 %{SOURCE1008} %{buildroot}%{_unitdir_user}/pkgmgr-installer-signal-agent.service
install -m 0644 %{SOURCE1009} %{buildroot}%{_unitdir_user}/pkgmgr-installer-signal-agent.socket
ln -sf ../pkgmgr-installer-signal-agent.socket %{buildroot}%{_unitdir_user}/sockets.target.wants/pkgmgr-installer-signal-agent.socket
mkdir -p %{buildroot}%{_sysconfdir}/package-manager/backend
mkdir -p %{buildroot}%{_sysconfdir}/package-manager/backendlib
mkdir -p %{buildroot}%{_sysconfdir}/opt/upgrade
touch %{buildroot}%{_sysconfdir}/package-manager/backend/default
chmod 755 %{buildroot}%{_sysconfdir}/package-manager/backend/default
touch %{buildroot}%{_sysconfdir}/package-manager/backend/pkgmgr
chmod 755 %{buildroot}%{_sysconfdir}/package-manager/backend/pkgmgr
touch %{buildroot}%{_sysconfdir}/package-manager/backend/pkgtool
chmod 755 %{buildroot}%{_sysconfdir}/package-manager/backend/pkgtool
%check
export LD_LIBRARY_PATH=../../client
ctest -V
%fdupes %{buildroot}
%post
/sbin/ldconfig
# Create tizenglobalapp user needed for global installation
useradd %TZ_SYS_GLOBALAPP_USER -r -c "system user for common applications" -g root -u 201
# change owner of TZ_USER_APP (/etc/skel/apps_rw) to tizenglobalapp
saveHOME="$HOME"
HOME="%{_sysconfdir}/skel"
. "%{_sysconfdir}/tizen-platform.conf"
chown %TZ_SYS_GLOBALAPP_USER:root $TZ_USER_APP
# add .shared and .shared_tmp at skel
mkdir -p $TZ_USER_APP/.shared
mkdir -p $TZ_USER_APP/.shared_tmp
chsmack -a User::Home $TZ_USER_APP/.shared
chsmack -a User::Home $TZ_USER_APP/.shared_tmp
chmod 755 $TZ_USER_APP/.shared
chmod 755 $TZ_USER_APP/.shared_tmp
HOME="$saveHOME"
%post -n pkgmgr-client -p /sbin/ldconfig
%postun -n pkgmgr-client -p /sbin/ldconfig
%post -n pkgmgr-installer -p /sbin/ldconfig
%postun -n pkgmgr-installer -p /sbin/ldconfig
%posttrans
if [ ! -f %{TZ_SYS_DB}/.pkgmgr_parser.db ]; then
pkg_initdb --ro
install_preload_pkg
if [ -f /tmp/.preload_install_error ]; then
if [ ! -d /tmp/.postscript/error ]; then
mkdir -p /tmp/.postscript/error
fi
echo "preload install failed" > /tmp/.postscript/error/%{name}_error
else
pkgcmd -l --global 1>&2
fi
%{_sysconfdir}/package-manager/pkgmgr-label-initial-image.sh
fi
rm -rf %{_sysconfdir}/package-manager/pkgmgr-label-initial-image.sh
%files
%manifest %{name}.manifest
%defattr(-,root,root,-)
%dir %{_sysconfdir}/package-manager/backend
%dir %{_sysconfdir}/package-manager/backendlib
%{_sysconfdir}/package-manager/backend/*
%{_tmpfilesdir}/pkgmgr.conf
%files client
%manifest %{name}-client.manifest
%license LICENSE
%defattr(-,root,root,-)
%dir %{_sysconfdir}/package-manager
%config %{_sysconfdir}/package-manager/pkg_path.conf
%{_libdir}/libpkgmgr-client.so.*
%files client-devel
%manifest %{name}-client-devel.manifest
%defattr(-,root,root,-)
%{_includedir}/*.h
%{_libdir}/pkgconfig/pkgmgr.pc
%{_libdir}/libpkgmgr-client.so
%files installer
%manifest %{name}-installer.manifest
%license LICENSE
%defattr(-,root,root,-)
%{_libdir}/libpkgmgr_installer.so.*
%{_bindir}/pkgmgr-installer-signal-agent
%{_unitdir_user}/pkgmgr-installer-signal-agent.service
%{_unitdir_user}/pkgmgr-installer-signal-agent.socket
%{_unitdir_user}/sockets.target.wants/pkgmgr-installer-signal-agent.socket
%files installer-devel
%manifest %{name}-installer-devel.manifest
%defattr(-,root,root,-)
%dir %{_includedir}/pkgmgr
%{_includedir}/package-manager.h
%{_includedir}/pkgmgr/*.h
%{_libdir}/pkgconfig/pkgmgr-installer.pc
%{_libdir}/libpkgmgr_installer.so
%files types-devel
%manifest %{name}-types-devel.manifest
%defattr(-,root,root,-)
%{_includedir}/package-manager-*.h
%{_libdir}/pkgconfig/pkgmgr-types.pc
|