commit:     a7b4a9e0582e55c49c0bcc3f22f9461b3ad0d0fa
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 27 20:41:50 2022 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Tue Sep 27 20:52:23 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7b4a9e0

dev-util/sccache: add systemd units

Closes: https://bugs.gentoo.org/825570
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 dev-util/sccache/files/sccache-scheduler.service | 10 ++++++++++
 dev-util/sccache/files/sccache-server.service    | 10 ++++++++++
 dev-util/sccache/sccache-0.3.0.ebuild            |  6 +++++-
 3 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/dev-util/sccache/files/sccache-scheduler.service 
b/dev-util/sccache/files/sccache-scheduler.service
new file mode 100644
index 000000000000..8def287f2e6d
--- /dev/null
+++ b/dev-util/sccache/files/sccache-scheduler.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=sccache-dist server
+Wants=network-online.target
+After=network-online.target
+
+[Service]
+ExecStart=/usr/bin/sccache-dist scheduler --config /etc/sccache/server.conf
+
+[Install]
+WantedBy=multi-user.target

diff --git a/dev-util/sccache/files/sccache-server.service 
b/dev-util/sccache/files/sccache-server.service
new file mode 100644
index 000000000000..b477cabe7d95
--- /dev/null
+++ b/dev-util/sccache/files/sccache-server.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=sccache-dist server
+Wants=network-online.target
+After=network-online.target
+
+[Service]
+ExecStart=/usr/bin/sccache-dist server --config /etc/sccache/server.conf
+
+[Install]
+WantedBy=multi-user.target

diff --git a/dev-util/sccache/sccache-0.3.0.ebuild 
b/dev-util/sccache/sccache-0.3.0.ebuild
index 9abbc8a316ba..ea511cc01281 100644
--- a/dev-util/sccache/sccache-0.3.0.ebuild
+++ b/dev-util/sccache/sccache-0.3.0.ebuild
@@ -308,7 +308,7 @@ zstd-safe-3.0.1+zstd.1.4.9
 zstd-sys-1.4.20+zstd.1.4.9
 "
 
-inherit cargo optfeature
+inherit cargo optfeature systemd
 
 DESCRIPTION="ccache/distcc like tool with support for rust and cloud storage"
 HOMEPAGE="https://github.com/mozilla/sccache/";
@@ -380,6 +380,10 @@ src_install() {
 
                newinitd "${FILESDIR}"/scheduler.initd sccache-scheduler
                newconfd "${FILESDIR}"/scheduler.confd sccache-scheduler
+
+               systemd_dounit "${FILESDIR}"/sccache-server.service
+               systemd_dounit "${FILESDIR}"/sccache-scheduler.service
+
        fi
 }
 

Reply via email to