summaryrefslogtreecommitdiff
path: root/packaging/tizen-mobile-session.spec
blob: af0501f30738eee619aabbf38b55c886f4f28bd1 (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
%bcond_with emulator
%bcond_with x
Name:       tizen-mobile-session
Summary:    Tizen systemd user session
Version:    2
Release:    2
BuildArch:  noarch
Group:      System/Libraries
License:    TIZEN-Public-Domain
Source0:    tizen-mobile-session.target
Source1:    tizen-middleware.target
Source4:    tizen-generate-env.service
Source5:    tizen-mobile-env.conf
Source6:    tizen-mobile-session.manifest

Requires: systemd
Requires: user-session-units

%description
Target for Tizen systemd user session

%prep
cp %{SOURCE6} .

%build

%install

mkdir -p %{buildroot}%{_unitdir_user}/tizen-mobile-session.target.wants
mkdir -p %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants
mkdir -p %{buildroot}%{_unitdir}/graphical.target.wants
mkdir -p %{buildroot}%{_unitdir}/basic.target.wants
mkdir -p %{buildroot}%{_unitdir}/user@.service.d
install -m 0644 %SOURCE0 %{buildroot}%{_unitdir_user}
install -m 0644 %SOURCE1 %{buildroot}%{_unitdir_user}
install -m 0644 %SOURCE4 %{buildroot}%{_unitdir}
install -m 0644 %SOURCE5 %{buildroot}%{_unitdir}/user@.service.d/

%if %{with x}
echo "Environment=DISPLAY=:0" >> %{buildroot}%{_libdir}/systemd/system/user@.service.d/tizen-mobile-env.conf
%endif

ln -sf ../user-session-launch@.service %{buildroot}%{_unitdir}/graphical.target.wants/user-session-launch@seat0-5000.service
ln -sf tizen-mobile-session.target %{buildroot}%{_unitdir_user}/default.target
ln -sf ../tizen-generate-env.service %{buildroot}%{_unitdir}/basic.target.wants

mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
ln -sf /run/tizen-mobile-ui %{buildroot}%{_sysconfdir}/sysconfig/tizen-mobile-ui

%post
/usr/bin/systemctl daemon-reload
/usr/bin/systemctl start tizen-generate-env.service

%postun
/usr/bin/systemctl daemon-reload

%files
%manifest tizen-mobile-session.manifest
%config %{_sysconfdir}/sysconfig/tizen-mobile-ui
%{_unitdir_user}/tizen-mobile-session.target
%{_unitdir_user}/tizen-middleware.target
%{_unitdir_user}/tizen-mobile-session.target.wants/
%{_unitdir_user}/tizen-middleware.target.wants/
%{_unitdir_user}/default.target
%{_unitdir}/graphical.target.wants/user-session-launch@seat0-5000.service
%{_unitdir}/tizen-generate-env.service
%{_unitdir}/basic.target.wants/tizen-generate-env.service
%{_unitdir}/user@.service.d/tizen-mobile-env.conf
%ghost /run/tizen-mobile-ui