diff --git a/net-mail/davmail-bin/davmail-bin-5.5.1.3299-r1.ebuild b/net-mail/davmail-bin/davmail-bin-5.5.1.3299-r1.ebuild index 6eed0f99f..68b360fda 100644 --- a/net-mail/davmail-bin/davmail-bin-5.5.1.3299-r1.ebuild +++ b/net-mail/davmail-bin/davmail-bin-5.5.1.3299-r1.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -inherit eutils java-pkg-2 desktop +inherit eutils java-pkg-2 desktop systemd #https://sourceforge.net/projects/davmail/files/davmail/ MY_PN="davmail" @@ -14,7 +14,7 @@ SRC_URI="mirror://sourceforge/${MY_PN}/${MY_PN}-$(ver_cut 1-3)-$(ver_cut 4).zip" LICENSE="GPL-2" SLOT="0" KEYWORDS="amd64 x86" -IUSE="server" +IUSE="server systemd" DEPEND="|| ( >=virtual/jre-1.6:* >=virtual/jdk-1.6:* @@ -37,6 +37,10 @@ src_install() { # create wrapper script for the client java-pkg_dolauncher ${MY_PN} --main ${MY_PN}.DavGateway --java_args "" + if use systemd ; then + systemd_install_serviced "${FILESDIR}"/davmail.service.conf + fi + if use server ; then # log file touch ${MY_PN}.log diff --git a/net-mail/davmail-bin/files/davmail.service.conf b/net-mail/davmail-bin/files/davmail.service.conf new file mode 100644 index 000000000..158cf5d4e --- /dev/null +++ b/net-mail/davmail-bin/files/davmail.service.conf @@ -0,0 +1,18 @@ +[Unit] +Description=Davmail Exchange gateway +Documentation=http://davmail.sourceforge.net/serversetup.html +Documentation=http://davmail.sourceforge.net/advanced.html +Documentation=http://davmail.sourceforge.net/sslsetup.html +After=network.target + +[Service] +Type=simple +User=davmail +PermissionsStartOnly=true +ExecStartPre=/usr/bin/touch /var/log/davmail.log +ExecStartPre=/bin/chown davmail:davmail /var/log/davmail.log +ExecStart=/usr/bin/davmail -server /etc/davmail.properties +SuccessExitStatus=143 + +[Install] +WantedBy=multi-user.target