summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-15 09:00:11 -0800
committerAnas Nashif <anas.nashif@intel.com>2013-02-13 19:44:42 -0800
commit4e1895d9bd25a41a00038eddd61b8c86eb62b711 (patch)
tree773b4d071ca07e33da48a963f12f95e115dc63fb
parent8a6bdafd86dccc85d9629b450693c40e2a506204 (diff)
downloadweston-4e1895d9bd25a41a00038eddd61b8c86eb62b711.tar.gz
weston-4e1895d9bd25a41a00038eddd61b8c86eb62b711.tar.bz2
weston-4e1895d9bd25a41a00038eddd61b8c86eb62b711.zip
add systemd service and target
-rw-r--r--packaging/weston.service9
-rw-r--r--packaging/weston.spec18
-rw-r--r--packaging/weston.target5
3 files changed, 30 insertions, 2 deletions
diff --git a/packaging/weston.service b/packaging/weston.service
new file mode 100644
index 00000000..fc928f02
--- /dev/null
+++ b/packaging/weston.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Weston
+Requires=dbus.socket
+
+[Service]
+ExecStart=/usr/bin/weston-launch
+
+[Install]
+WantedBy=weston.target
diff --git a/packaging/weston.spec b/packaging/weston.spec
index 455dfbe2..97434b82 100644
--- a/packaging/weston.spec
+++ b/packaging/weston.spec
@@ -1,3 +1,5 @@
+%define _unitdir_user /usr/lib/systemd/user
+
Name: weston
%define lname libweston
Version: 1.0.0
@@ -9,7 +11,9 @@ Url: http://weston.freedesktop.org/
#Git-Clone: git://anongit.freedesktop.org/wayland/weston
#Git-Web: http://cgit.freedesktop.org/wayland/weston/
-Source: %name-%version.tar.xz
+Source0: %name-%version.tar.xz
+Source1: weston.service
+Source2: weston.target
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: autoconf >= 2.64, automake >= 1.11
BuildRequires: gcc-c++
@@ -45,6 +49,7 @@ BuildRequires: pkgconfig(xcb)
BuildRequires: pkgconfig(xcb-xfixes)
BuildRequires: pkgconfig(xcursor)
BuildRequires: pkgconfig(glu) >= 9.0.0
+Requires(pre): /usr/sbin/groupadd
%description
Weston is the reference implementation of a Wayland compositor, and a
@@ -69,7 +74,12 @@ make %{?_smp_mflags};
%install
%make_install
-%post
+install -d %{buildroot}/%{_unitdir_user}/weston.target.wants
+install -m 644 %{SOURCE1} %{buildroot}%{_unitdir_user}/weston.service
+install -m 644 %{SOURCE2} %{buildroot}%{_unitdir_user}/weston.target
+ln -sf ../weston.service %{buildroot}/%{_unitdir_user}/weston.target.wants/
+
+%pre
getent group weston-launch >/dev/null || %{_sbindir}/groupadd -o -r weston-launch
%files
@@ -79,6 +89,10 @@ getent group weston-launch >/dev/null || %{_sbindir}/groupadd -o -r weston-launc
%_libexecdir/weston-*
%_libdir/weston
%_datadir/weston
+%{_unitdir_user}/weston.service
+%{_unitdir_user}/weston.target
+%{_unitdir_user}/weston.target.wants
+%{_unitdir_user}/weston.target.wants/weston.service
/usr/share/man/man1/weston.1.gz
%changelog
diff --git a/packaging/weston.target b/packaging/weston.target
new file mode 100644
index 00000000..27170474
--- /dev/null
+++ b/packaging/weston.target
@@ -0,0 +1,5 @@
+
+[Unit]
+Description=Weston Compositor
+Requires=dbus.socket
+AllowIsolate=true