commit:     80361f8e4bac09ee90d24c9a8f271baf593cf1aa
Author:     iamdenchik <bazukajo <AT> gmail <DOT> com>
AuthorDate: Fri Apr 26 10:47:25 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jun 28 07:37:45 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80361f8e

dev-lang/erlang: Move command_args to conf.d

Signed-off-by: Denis Pershin <bazukajo <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/11830
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-lang/erlang/erlang-22.0.2-r1.ebuild | 148 ++++++++++++++++++++++++++++++++
 dev-lang/erlang/files/epmd.confd        |   2 +
 dev-lang/erlang/files/epmd.init-r1      |  24 ++++++
 3 files changed, 174 insertions(+)

diff --git a/dev-lang/erlang/erlang-22.0.2-r1.ebuild 
b/dev-lang/erlang/erlang-22.0.2-r1.ebuild
new file mode 100644
index 00000000000..2c99593513a
--- /dev/null
+++ b/dev-lang/erlang/erlang-22.0.2-r1.ebuild
@@ -0,0 +1,148 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+WX_GTK_VER="3.0"
+
+inherit eapi7-ver elisp-common java-pkg-opt-2 systemd wxwidgets
+
+# NOTE: If you need symlinks for binaries please tell maintainers or
+# open up a bug to let it be created.
+
+UPSTREAM_V="$(ver_cut 1-2)"
+
+DESCRIPTION="Erlang programming language, runtime environment and libraries 
(OTP)"
+HOMEPAGE="https://www.erlang.org/";
+SRC_URI="https://github.com/erlang/otp/archive/OTP-${PV}.tar.gz -> ${P}.tar.gz
+       http://erlang.org/download/otp_doc_man_${UPSTREAM_V}.tar.gz -> 
${PN}_doc_man_${UPSTREAM_V}.tar.gz
+       doc? ( http://erlang.org/download/otp_doc_html_${UPSTREAM_V}.tar.gz -> 
${PN}_doc_html_${UPSTREAM_V}.tar.gz )"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 
~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris"
+IUSE="doc emacs +hipe java +kpoll libressl odbc sctp ssl systemd tk wxwidgets"
+
+RDEPEND="
+       sys-libs/ncurses:0
+       sys-libs/zlib
+       emacs? ( virtual/emacs )
+       java? ( >=virtual/jdk-1.8:* )
+       odbc? ( dev-db/unixODBC )
+       sctp? ( net-misc/lksctp-tools )
+       ssl? (
+               !libressl? ( >=dev-libs/openssl-0.9.7d:0= )
+               libressl? ( dev-libs/libressl:0= )
+       )
+       systemd? ( sys-apps/systemd )
+       tk? ( dev-lang/tk:0 )
+       wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X,opengl] )
+"
+DEPEND="${RDEPEND}
+       dev-lang/perl
+"
+
+S="${WORKDIR}/otp-OTP-${PV}"
+
+PATCHES=(
+       "${FILESDIR}/18.2.1-wx3.0.patch"
+       "${FILESDIR}/${PN}-22.0-dont-ignore-LDFLAGS.patch"
+       "${FILESDIR}/${PN}-add-epmd-pid-file-creation-for-openrc.patch"
+)
+
+SITEFILE=50"${PN}"-gentoo.el
+
+src_prepare() {
+       default
+
+       ./otp_build autoconf
+}
+
+src_configure() {
+       use wxwidgets && setup-wxwidgets
+
+       local myconf=(
+               --disable-builtin-zlib
+               $(use_enable hipe)
+               $(use_enable kpoll kernel-poll)
+               $(use_with java javac)
+               $(use_enable sctp)
+               $(use_with ssl ssl "${EPREFIX}"/usr)
+               $(use_enable ssl dynamic-ssl-lib)
+               $(usex wxwidgets "--with-wx-config=${WX_CONFIG}" 
"--with-wxdir=/dev/null")
+       )
+       econf "${myconf[@]}"
+}
+
+src_compile() {
+       emake
+
+       if use emacs ; then
+               pushd lib/tools/emacs &>/dev/null || die
+               elisp-compile *.el
+               popd &>/dev/null || die
+       fi
+}
+
+extract_version() {
+       local path="$1"
+       local var_name="$2"
+       sed -n -e "/^${var_name} = \(.*\)$/s::\1:p" "${S}/${path}/vsn.mk" || 
die "extract_version() failed"
+}
+
+src_install() {
+       local erl_libdir_rel="$(get_libdir)/erlang"
+       local erl_libdir="/usr/${erl_libdir_rel}"
+       local erl_interface_ver="$(extract_version lib/erl_interface EI_VSN)"
+       local erl_erts_ver="$(extract_version erts VSN)"
+       local my_manpath="/usr/share/${PN}/man"
+
+       [[ -z "${erl_erts_ver}" ]] && die "Couldn't determine erts version"
+       [[ -z "${erl_interface_ver}" ]] && die "Couldn't determine interface 
version"
+
+       emake INSTALL_PREFIX="${D}" install
+
+       if use doc ; then
+               local DOCS=( "AUTHORS" "HOWTO"/* "README.md" "CONTRIBUTING.md" 
"${WORKDIR}"/doc/. "${WORKDIR}"/lib/. "${WORKDIR}"/erts-* )
+               docompress -x /usr/share/doc/${PF}
+       else
+               local DOCS=("README.md")
+       fi
+
+       einstalldocs
+
+       dosym "../${erl_libdir_rel}/bin/erl" /usr/bin/erl
+       dosym "../${erl_libdir_rel}/bin/erlc" /usr/bin/erlc
+       dosym "../${erl_libdir_rel}/bin/escript" /usr/bin/escript
+       dosym 
"../${erl_libdir_rel}/lib/erl_interface-${erl_interface_ver}/bin/erl_call" 
/usr/bin/erl_call
+       dosym "../${erl_libdir_rel}/erts-${erl_erts_ver}/bin/beam.smp" 
/usr/bin/beam.smp
+
+       ## Clean up the no longer needed files
+       rm "${ED}/${erl_libdir}/Install" || die
+
+       insinto "${my_manpath}"
+       doins -r "${WORKDIR}"/man/*
+       # extend MANPATH, so the normal man command can find it
+       # see bug 189639
+       newenvd - "90erlang" <<-_EOF_
+               MANPATH="${my_manpath}"
+       _EOF_
+
+       if use emacs ; then
+               elisp-install erlang lib/tools/emacs/*.{el,elc}
+               sed -e "s:/usr/share:${EPREFIX}/usr/share:g" \
+                       "${FILESDIR}/${SITEFILE}" > "${T}/${SITEFILE}" || die
+               elisp-site-file-install "${T}/${SITEFILE}"
+       fi
+
+       newinitd "${FILESDIR}"/epmd.init-r1 epmd
+       newconfd "${FILESDIR}"/epmd.confd epmd
+       use systemd && systemd_dounit "${FILESDIR}"/epmd.service
+}
+
+pkg_postinst() {
+       use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+       use emacs && elisp-site-regen
+}

diff --git a/dev-lang/erlang/files/epmd.confd b/dev-lang/erlang/files/epmd.confd
new file mode 100644
index 00000000000..aa4dc3eb5ae
--- /dev/null
+++ b/dev-lang/erlang/files/epmd.confd
@@ -0,0 +1,2 @@
+#arguments for run erlang
+command_args="--daemon -relaxed_command_check -address 127.0.0.1"

diff --git a/dev-lang/erlang/files/epmd.init-r1 
b/dev-lang/erlang/files/epmd.init-r1
new file mode 100644
index 00000000000..bdd441b997a
--- /dev/null
+++ b/dev-lang/erlang/files/epmd.init-r1
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Foundation
+# Distributed under the terms of the Erlang Public License 1.1
+
+pidfile="/var/run/epmd.pid"
+
+depend() {
+       need loopback
+       before sshd
+}
+
+start() {
+       ebegin "Starting Erlang Port Mapper Daemon"
+       start-stop-daemon --start --quiet \
+               --pidfile "${pidfile}" \
+               --exec /usr/bin/epmd -- $command_args
+       eend $?
+}
+
+stop() {
+       ebegin "Stopping Erlang Port Mapper Daemon"
+       /usr/bin/epmd -kill >/dev/null
+       eend $?
+}

Reply via email to