app-editors/emacs: Install systemd unit file.
authorUlrich Müller <ulm@gentoo.org>
Sun, 22 Sep 2019 16:13:52 +0000 (18:13 +0200)
committerUlrich Müller <ulm@gentoo.org>
Sun, 22 Sep 2019 16:16:15 +0000 (18:16 +0200)
Closes: 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/emacs-26.3-r1.ebuild [moved from app-editors/emacs/emacs-26.3.ebuild with 97% similarity]

similarity index 97%
rename from app-editors/emacs/emacs-26.3.ebuild
rename to app-editors/emacs/emacs-26.3-r1.ebuild
index 0e312adbbbb7ccf264a86f4a771343343e2f927a..40ca9d5801969f4e40162902fa67e4b2880e923e 100644 (file)
@@ -281,6 +281,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 \