| 1 | # Copyright 1999-2011 Gentoo Foundation |
1 | # Copyright 1999-2011 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/systemd.eclass,v 1.6 2011/06/24 13:13:24 darkside Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/systemd.eclass,v 1.7 2011/07/28 13:47:50 zmedico Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: systemd.eclass |
5 | # @ECLASS: systemd.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # mgorny@gentoo.org |
7 | # mgorny@gentoo.org |
| 8 | # @BLURB: helper functions to install systemd units |
8 | # @BLURB: helper functions to install systemd units |
| … | |
… | |
| 45 | # @USAGE: unit1 [...] |
45 | # @USAGE: unit1 [...] |
| 46 | # @DESCRIPTION: |
46 | # @DESCRIPTION: |
| 47 | # Install systemd unit(s). Uses doins, thus it is fatal in EAPI 4 |
47 | # Install systemd unit(s). Uses doins, thus it is fatal in EAPI 4 |
| 48 | # and non-fatal in earlier EAPIs. |
48 | # and non-fatal in earlier EAPIs. |
| 49 | systemd_dounit() { |
49 | systemd_dounit() { |
|
|
50 | has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= |
| 50 | debug-print-function ${FUNCNAME} "${@}" |
51 | debug-print-function ${FUNCNAME} "${@}" |
| 51 | |
52 | |
| 52 | ( |
53 | ( |
| 53 | insinto "$(systemd_get_unitdir)" |
54 | local ud=$(systemd_get_unitdir) |
|
|
55 | insinto "${ud#${EPREFIX}}" |
| 54 | doins "${@}" |
56 | doins "${@}" |
| 55 | ) |
57 | ) |
| 56 | } |
58 | } |
| 57 | |
59 | |
| 58 | # @FUNCTION: systemd_newunit |
60 | # @FUNCTION: systemd_newunit |