From 7cff7b9a867359749c0869e00ceaa463f9440d7e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 29 Jun 2010 21:06:34 +0200 Subject: build-sys: install systemd .service file --- .gitignore | 1 + Makefile.am | 16 +++++++++++++--- configure.ac | 8 ++++++++ org.freedesktop.RealtimeKit1.service.in | 18 ++++++++++++++++++ rtkit-daemon.service.in | 28 ++++++++++++++++++++++++++++ 5 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 rtkit-daemon.service.in 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 . + [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 . + +[Unit] +Requires=basic.target +After=basic.target syslog.target + +[Service] +Exec=@LIBEXECDIR@/rtkit-daemon +Type=dbus +BusName=org.freedesktop.RealtimeKit1 + +[Install] +WantedBy=graphical.target -- cgit