Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: Gentoo Developer Mailing List <gentoo-dev@l.g.o>
Subject: [gentoo-dev] [PATCH systemd.eclass] Do not install systemd units on BSD
Date: Wed, 11 Jul 2012 17:59:13
Message-Id: 20120711195820.5a6a5070@pomiocik.lan
1 Index: systemd.eclass
2 ===================================================================
3 RCS file: /var/cvsroot/gentoo-x86/eclass/systemd.eclass,v
4 retrieving revision 1.11
5 diff -u -B -d -u -p -r1.11 systemd.eclass
6 --- systemd.eclass 7 Jan 2012 17:53:47 -0000 1.11
7 +++ systemd.eclass 11 Jul 2012 17:56:56 -0000
8 @@ -34,6 +34,10 @@ esac
9 DEPEND="!<sys-apps/systemd-29-r4
10 !=sys-apps/systemd-37-r1"
11
12 +# systemd does not support non-Linux systems
13 +# so we won't install unit files for them.
14 +IUSE="kernel_linux"
15 +
16 # @FUNCTION: _systemd_get_unitdir
17 # @INTERNAL
18 # @DESCRIPTION:
19 @@ -61,6 +65,8 @@ systemd_get_unitdir() {
20 systemd_dounit() {
21 debug-print-function ${FUNCNAME} "${@}"
22
23 + use kernel_linux || return 0
24 +
25 (
26 insinto "$(_systemd_get_unitdir)"
27 doins "${@}"
28 @@ -75,6 +81,8 @@ systemd_dounit() {
29 systemd_newunit() {
30 debug-print-function ${FUNCNAME} "${@}"
31
32 + use kernel_linux || return 0
33 +
34 (
35 insinto "$(_systemd_get_unitdir)"
36 newins "${@}"
37 @@ -106,6 +114,8 @@ systemd_enable_service() {
38
39 [[ ${#} -eq 2 ]] || die "Synopsis: systemd_enable_service target service"
40
41 + use kernel_linux || return 0
42 +
43 local target=${1}
44 local service=${2}
45 local ud=$(_systemd_get_unitdir)
46 @@ -131,7 +141,11 @@ systemd_with_unitdir() {
47 debug-print-function ${FUNCNAME} "${@}"
48 local optname=${1:-systemdsystemunitdir}
49
50 - echo -n --with-${optname}="$(systemd_get_unitdir)"
51 + if use kernel_linux; then
52 + echo -n --with-${optname}="$(systemd_get_unitdir)"
53 + else
54 + echo -n --without-${optname}
55 + fi
56 }
57
58 # @FUNCTION: systemd_to_myeconfargs
59 @@ -142,8 +156,13 @@ systemd_with_unitdir() {
60 systemd_to_myeconfargs() {
61 debug-print-function ${FUNCNAME} "${@}"
62
63 - myeconfargs=(
64 - "${myeconfargs[@]}"
65 - --with-systemdsystemunitdir="$(systemd_get_unitdir)"
66 - )
67 + if use kernel_linux; then
68 + myeconfargs+=(
69 + --with-systemdsystemunitdir="$(systemd_get_unitdir)"
70 + )
71 + else
72 + myeconfargs+=(
73 + --without-systemdsystemunitdir
74 + )
75 + fi
76 }

Attachments

File name MIME type
signature.asc application/pgp-signature