[gentoo-commits] repo/gentoo:master commit in: net-p2p/mldonkey/files/, net-p2p/mldonkey/

2022-02-27 Thread Joonas Niilola
commit: 4d5ed7c028714d20734af683d45755a095840ec0
Author: Jesus P Rey (Chuso)  chuso  net>
AuthorDate: Mon Nov  1 18:40:55 2021 +
Commit: Joonas Niilola  gentoo  org>
CommitDate: Mon Feb 28 07:25:56 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d5ed7c0

net-p2p/mldonkey: rework init.d/service files

Add systemd service unit and remove obsolete settings from the OpenRC
script.

Signed-off-by: Jesus P Rey  chuso.net>
Closes: https://bugs.gentoo.org/480050
Closes: https://github.com/gentoo/gentoo/pull/22851
Signed-off-by: Joonas Niilola  gentoo.org>

 net-p2p/mldonkey/files/mldonkey.confd  |  22 +---
 net-p2p/mldonkey/files/mldonkey.initd  | 112 ++---
 net-p2p/mldonkey/files/mldonkey.service|  14 +++
 ...ey-3.1.7-r2.ebuild => mldonkey-3.1.7-r3.ebuild} |  25 ++---
 4 files changed, 33 insertions(+), 140 deletions(-)

diff --git a/net-p2p/mldonkey/files/mldonkey.confd 
b/net-p2p/mldonkey/files/mldonkey.confd
index 7cdb2b7134ed..509409b02232 100644
--- a/net-p2p/mldonkey/files/mldonkey.confd
+++ b/net-p2p/mldonkey/files/mldonkey.confd
@@ -9,7 +9,7 @@
 USER="p2p"
 
 # mldonkey's working dir (must be existing)
-MLDONKEY_DIR="/home/p2p/mldonkey"
+MLDONKEY_DIR="/var/lib/mldonkey"
 
 # logfile (/dev/null for nowhere)
 LOG="/var/log/mldonkey.log"
@@ -18,25 +18,5 @@ LOG="/var/log/mldonkey.log"
 # set log_to_syslog true
 USE_LOGGER=false
 
-# bandwidth control, values in kb/s
-LOW_DOWN="6"
-LOW_UP="2"
-HIGH_DOWN="30"
-HIGH_UP="10"
-
 # nice level, 0 less cpuspeed consumed
 NICE="19"
-
-# mldonkey server ip, usually localhost
-SERVER="localhost"
-
-# port for webinterface, usually 4080
-PORT="4080"
-
-# port for telnet interface, usually 4000
-TELNET_PORT="4000"
-
-# to enable password restricted access,
-# uncomment and set BOTH following vars:
-#USERNAME="admin"
-#PASSWORD=""

diff --git a/net-p2p/mldonkey/files/mldonkey.initd 
b/net-p2p/mldonkey/files/mldonkey.initd
index b7e561372392..c7fa3d5051c5 100644
--- a/net-p2p/mldonkey/files/mldonkey.initd
+++ b/net-p2p/mldonkey/files/mldonkey.initd
@@ -3,7 +3,6 @@
 extra_started_commands="reload slow fast info"
 
 MLDONKEY_BINARY=${MLDONKEY_BINARY:-/usr/bin/mlnet}
-MLDONKEY_TIMEOUT=${TIMEOUT:-10}
 
 depend() {
need localmount net
@@ -11,13 +10,16 @@ depend() {
 }
 
 start() {
+   if [ -n 
"${BASEDIR}${SUBDIR}${LOW_DOWN}${LOW_UP}${HIGH_DOWN}${HIGH_UP}${SERVER}${PORT}${TELNET_PORT}${USERNAME}${PASSWORD}${MLDONKEY_TIMEOUT}"
 ]; then
+   ewarn "The following settings are deprecated and will be 
ignored,"
+   ewarn "please remove them from /etc/conf.d/mldonkey:"
+   ewarn "LOW_DOWN LOW_UP HIGH_DOWN HIGH_UP SERVER PORT 
TELNET_PORT USERNAME PASSWORD MLDONKEY_TIMEOUT"
+   fi
+
if [ -z "${MLDONKEY_DIR}" ]; then
-   ewarn "mldonkey's start script has been changed. You should 
remove"
-   ewarn "BASEDIR and SUBDIR from /etc/conf.d/mldonkey and set 
MLDONKEY_DIR"
-   ewarn "to the correct value (you probably want"
-   ewarn "MLDONKEY_DIR=${BASEDIR}/${SUBDIR})"
-   MLDONKEY_DIR="${BASEDIR}/${SUBDIR}"
-   einfo "Using ${MLDONKEY_DIR} as working directory"
+   eerror "Please set MLDONKEY_DIR in /etc/conf.d/mldonkey to the 
directory"
+   eerror "where you want MLDonkey to save its files"
+   return 1
fi
 
if [ ! -d "${MLDONKEY_DIR}" ]; then
@@ -27,115 +29,21 @@ start() {
fi
 
ebegin "Starting ${SVCNAME}"
-   cd "${MLDONKEY_DIR}"
-   export MLDONKEY_DIR
start-stop-daemon --start --user "${USER}" --nice "${NICE}" \
--exec "${MLDONKEY_BINARY}" --pidfile /var/run/"${SVCNAME}".pid 
\
-   --background --make-pidfile
+   --env "MLDONKEY_DIR=${MLDONKEY_DIR}" --background --make-pidfile
eend $?
 }
 
-send_telnet_commands() {
-   if [ -z "${TELNET_PORT+x}" ]; then
-   return 1
-   fi
-   local cmds=
-   if [ -n "${USERNAME}" -a -n "${PASSWORD}" ]; then
-   cmds="auth ${USERNAME} ${PASSWORD}\n"
-   fi
-   cmds="$cmds\nansi false\n"
-   while [ $# -gt 0 ]; do
-   cmds="$cmds$1\n"
-   shift
-   done
-   printf "$cmds\nexit\n" | nc -w "${MLDONKEY_TIMEOUT}" localhost 
"${TELNET_PORT}" 2> /dev/null
-   return $?
-}
-
-send_http_commands() {
-   if [ -z "${PORT+x}" ]; then
-   return 1
-   fi
-   local base="http://;
-   if [ -n "${USERNAME}" -a -n "${PASSWORD}" ]; then
-   base="${base}${USERNAME}:${PASSWORD}@"
-   fi
-   base="${base}${SERVER}:${PORT}"
-   local retval=0
-   while [ $retval -eq 0 -a $# -gt 0 ]; do
-   wget -q -O /dev/stdout --timeout="${MLDONKEY_TIMEOUT}" 
"${base}/submit?q=${1// /+}" 2> /dev/null
-   retval=$?
-   shift
-   done
-   return 

[gentoo-commits] repo/gentoo:master commit in: net-p2p/mldonkey/files/, net-p2p/mldonkey/

2016-05-03 Thread Austin English
commit: 8c59488046d56db4e1a1cfbd86b979f91ac78e9e
Author: Austin English  gentoo  org>
AuthorDate: Tue May  3 17:09:56 2016 +
Commit: Austin English  gentoo  org>
CommitDate: Tue May  3 17:21:38 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c594880

net-p2p/mldonkey: use #!/sbin/openrc-run instead of #!/sbin/runscript

Gentoo-Bug: https://bugs.gentoo.org/573846

Package-Manager: portage-2.2.26

 net-p2p/mldonkey/files/mldonkey.initd |   2 +-
 net-p2p/mldonkey/mldonkey-3.1.5-r1.ebuild | 175 ++
 2 files changed, 176 insertions(+), 1 deletion(-)

diff --git a/net-p2p/mldonkey/files/mldonkey.initd 
b/net-p2p/mldonkey/files/mldonkey.initd
index 7a007de..12dd599 100644
--- a/net-p2p/mldonkey/files/mldonkey.initd
+++ b/net-p2p/mldonkey/files/mldonkey.initd
@@ -1,4 +1,4 @@
-#!/sbin/runscript
+#!/sbin/openrc-run
 
 extra_started_commands="reload slow fast info"
 

diff --git a/net-p2p/mldonkey/mldonkey-3.1.5-r1.ebuild 
b/net-p2p/mldonkey/mldonkey-3.1.5-r1.ebuild
new file mode 100644
index 000..7a35089
--- /dev/null
+++ b/net-p2p/mldonkey/mldonkey-3.1.5-r1.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="6"
+WANT_AUTOCONF=2.5
+
+inherit flag-o-matic eutils autotools toolchain-funcs user
+
+IUSE="bittorrent doc fasttrack gd gnutella gtk guionly magic +ocamlopt"
+
+DESCRIPTION="A multi-network P2P application written in Ocaml, with its own 
Gtk GUI, web and telnet interface"
+HOMEPAGE="http://mldonkey.sourceforge.net/;
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm hppa ~ia64 ppc ~sparc x86 ~x86-fbsd"
+
+RDEPEND="dev-lang/perl
+   dev-ml/camlp4:=
+   guionly? ( >=gnome-base/librsvg-2.4.0
+   >=dev-ml/lablgtk-2.6 )
+   gtk? ( >=gnome-base/librsvg-2.4.0
+   >=dev-ml/lablgtk-2.6[svg] )
+   gd? ( >=media-libs/gd-2.0.28[truetype] )
+   magic? ( sys-apps/file )"
+
+DEPEND="${RDEPEND}
+   >=dev-lang/ocaml-3.10.2[ocamlopt?]"
+
+MLUSER="p2p"
+
+pkg_setup() {
+   if use gtk; then
+   echo ""
+   einfo "If the compile with gui fails, and you have updated 
Ocaml"
+   einfo "recently, you may have forgotten that you need to run"
+   einfo "/usr/portage/dev-lang/ocaml/files/ocaml-rebuild.sh"
+   einfo "to learn which ebuilds you need to recompile"
+   einfo "each time you update Ocaml to a different version"
+   einfo "see the Ocaml ebuild for details"
+   echo ""
+   fi
+
+   # dev-lang/ocaml creates its own objects but calls gcc for linking, 
which will
+   # results in relocations if gcc wants to create a PIE executable
+   if gcc-specs-pie ; then
+   append-ldflags -nopie
+   ewarn "Ocaml generates its own native asm, you're using a PIE 
compiler"
+   ewarn "We have appended -nopie to ocaml build options"
+   ewarn "because linking an executable with pie while the objects 
are not pic will not work"
+   fi
+}
+
+src_prepare() {
+   cd "${S}"/config
+   eautoconf
+   cd "${S}"
+   use ocamlopt || sed -i -e "s/ocamlopt/idontwantocamlopt/g" 
"${S}/config/configure" || die "failed to disable ocamlopt"
+   eapply "${FILESDIR}/ocaml4.patch"
+   has_version '>=dev-lang/ocaml-4.03' && eapply 
"${FILESDIR}/ocaml-4.03.patch"
+
+   default
+}
+
+src_configure() {
+   # the dirs are not (yet) used, but it doesn't hurt to specify them 
anyway
+
+   # onlygui   Disable all nets support, build only chosen GUI
+
+   if use gtk || use guionly; then
+   myconf="--enable-gui=newgui2"
+   else
+   myconf="--disable-gui"
+   fi
+
+   if use guionly; then
+   myconf="${myconf} --disable-multinet --disable-donkey"
+   fi
+
+   cd "${S}"
+
+   local my_extra_libs
+   if use gd; then
+   my_extra_libs="-lpng"
+   fi
+
+   econf LIBS="${my_extra_libs}"\
+   --sysconfdir=/etc/mldonkey \
+   --sharedstatedir=/var/mldonkey \
+   --localstatedir=/var/mldonkey \
+   --enable-checks \
+   --disable-batch \
+   $(use_enable bittorrent) \
+   $(use_enable fasttrack) \
+   $(use_enable gnutella) \
+   $(use_enable gnutella gnutella2) \
+   $(use_enable gd) \
+   $(use_enable magic) \
+   ${myconf}
+}
+
+src_compile() {
+   export OCAMLRUNPARAM="l=256M"
+   emake
+
+   if ! use guionly; then
+   emake utils
+   fi;
+}
+
+src_install() {
+   local myext=""
+   use ocamlopt || myext=".byte"
+   use ocamlopt || export STRIP_MASK="*/bin/*"
+   if ! use guionly; then
+   for i