summaryrefslogtreecommitdiff
path: root/packaging/weston-generic.spec
blob: bebd617f70d272de63833772a06788bac1b82043 (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
%bcond_with wayland
Name:       weston-generic
Version:    1
Release:    0
Summary:    Tizen Generic Weston configuration and set-up
License:    MIT
Group:      Base/Configuration
#BuildArch:  noarch
Source0:    %{name}-%{version}.tar.bz2
Source1001: weston-generic.manifest
Provides:   weston-startup

BuildRequires:	autoconf >= 2.64, automake >= 1.11
BuildRequires:  libtool >= 2.2
BuildRequires:  libjpeg-devel
BuildRequires:  xz
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(xkbcommon)
BuildRequires:  pkgconfig(wayland-client)
BuildRequires:  pkgconfig(wayland-cursor)
BuildRequires:  pkgconfig(wayland-egl)
BuildRequires:  pkgconfig(egl)
BuildRequires:  pkgconfig(glesv2)
BuildRequires:  pkgconfig(pixman-1)
BuildRequires:  pkgconfig(cairo)
BuildRequires:  pkgconfig(cairo-egl)
BuildRequires:  pkgconfig(cairo-glesv2)
BuildRequires:  pkgconfig(weston)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gio-2.0)

%if !%{with wayland}
ExclusiveArch:
%endif

############ tz-launcher
%package tz-launcher
Summary: A small launcher for Wayland compositors

%description tz-launcher
A small launcher for Wayland compositors
############

%description
This package contains Tizen Generic configuration and set-up for
the Weston compositor, including systemd unit files.

%package config
Summary:    Tizen Generic Weston configuration
Group:      Base/Configuration
%description config
This package contains Tizen Generic configuration for the Weston
compositor.

%prep
%setup -q
cp %{SOURCE1001} .

%build
cd tz-launcher
%reconfigure
make %{?_smp_mflags}

%install
#install tz-launcher
cd tz-launcher
%make_install
cd ..

# install weston service as 'display-manager.service' as it's the one wanted by graphical.target
mkdir -p %{buildroot}%{_unitdir}
install -m 644 display-manager-run.service %{buildroot}%{_unitdir}/display-manager-run.service
install -m 644 display-manager.service %{buildroot}%{_unitdir}/display-manager.service
install -m 644 display-manager.path %{buildroot}%{_unitdir}/display-manager.path

# install Environment file for weston service
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
install -m 0644 weston.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/weston

# install tmpfiles.d(5) conf
mkdir -p %{buildroot}%{_prefix}/lib/tmpfiles.d
install -m 0644 weston_tmpfiles.conf %{buildroot}%{_prefix}/lib/tmpfiles.d/weston.conf

# install weston-user service in user session
mkdir -p %{buildroot}%{_unitdir_user}
install -m 644 weston-user.service %{buildroot}%{_unitdir_user}/

# install weston.sh
mkdir -p %{buildroot}%{_sysconfdir}/profile.d/
install -m 0644 weston.sh %{buildroot}%{_sysconfdir}/profile.d/

# install weston.ini
%define weston_config_dir %{_sysconfdir}/xdg/weston
mkdir -p %{buildroot}%{weston_config_dir}
install -m 0644 weston.ini %{buildroot}%{weston_config_dir}

# Add a rule to ensure the 'display' user has permissions to
# open the graphics device
mkdir -p %{buildroot}%{_sysconfdir}/udev/rules.d
cat >%{buildroot}%{_sysconfdir}/udev/rules.d/99-dri.rules <<'EOF'
SUBSYSTEM=="drm", MODE="0660", GROUP="display"
EOF

# user 'display' must own /dev/tty1 for weston to start correctly
cat >%{buildroot}%{_sysconfdir}/udev/rules.d/99-tty.rules <<'EOF'
SUBSYSTEM=="tty", KERNEL=="tty1", GROUP="display", OWNER="display"
EOF

# install desktop file
mkdir -p %{buildroot}%{_datadir}/applications
install -m 0644 weston-terminal.desktop %{buildroot}%{_datadir}/applications

%pre
# create groups 'display' and 'weston-launch'
getent group display >/dev/null || %{_sbindir}/groupadd -r -o display
getent group weston-launch >/dev/null || %{_sbindir}/groupadd -r -o weston-launch

# create user 'display'
getent passwd display >/dev/null || %{_sbindir}/useradd -r -g display -G weston-launch -d /run/display -s /bin/false -c "Display daemon" display

# setup display manager service
mkdir -p %{_unitdir}/graphical.target.wants/
ln -sf ../display-manager.path  %{_unitdir}/graphical.target.wants/

# setup display manager access (inside user session)
mkdir -p %{_unitdir_user}/default.target.wants/
ln -sf ../weston-user.service  %{_unitdir_user}/default.target.wants/

%files
%manifest %{name}.manifest
%defattr(-,root,root)
%license COPYING
%{_unitdir}/display-manager-run.service
%{_unitdir}/display-manager.service
%{_unitdir}/display-manager.path
%config %{_sysconfdir}/sysconfig/weston
%{_prefix}/lib/tmpfiles.d/weston.conf
%{_unitdir_user}/weston-user.service
%config %{_sysconfdir}/profile.d/*
%config %{_sysconfdir}/udev/rules.d/*
%{_datadir}/applications/*.desktop

%files config
%manifest %{name}.manifest
%config %{weston_config_dir}/weston.ini

%files tz-launcher
%manifest %{name}.manifest
%defattr(-,root,root)
%license tz-launcher/COPYING
%{_bindir}/tz-launcher