From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] dev/mgorny:master commit in: eclass/
Date: Sun, 17 Apr 2011 19:41:01 +0000 (UTC) [thread overview]
Message-ID: <8eebcbc64168a88c4a4ebd0281f7bbcef3874901.mgorny@gentoo> (raw)
commit: 8eebcbc64168a88c4a4ebd0281f7bbcef3874901
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 17 19:41:01 2011 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Apr 17 19:41:01 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=8eebcbc6
systemd.eclass: initial version of the helper eclass.
---
eclass/systemd.eclass | 55 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 deletions(-)
diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
new file mode 100644
index 0000000..d5d90ee
--- /dev/null
+++ b/eclass/systemd.eclass
@@ -0,0 +1,55 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# @ECLASS: systemd.eclass
+# @MAINTAINER:
+# mgorny@gentoo.org
+# @BLURB: helper functions to install systemd units
+# @DESCRIPTION:
+# This eclass provides a set of functions to install unit files for
+# sys-apps/systemd within ebuilds.
+
+inherit multilib
+
+case ${EAPI:-0} in
+ 0|1|2|3|4) ;;
+ *) die "EAPI ${EAPI} unsupported."
+esac
+
+# @FUNCTION: systemd_get_unitdir
+# @DESCRIPTION:
+# Output the path for the systemd unit directory (not including ${D}).
+systemd_get_unitdir() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ echo /$(get_libdir)/systemd/system
+}
+
+# @FUNCTION: systemd_dounit
+# @USAGE: unit1 [...]
+# @DESCRIPTION:
+# Install systemd unit(s).
+systemd_dounit() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ (
+ insinto "$(systemd_get_unitdir)"
+ doins "${@}"
+ )
+}
+
+# @FUNCTION: systemd_enable_service
+# @USAGE: target service
+# @DESCRIPTION:
+# Enable service in desired target, e.g. install a symlink for it.
+systemd_enable_service() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ local target=${1}
+ local service=${2}
+ local ud=$(systemd_get_unitdir)
+
+ dodir "${ud}"/"${target}".wants && \
+ dosym ../"${service}" "${ud}"/"${target}".wants
+}
next reply other threads:[~2011-04-17 19:41 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-17 19:41 Michał Górny [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-04-28 14:02 [gentoo-commits] dev/mgorny:master commit in: eclass/ Michał Górny
2011-04-28 14:33 Michał Górny
2011-04-28 14:33 Michał Górny
2011-04-28 16:33 Michał Górny
2011-04-30 6:45 Michał Górny
2011-04-30 6:45 Michał Górny
2011-04-30 6:45 Michał Górny
2011-04-30 6:45 Michał Górny
2011-04-30 21:14 Michał Górny
2011-09-18 9:42 Michał Górny
2011-11-29 21:41 Michał Górny
2011-11-29 21:41 Michał Górny
2011-12-05 8:36 Michał Górny
2011-12-05 8:38 Michał Górny
2011-12-05 8:38 Michał Górny
2011-12-05 8:38 Michał Górny
2011-12-05 8:38 Michał Górny
2011-12-05 8:38 Michał Górny
2011-12-05 8:38 Michał Górny
2011-12-05 8:38 Michał Górny
2011-12-29 20:25 Michał Górny
2012-01-07 22:36 Michał Górny
2012-01-07 22:36 Michał Górny
2012-01-07 22:36 Michał Górny
2012-01-07 22:36 Michał Górny
2012-01-08 16:32 Michał Górny
2012-01-14 21:22 Michał Górny
2012-01-14 21:22 Michał Górny
2012-01-14 21:22 Michał Górny
2012-05-21 17:32 Michał Górny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8eebcbc64168a88c4a4ebd0281f7bbcef3874901.mgorny@gentoo \
--to=mgorny@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox