1 # define used dbus type [p2p, system]
2 %define dbus_type system
3 # enable debug features such as control environment variables
4 # WARNING! do not use for production builds as it will break security
7 %define GUMD_DBUS_SERVICE "src/daemon/dbus/services/org.O1.SecurityAccounts.gUserManagement.service"
10 Summary: User management daemon and client library
13 Group: Security/Accounts
14 License: LGPL-2.1+ and GPL-3.0-with-autoconf-exception
15 URL: https://github.com/01org/gumd
16 Source: %{name}-%{version}.tar.gz
17 Source1001: %{name}.manifest
18 Source1002: libgum.manifest
19 Requires: libgum = %{version}-%{release}
21 %if %{dbus_type} != "p2p"
24 Requires(post): /sbin/ldconfig
25 Requires(post): /usr/bin/getent
26 Requires(post): /usr/sbin/groupadd
27 Requires(postun): /sbin/ldconfig
28 BuildRequires: pkgconfig(systemd)
29 BuildRequires: pkgconfig(dbus-1)
30 BuildRequires: pkgconfig(gtk-doc)
31 BuildRequires: pkgconfig(glib-2.0) >= 2.30
32 BuildRequires: pkgconfig(gobject-2.0)
33 BuildRequires: pkgconfig(gio-2.0)
34 BuildRequires: pkgconfig(gio-unix-2.0)
35 BuildRequires: pkgconfig(gmodule-2.0)
36 BuildRequires: pkgconfig(libtzplatform-config)
37 Requires: security-config
38 Requires: tizen-platform-config
39 Provides: gumd-profile_common = %{version}-%{release}
40 Provides: gumd-profile_mobile = %{version}-%{release}
41 Provides: gumd-profile_tv = %{version}-%{release}
42 Provides: gumd-profile_ivi = %{version}-%{release}
47 %package profile_wearable
48 Summary: GUMD extension for Tizen Wearable
49 Requires: gumd = %{version}-%{release}
51 %description profile_wearable
52 GUMD extension for Tizen Wearable.
53 This extension supports wearable specific gumd.service file.
56 Summary: User management client library
57 Group: Security/Libraries
58 Requires: %{name} = %{version}-%{release}
61 %description -n libgum
66 Summary: User management utility tool
67 Group: Security/Libraries
68 Requires: libgum = %{version}-%{release}
71 %description -n gum-utils
75 %package -n libgum-devel
76 Summary: Development files for user management client library
77 Group: Security/Libraries
78 Requires: libgum = %{version}-%{release}
81 %description -n libgum-devel
86 Summary: Documentation files for %{name}
87 Group: Security/Documentation
88 Requires: libgum = %{version}-%{release}
96 %setup -q -n %{name}-%{version}
97 cp -a %{SOURCE1001} %{name}.manifest
98 cp -a %{SOURCE1002} libgum.manifest
99 cp data/gumd.service data/gumd.service.wearable
101 %if "%{tizen_profile_name}" == "tv"
102 mv "%{GUMD_DBUS_SERVICE}".vd.in "%{GUMD_DBUS_SERVICE}".in
104 mv "%{GUMD_DBUS_SERVICE}".common.in "%{GUMD_DBUS_SERVICE}".in
107 echo "CapabilityBoundingSet=~CAP_MAC_ADMIN" >> data/gumd.service.wearable
108 echo "SmackProcessLabel=System" >> data/gumd.service.wearable
110 echo "SmackProcessLabel=System::Privileged" >> data/gumd.service
115 %if %{debug_build} == 1
116 %configure --enable-dbus-type=%{dbus_type} --enable-debug
118 %configure --enable-dbus-type=%{dbus_type}
120 %__make %{?_smp_mflags}
125 rm -f %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
126 install -m 755 -d %{buildroot}%{_sysconfdir}/%{name}
127 install -m 644 data/tizen/etc/%{name}/%{name}-tizen-common.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
128 install -m 755 -d %{buildroot}%{_unitdir}
129 install -m 644 data/gumd.service.wearable %{buildroot}%{_unitdir}
130 %if "%{tizen_profile_name}" != "tv"
131 install -m 644 data/gumd.service %{buildroot}%{_unitdir}
136 getent group gumd > /dev/null || groupadd -r -g 205 gumd
137 install -d -m 755 %{_sysconfdir}/%{name}/useradd.d
138 install -d -m 755 %{_sysconfdir}/%{name}/userdel.d
139 install -d -m 755 %{_sysconfdir}/%{name}/groupadd.d
140 install -d -m 755 %{_sysconfdir}/%{name}/groupdel.d
141 install -d -m 755 %{_localstatedir}/lib/%{name}/user
142 touch /opt%{_sysconfdir}/.pwd.lock
143 if [ -e "%{_sysconfdir}/.pwd.lock" ]; then
144 rm -f %{_sysconfdir}/.pwd.lock
146 ln -s /opt%{_sysconfdir}/.pwd.lock %{_sysconfdir}/.pwd.lock
148 %postun -p /sbin/ldconfig
150 %post -n libgum -p /sbin/ldconfig
151 %postun -n libgum -p /sbin/ldconfig
153 %post profile_wearable
154 # Uses different service file (overwrite non wearable)
155 mv %{_unitdir}/gumd.service.wearable %{_unitdir}/gumd.service
156 # This does not support complete unisntall because gumd.service
157 # is not going to be recovered. Users should reinstall gumd
158 # to get it recovered after uninstalling profile_wearable
161 %defattr(-,root,root,-)
162 %manifest libgum.manifest
164 %{_libdir}/libgum*.so.*
167 %defattr(-,root,root,-)
168 %manifest %{name}.manifest
172 %files -n libgum-devel
173 %defattr(-,root,root,-)
174 %manifest %{name}.manifest
176 %{_libdir}/libgum*.so
177 %{_libdir}/pkgconfig/libgum.pc
178 %if %{dbus_type} != "p2p"
179 %{_datadir}/dbus-1/interfaces/*UserManagement*.xml
183 %defattr(-,root,root,-)
184 %manifest %{name}.manifest
185 %doc AUTHORS COPYING.LIB NEWS README
188 %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
189 %if %{dbus_type} == "system"
190 %dir %{_datadir}/dbus-1/system-services
191 %{_datadir}/dbus-1/system-services/*UserManagement*.service
192 %dir %{_sysconfdir}/dbus-1
193 %dir %{_sysconfdir}/dbus-1/system.d
194 %config(noreplace) %{_sysconfdir}/dbus-1/system.d/gumd-dbus.conf
195 %if "%{tizen_profile_name}" != "tv"
196 %{_unitdir}/gumd.service
200 %files profile_wearable
202 %{_unitdir}/gumd.service.wearable
205 %defattr(-,root,root,-)
206 %manifest %{name}.manifest
207 %{_datadir}/gtk-doc/html/gumd/*