summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2008-10-29 16:43:12 +0000
committerUlrich Müller <ulm@gentoo.org>2008-10-29 16:43:12 +0000
commitcdf48230e83789e4728840f22c55fe8e37fd474d (patch)
tree493b7458f19e1b0308595adb0d261f7e7c557ef3 /app-emacs
parentMove daemon support to app-emacs/emacs-daemon to avoid SLOT collisions. (diff)
downloademacs-cdf48230e83789e4728840f22c55fe8e37fd474d.tar.gz
emacs-cdf48230e83789e4728840f22c55fe8e37fd474d.tar.bz2
emacs-cdf48230e83789e4728840f22c55fe8e37fd474d.zip
Initial import.
svn path=/emacs-overlay/; revision=1185
Diffstat (limited to 'app-emacs')
-rw-r--r--app-emacs/emacs-daemon/ChangeLog10
-rw-r--r--app-emacs/emacs-daemon/Manifest5
-rw-r--r--app-emacs/emacs-daemon/emacs-daemon-0.1.ebuild33
-rw-r--r--app-emacs/emacs-daemon/files/emacs-daemon.conf4
-rw-r--r--app-emacs/emacs-daemon/files/emacs-daemon.rc43
-rw-r--r--app-emacs/emacs-daemon/metadata.xml5
6 files changed, 100 insertions, 0 deletions
diff --git a/app-emacs/emacs-daemon/ChangeLog b/app-emacs/emacs-daemon/ChangeLog
new file mode 100644
index 0000000..20ee2d6
--- /dev/null
+++ b/app-emacs/emacs-daemon/ChangeLog
@@ -0,0 +1,10 @@
+# ChangeLog for app-emacs/emacs-daemon
+# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*emacs-daemon-0.1 (29 Oct 2008)
+
+ 29 Oct 2008; Ulrich Mueller <ulm@gentoo.org> +files/emacs-daemon.conf,
+ +files/emacs-daemon.rc, +metadata.xml, +emacs-daemon-0.1.ebuild:
+ Initial import.
+
diff --git a/app-emacs/emacs-daemon/Manifest b/app-emacs/emacs-daemon/Manifest
new file mode 100644
index 0000000..eecbf5c
--- /dev/null
+++ b/app-emacs/emacs-daemon/Manifest
@@ -0,0 +1,5 @@
+AUX emacs-daemon.conf 121 RMD160 54fa96afc172f76d99048a39fdb8940a5ca73a8e SHA1 8b994cc7026ee835f37ab3f79627e8daf2198e51 SHA256 7a9ec630a5e781a03d7e0db05634719419a4b91f6dd09c32864e31d5476c8cb2
+AUX emacs-daemon.rc 998 RMD160 e43855433d2d1ca36f916465cdb88c9addf2d0e8 SHA1 93e48980d3438a1f7f6011d509f1fb96671f58ee SHA256 77818abc6bf12556fbc819ccd7ffd793449af7f4cbfcba935f1c2793dceb08ed
+EBUILD emacs-daemon-0.1.ebuild 891 RMD160 cc77b74777a9493fe311c5bea151ead4d2243cf3 SHA1 920d8c4f87442c328e90fd8fc9167e3113a03958 SHA256 88d72f55b564a3654b8c1f0f12bfe8b8759ba2eb659a25f914d0246741ccc888
+MISC ChangeLog 315 RMD160 9463b35f50e12695e32fc74dfd9868b2c4832a95 SHA1 50554800f940b77ae78ca9a2bc002159989c5840 SHA256 864aacab33c2950cda63b7837d43d3d6d53854f2c8de31ca7debef13b2b40d1b
+MISC metadata.xml 158 RMD160 415d172437ca754d24fc5ab186ba8e77934d96e4 SHA1 61f6eff9729cd87a725c2a70c81aca4270a17fc4 SHA256 1393bdef3a74343fdb40a112c7096a1af16f67e7a43413250de28dfe73810eab
diff --git a/app-emacs/emacs-daemon/emacs-daemon-0.1.ebuild b/app-emacs/emacs-daemon/emacs-daemon-0.1.ebuild
new file mode 100644
index 0000000..170394d
--- /dev/null
+++ b/app-emacs/emacs-daemon/emacs-daemon-0.1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+DESCRIPTION="Support files for Emacs daemon started as rc service"
+HOMEPAGE="http://www.gentoo.org/proj/en/lisp/emacs/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/emacs-23"
+RDEPEND="${DEPEND}
+ >=sys-apps/openrc-0.3.0-r1"
+
+EMACS="/usr/bin/emacs"
+
+pkg_setup() {
+ local has_daemon=$(${EMACS} -batch -q --no-site-file \
+ --eval "(princ (fboundp 'daemonp))")
+ if [ "${has_daemon}" != t ]; then
+ ewarn "The current Emacs version does not support running as a daemon"
+ ewarn "which is required for ${CATEGORY}/${P}."
+ ewarn "Use \"eselect emacs\" to select an Emacs version >= 23."
+ fi
+}
+
+src_install() {
+ newinitd "${FILESDIR}/emacs-daemon.rc" emacs-daemon || die
+ newconfd "${FILESDIR}/emacs-daemon.conf" emacs-daemon || die
+}
diff --git a/app-emacs/emacs-daemon/files/emacs-daemon.conf b/app-emacs/emacs-daemon/files/emacs-daemon.conf
new file mode 100644
index 0000000..bfd59b4
--- /dev/null
+++ b/app-emacs/emacs-daemon/files/emacs-daemon.conf
@@ -0,0 +1,4 @@
+# Config file for emacs-daemon
+
+# Space-separated list of users for whom an Emacs daemon should be started
+EMACSUSERS=""
diff --git a/app-emacs/emacs-daemon/files/emacs-daemon.rc b/app-emacs/emacs-daemon/files/emacs-daemon.rc
new file mode 100644
index 0000000..d9f84a3
--- /dev/null
+++ b/app-emacs/emacs-daemon/files/emacs-daemon.rc
@@ -0,0 +1,43 @@
+#!/sbin/runscript
+# $Header: $
+# Copyright 2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EMACS="/usr/bin/emacs"
+
+checkconfig() {
+ if [ -z "${EMACSUSERS}" ]; then
+ eerror "You must setup EMACSUSERS in /etc/conf.d/emacs-daemon first"
+ return 1
+ fi
+
+ local has_daemon=$(${EMACS} -batch -q --no-site-file \
+ --eval "(princ (fboundp 'daemonp))")
+ if [ "${has_daemon}" != t ]; then
+ eerror "${EMACS} does not support running as a daemon"
+ return 1
+ fi
+
+ return 0
+}
+
+start() {
+ local user dir fail=0
+ checkconfig || return 1
+
+ for user in ${EMACSUSERS}; do
+ ebegin "Starting Emacs daemon for ${user}"
+ eval dir="~${user}"
+ start-stop-daemon --start --user "${user}" --chdir "${dir}" \
+ --name emacs-daemon --exec "${EMACS}" -- --daemon &>/dev/null
+ eend $? || fail=1
+ done
+
+ return ${fail}
+}
+
+stop() {
+ ebegin "Stopping all Emacs daemons"
+ start-stop-daemon --stop --name emacs-daemon --exec "${EMACS}"
+ eend $?
+}
diff --git a/app-emacs/emacs-daemon/metadata.xml b/app-emacs/emacs-daemon/metadata.xml
new file mode 100644
index 0000000..bc306fe
--- /dev/null
+++ b/app-emacs/emacs-daemon/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>emacs</herd>
+</pkgmetadata>