summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChangyeon Lee <cyeon.lee@samsung.com>2016-02-29 21:15:56 +0900
committerChangyeon Lee <cyeon.lee@samsung.com>2016-02-29 21:15:56 +0900
commitbe5c24a9a7e9cca8ff600a24a317e5fb87ec239e (patch)
treec07f2eb78a5e9e896977fabe2c05cb8a7bfc6430
parent1be928bc03b7e8fe9406d5576230507581a22714 (diff)
downloadlibtbm-be5c24a9a7e9cca8ff600a24a317e5fb87ec239e.tar.gz
libtbm-be5c24a9a7e9cca8ff600a24a317e5fb87ec239e.tar.bz2
libtbm-be5c24a9a7e9cca8ff600a24a317e5fb87ec239e.zip
Add tbm-drm service file
Change-Id: I7d42b03523e573cc4b78c3577378f3211f831526
-rw-r--r--packaging/libtbm.spec21
-rw-r--r--service/tbm-drm-user.path5
-rw-r--r--service/tbm-drm-user.service6
-rw-r--r--service/tbm-drm.path5
-rw-r--r--service/tbm-drm.service11
5 files changed, 47 insertions, 1 deletions
diff --git a/packaging/libtbm.spec b/packaging/libtbm.spec
index 35b62c8..b2d5a80 100644
--- a/packaging/libtbm.spec
+++ b/packaging/libtbm.spec
@@ -53,12 +53,27 @@ cp -af COPYING %{buildroot}/usr/share/license/%{name}
%make_install
+%__mkdir_p %{buildroot}%{_unitdir}
+install -m 644 service/tbm-drm.service %{buildroot}%{_unitdir}
+install -m 644 service/tbm-drm.path %{buildroot}%{_unitdir}
+%__mkdir_p %{buildroot}%{_unitdir_user}
+install -m 644 service/tbm-drm-user.service %{buildroot}%{_unitdir_user}
+install -m 644 service/tbm-drm-user.path %{buildroot}%{_unitdir_user}
+
%clean
rm -rf %{buildroot}
+%pre
+%__mkdir_p %{_unitdir}/graphical.target.wants
+ln -sf ../tbm-drm.path %{_unitdir}/graphical.target.wants/
+
+%__mkdir_p %{_unitdir_user}/default.target.wants
+ln -sf ../tbm-drm-user.path %{_unitdir_user}/default.target.wants/
+
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
-
+rm -f %{_unitdir}/graphical.target.wants/tbm-drm.path
+rm -f %{_unitdir_user}/default.target.wants/tbm-drm-user.path
%files
%manifest %{name}.manifest
@@ -77,5 +92,9 @@ rm -rf %{buildroot}
%{_includedir}/tbm_bufmgr_backend.h
%{_includedir}/tbm_type.h
%{_includedir}/tbm_drm_helper.h
+%{_unitdir}/tbm-drm.path
+%{_unitdir}/tbm-drm.service
+%{_unitdir_user}/tbm-drm-user.path
+%{_unitdir_user}/tbm-drm-user.service
%{_libdir}/libtbm.so
%{_libdir}/pkgconfig/libtbm.pc
diff --git a/service/tbm-drm-user.path b/service/tbm-drm-user.path
new file mode 100644
index 0000000..ede1f1b
--- /dev/null
+++ b/service/tbm-drm-user.path
@@ -0,0 +1,5 @@
+[Unit]
+Description=Wait for tbm-drm display daemon socket
+
+[Path]
+PathExists=/run/tbm_drm
diff --git a/service/tbm-drm-user.service b/service/tbm-drm-user.service
new file mode 100644
index 0000000..b0ca295
--- /dev/null
+++ b/service/tbm-drm-user.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Creating a link file for user to access tbm_drm
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/ln -sf /run/tbm_drm /run/user/%U/
diff --git a/service/tbm-drm.path b/service/tbm-drm.path
new file mode 100644
index 0000000..c0cd484
--- /dev/null
+++ b/service/tbm-drm.path
@@ -0,0 +1,5 @@
+[Unit]
+Description=Wait for tbm_drm daemon socket
+
+[Path]
+PathExists=/run/tbm_drm
diff --git a/service/tbm-drm.service b/service/tbm-drm.service
new file mode 100644
index 0000000..435aea1
--- /dev/null
+++ b/service/tbm-drm.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Display manager setup service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/chmod g+w /run/tbm_drm
+ExecStart=/usr/bin/chgrp display /run/tbm_drm
+ExecStart=/usr/bin/chsmack -a User /run/tbm_drm
+
+[Install]
+WantedBy=graphical.target