summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-06-29 21:06:34 +0200
committerLennart Poettering <lennart@poettering.net>2010-06-29 21:06:34 +0200
commit7cff7b9a867359749c0869e00ceaa463f9440d7e (patch)
tree1584346ec39bf3144455232023a03f87506b3545
parent6075780a5c34d5a41436b75caa77bef8d22075d4 (diff)
build-sys: install systemd .service file
-rw-r--r--.gitignore1
-rw-r--r--Makefile.am16
-rw-r--r--configure.ac8
-rw-r--r--org.freedesktop.RealtimeKit1.service.in18
-rw-r--r--rtkit-daemon.service.in28
5 files changed, 68 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 8ecc940..d7d554c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+rtkit-daemon.service
stamp*
*.tar.gz
.deps/
diff --git a/Makefile.am b/Makefile.am
index 725c191..73d9104 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,10 +27,12 @@ EXTRA_DIST = \
LICENSE \
org.freedesktop.RealtimeKit1.policy \
org.freedesktop.RealtimeKit1.conf \
- org.freedesktop.RealtimeKit1.service.in
+ org.freedesktop.RealtimeKit1.service.in \
+ rtkit-daemon.service.in
CLEANFILES = \
- org.freedesktop.RealtimeKit1.service
+ org.freedesktop.RealtimeKit1.service \
+ rtkit-daemon.service
libexec_PROGRAMS = \
rtkit-daemon
@@ -45,6 +47,11 @@ dbussystem_DATA = \
dbusservice_DATA = \
org.freedesktop.RealtimeKit1.service
+if HAVE_SYSTEMD
+systemdsystemunit_DATA = \
+ rtkit-daemon.service
+endif
+
rtkit_daemon_SOURCES = \
rtkit-daemon.c rtkit.h
rtkit_daemon_LDADD = \
@@ -67,7 +74,10 @@ rtkit_test_CFLAGS = \
$(DBUS_CFLAGS)
org.freedesktop.RealtimeKit1.service: org.freedesktop.RealtimeKit1.service.in
- sed -e 's,@LIBEXECDIR\@,$(libexecdir),g' < $< > $@
+ $(AM_V_GEN)sed -e 's,@LIBEXECDIR\@,$(libexecdir),g' < $< > $@
+
+rtkit-daemon.service: rtkit-daemon.service.in
+ $(AM_V_GEN)sed -e 's,@LIBEXECDIR\@,$(libexecdir),g' < $< > $@
man8_MANS = rtkitctl.8
diff --git a/configure.ac b/configure.ac
index e425708..0166359 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,6 +89,13 @@ AC_SEARCH_LIBS([cap_init], [cap])
PKG_CHECK_MODULES(DBUS, dbus-1)
+AC_ARG_WITH([systemdsystemunitdir],
+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
+ [],
+ [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"])
+
###################################
# Output #
###################################
@@ -106,4 +113,5 @@ echo "
localstatedir: ${localstatedir}
Compiler: ${CC}
CFLAGS: ${CFLAGS}
+ systemd unit directory: ${systemdsystemunitdir}
"
diff --git a/org.freedesktop.RealtimeKit1.service.in b/org.freedesktop.RealtimeKit1.service.in
index 20ab334..9a4dd38 100644
--- a/org.freedesktop.RealtimeKit1.service.in
+++ b/org.freedesktop.RealtimeKit1.service.in
@@ -1,4 +1,22 @@
+# This file is part of RealtimeKit.
+#
+# Copyright 2009 Lennart Poettering
+#
+# RealtimeKit is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# RealtimeKit is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with RealtimeKit. If not, see <http://www.gnu.org/licenses/>.
+
[D-BUS Service]
Name=org.freedesktop.RealtimeKit1
Exec=@LIBEXECDIR@/rtkit-daemon
+SystemdService=rtkit-daemon.service
User=root
diff --git a/rtkit-daemon.service.in b/rtkit-daemon.service.in
new file mode 100644
index 0000000..2608f6c
--- /dev/null
+++ b/rtkit-daemon.service.in
@@ -0,0 +1,28 @@
+# This file is part of RealtimeKit.
+#
+# Copyright 2010 Lennart Poettering
+#
+# RealtimeKit is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# RealtimeKit is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with RealtimeKit. If not, see <http://www.gnu.org/licenses/>.
+
+[Unit]
+Requires=basic.target
+After=basic.target syslog.target
+
+[Service]
+Exec=@LIBEXECDIR@/rtkit-daemon
+Type=dbus
+BusName=org.freedesktop.RealtimeKit1
+
+[Install]
+WantedBy=graphical.target