Change the owner of /etc/skel/apps_rw to tizenglobalapp
[platform/core/appfw/slp-pkgmgr.git] / packaging / pkgmgr.spec
1 %bcond_with wayland
2
3 Name:       pkgmgr
4 Summary:    Packager Manager client library package
5 Version:    0.2.89
6 Release:    0
7 Group:      Application Framework/Package Management
8 License:    Apache-2.0
9 Source0:    %{name}-%{version}.tar.gz
10 Source1001: %{name}.manifest
11 Source1002: %{name}-client.manifest
12 Source1003: %{name}-client-devel.manifest
13 Source1004: %{name}-installer.manifest
14 Source1005: %{name}-installer-devel.manifest
15 Source1006: %{name}-types-devel.manifest
16 Source1007: %{name}.conf
17 Requires:   pwdutils
18
19 BuildRequires:  cmake
20 BuildRequires:  unzip
21 BuildRequires:  gettext-tools
22 BuildRequires:  pkgconfig(dbus-glib-1)
23 BuildRequires:  pkgconfig(glib-2.0)
24 BuildRequires:  pkgconfig(gio-2.0)
25 BuildRequires:  pkgconfig(dlog)
26 BuildRequires:  pkgconfig(bundle)
27 BuildRequires:  pkgconfig(pkgmgr-info)
28 BuildRequires:  pkgconfig(iniparser)
29 BuildRequires:  pkgconfig(libtzplatform-config)
30 BuildRequires:  pkgconfig(security-manager)
31 BuildRequires:  pkgconfig(xdgmime)
32 BuildRequires:  pkgconfig(db-util)
33 BuildRequires:  pkgconfig(libsmack)
34 BuildRequires:  pkgmgr-info-parser-devel
35 BuildRequires:  pkgmgr-info-parser
36 BuildRequires:  fdupes
37
38 %description
39 Packager Manager client library package for packaging
40
41
42 %package client
43 Summary:    Package Manager client library develpoment package
44 Requires:   %{name} = %{version}-%{release}
45 Requires: shared-mime-info
46 Requires(post): pkgmgr
47
48 %description client
49 Package Manager client library develpoment package for packaging
50
51
52 %package client-devel
53 Summary:    Package Manager client library develpoment package
54 Requires:   %{name} = %{version}-%{release}
55 Requires: pkgmgr-client
56
57 %description client-devel
58 Package Manager client library develpoment package for packaging
59
60
61 %package installer
62 Summary:    Library for installer frontend/backend
63 Requires:   %{name} = %{version}-%{release}
64
65 %description installer
66 Library for installer frontend/backend for packaging.
67
68
69 %package installer-devel
70 Summary:    Dev package for libpkgmgr-installer
71 Requires:   %{name} = %{version}-%{release}
72
73 %description installer-devel
74 Dev package for libpkgmgr-installer for packaging.
75
76
77 %package types-devel
78 Summary:    Package Manager manifest parser develpoment package
79 Requires:   %{name} = %{version}-%{release}
80
81 %description types-devel
82 Package Manager client types develpoment package for packaging
83
84 %prep
85 %setup -q
86 cp %{SOURCE1001} %{SOURCE1002} %{SOURCE1003} %{SOURCE1004} %{SOURCE1005} %{SOURCE1006} .
87
88 %build
89 %cmake .
90
91 %__make %{?_smp_mflags}
92
93 %install
94 %make_install
95 rm -f  %{buildroot}%{_bindir}/pkgmgr_backend_sample
96 rm -f %{buildroot}%{_libdir}/libpkgmgr_backend_lib_sample.so
97 rm -f %{buildroot}%{_libdir}/libpkgmgr_parser_lib_sample.so
98
99 mkdir -p %{buildroot}%{_tmpfilesdir}/
100 install -m 0644 %{SOURCE1007} %{buildroot}%{_tmpfilesdir}/pkgmgr.conf
101
102 mkdir -p %{buildroot}%{_sysconfdir}/package-manager/backend
103 mkdir -p %{buildroot}%{_sysconfdir}/package-manager/backendlib
104 mkdir -p %{buildroot}%{_sysconfdir}/opt/upgrade
105
106 touch  %{buildroot}%{_sysconfdir}/package-manager/backend/default
107 chmod 755 %{buildroot}%{_sysconfdir}/package-manager/backend/default
108 touch  %{buildroot}%{_sysconfdir}/package-manager/backend/pkgtool
109 chmod 755 %{buildroot}%{_sysconfdir}/package-manager/backend/pkgtool
110
111
112 %fdupes %{buildroot}
113
114 %post
115 /sbin/ldconfig
116
117 # Create tizenglobalapp user needed for global installation
118 useradd %TZ_SYS_GLOBALAPP_USER -r -c "system user for common applications" -g root
119
120 # change owner of TZ_USER_APP (/etc/skel/apps_rw) to tizenglobalapp
121 saveHOME="$HOME"
122 HOME="%{_sysconfdir}/skel"
123 . "%{_sysconfdir}/tizen-platform.conf"
124
125 chown %TZ_SYS_GLOBALAPP_USER:root $TZ_USER_APP
126 HOME="$saveHOME"
127
128 %post -n pkgmgr-client -p /sbin/ldconfig
129
130 %postun -n pkgmgr-client -p /sbin/ldconfig
131
132 %post -n pkgmgr-installer -p /sbin/ldconfig
133
134 %postun -n pkgmgr-installer -p /sbin/ldconfig
135
136
137 %files
138 %manifest %{name}.manifest
139 %defattr(-,root,root,-)
140 %dir %{_sysconfdir}/package-manager/backend
141 %dir %{_sysconfdir}/package-manager/backendlib
142 %{_sysconfdir}/package-manager/backend/*
143 %{_tmpfilesdir}/pkgmgr.conf
144
145 %files client
146 %manifest %{name}-client.manifest
147 %defattr(-,root,root,-)
148 %dir %{_sysconfdir}/package-manager
149 %config %{_sysconfdir}/package-manager/pkg_path.conf
150 %{_libdir}/libpkgmgr-client.so.*
151
152 %files client-devel
153 %manifest %{name}-client-devel.manifest
154 %defattr(-,root,root,-)
155 %{_includedir}/package-manager.h
156 %{_libdir}/pkgconfig/pkgmgr.pc
157 %{_libdir}/libpkgmgr-client.so
158
159 %files installer
160 %manifest %{name}-installer.manifest
161 %defattr(-,root,root,-)
162 %{_libdir}/libpkgmgr_installer.so.*
163
164 %files installer-devel
165 %manifest %{name}-installer-devel.manifest
166 %defattr(-,root,root,-)
167 %dir %{_includedir}/pkgmgr
168 %{_includedir}/pkgmgr/pkgmgr_installer.h
169 %{_libdir}/pkgconfig/pkgmgr-installer.pc
170 %{_libdir}/libpkgmgr_installer.so
171
172 %files types-devel
173 %manifest %{name}-types-devel.manifest
174 %defattr(-,root,root,-)
175 %{_includedir}/package-manager-types.h
176 %{_includedir}/package-manager-plugin.h
177 %{_libdir}/pkgconfig/pkgmgr-types.pc