1 DESCRIPTION = "Tizen Common Weston configuration and set-up"
2 HOMEPAGE = "http://nohomepage.org"
3 SECTION = "Base/Configuration"
11 inherit manifest autotools-brokensep
16 #PROVIDES by weston-common
17 # the PROVIDES rules is ignore "weston-startup "
18 PROVIDES += "weston-startup"
19 RPROVIDES_weston-common += "weston-startup"
22 #PROVIDES by weston-common-config
23 PROVIDES += "weston-common-config"
26 #PROVIDES by weston-common-qa-plugin
27 PROVIDES += "weston-common-qa-plugin"
30 #PROVIDES by weston-common-tz-launcher
31 PROVIDES += "weston-common-tz-launcher"
35 #RDEPENDS of weston-common (${PN})
36 RDEPENDS_${PN} += "weston"
37 RDEPENDS_${PN} += "glibc"
38 RDEPENDS_${PN} += "shadow"
42 #DEPENDS of weston-common
44 DEPENDS += "virtual/egl"
45 DEPENDS += "libxkbcommon"
46 DEPENDS += "libjpeg-turbo"
49 DEPENDS_append_class-native = " automake-native"
50 DEPENDS_append_class-target = " automake-native"
53 DEPENDS_append_class-native = " libtool"
54 DEPENDS_append_class-target = " libtool-cross"
57 DEPENDS_append_class-native = " autoconf-native"
58 DEPENDS_append_class-target = " autoconf-native"
60 DEPENDS += "virtual/libgles2"
65 chmod -Rf a+rX,u+w,g-w,o-w ${S}
67 cp ${S}/packaging/weston-common.manifest .
72 bb.build.exec_func('do_prep', d)
83 LD_AS_NEEDED=1; export LD_AS_NEEDED ;
86 autotools_do_configure
95 export RPM_BUILD_ROOT=${D}
109 BINDIR=${prefix}/bin \
111 rm -f ${D}${infodir}/dir
112 find ${D} -regex ".*\.la$" | xargs rm -f --
113 find ${D} -regex ".*\.a$" | xargs rm -f --
115 # install weston service as 'display-manager.service' as it's the one wanted by graphical.target
116 mkdir -p ${D}${systemd_unitdir}/system
117 install -m 644 display-manager-run.service ${D}${systemd_unitdir}/system/display-manager-run.service
118 install -m 644 display-manager.service ${D}${systemd_unitdir}/system/display-manager.service
119 install -m 644 display-manager.path ${D}${systemd_unitdir}/system/display-manager.path
121 # install Environment file for weston service and weston-user.service
122 mkdir -p ${D}${sysconfdir}/sysconfig
123 install -m 0644 weston.sysconfig ${D}${sysconfdir}/sysconfig/weston
124 install -m 0644 weston-user.sysconfig ${D}${sysconfdir}/sysconfig/weston-user
126 # install tmpfiles.d(5) conf
127 mkdir -p ${D}${prefix}/lib/tmpfiles.d
128 install -m 0644 weston_tmpfiles.conf ${D}${prefix}/lib/tmpfiles.d/weston.conf
130 # install weston-user service in user session
131 mkdir -p ${D}${prefix}/lib/systemd/user
132 install -m 644 weston-user.service ${D}${prefix}/lib/systemd/user/
135 mkdir -p ${D}${sysconfdir}/profile.d/
136 install -m 0644 weston.sh ${D}${sysconfdir}/profile.d/
139 mkdir -p ${D}${sysconfdir}/xdg/weston
140 install -m 0644 weston.ini ${D}${sysconfdir}/xdg/weston
142 # Add a rule to ensure the 'display' user has permissions to
143 # open the graphics device
144 mkdir -p ${D}${sysconfdir}/udev/rules.d
145 cat >${D}${sysconfdir}/udev/rules.d/99-dri.rules <<'EOF'
146 SUBSYSTEM=="drm", MODE="0660", GROUP="display", SECLABEL{smack}="*"
149 # user 'display' must own /dev/tty7 for weston to start correctly
150 cat >${D}${sysconfdir}/udev/rules.d/99-tty.rules <<'EOF'
151 SUBSYSTEM=="tty", KERNEL=="tty7", OWNER="display", SECLABEL{smack}="^"
154 # user 'display' must also be able to access /dev/input/*
155 cat >${D}${sysconfdir}/udev/rules.d/99-input.rules <<'EOF'
156 SUBSYSTEM=="input", MODE="0660", GROUP="input", SECLABEL{smack}="^"
159 # install desktop file
160 mkdir -p ${D}${prefix}/share/applications
161 install -m 0644 weston-terminal.desktop ${D}${prefix}/share/applications
166 pkg_preinst_${PN}() {
169 # create groups 'display' and 'weston-launch'
170 getent group display >/dev/null || $D${prefix}/sbin/groupadd -r -o display
171 getent group input >/dev/null || $D${prefix}/sbin/groupadd -r -o input
172 getent group weston-launch >/dev/null || $D${prefix}/sbin/groupadd -r -o weston-launch
173 # create user 'display'
174 getent passwd display >/dev/null || $D${prefix}/sbin/useradd -r -g display -d /run/display -s /bin/false -c "Display daemon" display
175 # add user 'display' to groups 'weston-launch', 'input' and 'video'
176 groupmod -A display weston-launch
177 groupmod -A display input
178 groupmod -A display video
179 # setup display manager service
180 mkdir -p $D${systemd_unitdir}/system/graphical.target.wants/
181 ln -sf ../display-manager.path $D${systemd_unitdir}/system/graphical.target.wants/
188 rm -f $D${systemd_unitdir}/system/graphical.target.wants/display-manager.path
192 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale"
193 PACKAGES += " weston-common-tz-launcher "
194 PACKAGES += " weston-common-config "
195 PACKAGES += " weston-common-qa-plugin "
196 PACKAGES += " weston-common "
198 weston-common-tz-launcher_files = ""
199 weston-common-tz-launcher_files += "${prefix}/bin/tz-launcher"
200 weston-common-tz-launcher_files += "${prefix}/bin/wl-pre"
201 MANIFESTFILES_${PN}-tz-launcher = "weston-common.manifest"
203 weston-common-config_files = ""
204 weston-common-config_files += "${sysconfdir}/xdg/weston/weston.ini"
205 CONFFILES_${PN}-config = ""
206 CONFFILES_${PN}-config += "${sysconfdir}/xdg/weston/weston.ini"
207 MANIFESTFILES_${PN}-config = "weston-common.manifest"
209 weston-common-qa-plugin_files = ""
210 weston-common-qa-plugin_files += "${prefix}/bin/weston-qa-client"
211 weston-common-qa-plugin_files += "${prefix}/lib/weston/qa-plugin.so"
212 MANIFESTFILES_${PN}-qa-plugin = "weston-common.manifest"
214 weston-common_files = ""
215 weston-common_files += "${systemd_unitdir}/system/display-manager-run.service"
216 weston-common_files += "${systemd_unitdir}/system/display-manager.service"
217 weston-common_files += "${systemd_unitdir}/system/display-manager.path"
218 weston-common_files += "${sysconfdir}/sysconfig/*"
219 weston-common_files += "${prefix}/lib/tmpfiles.d/weston.conf"
220 weston-common_files += "${prefix}/lib/systemd/user/weston-user.service"
221 weston-common_files += "${sysconfdir}/profile.d/*"
222 weston-common_files += "${sysconfdir}/udev/rules.d/*"
223 weston-common_files += "${prefix}/share/applications/*.desktop"
225 CONFFILES_${PN} += "${sysconfdir}/sysconfig/*"
226 CONFFILES_${PN} += "${sysconfdir}/profile.d/*"
227 CONFFILES_${PN} += "${sysconfdir}/udev/rules.d/*"
228 MANIFESTFILES_${PN} = "weston-common.manifest"
230 FILES_${PN}-tz-launcher = "${weston-common-tz-launcher_files}"
231 FILES_${PN}-config = "${weston-common-config_files}"
232 FILES_${PN}-qa-plugin = "${weston-common-qa-plugin_files}"
233 FILES_${PN} = "${weston-common_files}"
235 PKG_weston-common-tz-launcher= "weston-common-tz-launcher"
236 PKG_weston-common-config= "weston-common-config"
237 PKG_weston-common-qa-plugin= "weston-common-qa-plugin"
238 PKG_weston-common= "weston-common"
240 require weston-common-extraconf.inc