app-editors/emacs-vcs: Install systemd unit file.
authorUlrich Müller <ulm@gentoo.org>
Sun, 22 Sep 2019 16:14:54 +0000 (18:14 +0200)
committerUlrich Müller <ulm@gentoo.org>
Sun, 22 Sep 2019 16:16:16 +0000 (18:16 +0200)
Bug: https://bugs.gentoo.org/694542
Package-Manager: Portage-2.3.76, Repoman-2.3.17
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
app-editors/emacs-vcs/emacs-vcs-26.3.9999.ebuild
app-editors/emacs-vcs/emacs-vcs-27.0.9999.ebuild

index 03b0618a410f0969d0470a3cd9dfbc345c05376d..bc37463010be9d7200af53c6d1e72e996a442ebe 100644 (file)
@@ -304,6 +304,15 @@ src_install () {
        # remove COPYING file (except for etc/COPYING used by describe-copying)
        rm "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp/COPYING
 
+       if use systemd; then
+               insinto /usr/lib/systemd/user
+               sed -e "/^##/d" \
+                       -e "/^ExecStart/s,emacs,${EPREFIX}/usr/bin/${EMACS_SUFFIX}," \
+                       -e "/^ExecStop/s,emacsclient,${EPREFIX}/usr/bin/&-${EMACS_SUFFIX}," \
+                       etc/emacs.service | newins - ${EMACS_SUFFIX}.service
+               assert
+       fi
+
        if use gzip-el; then
                # compress .el files when a corresponding .elc exists
                find "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp -type f \
index cb262d172dd215696d0ea82f13fe06aae8c7cd0c..3ee98c8520ad7309131d1ff6eef51830e14839db 100644 (file)
@@ -311,6 +311,15 @@ src_install () {
        # remove COPYING file (except for etc/COPYING used by describe-copying)
        rm "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp/COPYING
 
+       if use systemd; then
+               insinto /usr/lib/systemd/user
+               sed -e "/^##/d" \
+                       -e "/^ExecStart/s,emacs,${EPREFIX}/usr/bin/${EMACS_SUFFIX}," \
+                       -e "/^ExecStop/s,emacsclient,${EPREFIX}/usr/bin/&-${EMACS_SUFFIX}," \
+                       etc/emacs.service | newins - ${EMACS_SUFFIX}.service
+               assert
+       fi
+
        if use gzip-el; then
                # compress .el files when a corresponding .elc exists
                find "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp -type f \