pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/mldonkey Change this package to only install mldon...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e47fe32604b7
branches:  trunk
changeset: 486240:e47fe32604b7
user:      jmmv <jmmv%pkgsrc.org@localhost>
date:      Sat Dec 25 19:13:34 2004 +0000

description:
Change this package to only install mldonkey's core program and add a rc.d
script to ease its startup as an unprivileged user.  While here, split the
Makefile to help the forthcoming mldonkey-gui package.

This makes it very easy to run mldonkey on a dedicated server w/o X11.
Furthermore, this approach is similar to what other systems do (like Gentoo).

Bump PKGREVISION to 3.  Ok'ed by wiz@, the maintainer.

diffstat:

 net/mldonkey/DESCR             |   8 ++++-
 net/mldonkey/MESSAGE           |  12 +++++--
 net/mldonkey/Makefile          |  57 +++++++++++++----------------------------
 net/mldonkey/Makefile.common   |  34 +++++++++++++++++++++++++
 net/mldonkey/PLIST             |  10 +-----
 net/mldonkey/files/mldonkey.sh |  45 +++++++++++++++++++++++++--------
 6 files changed, 102 insertions(+), 64 deletions(-)

diffs (214 lines):

diff -r 84bb5ed496bf -r e47fe32604b7 net/mldonkey/DESCR
--- a/net/mldonkey/DESCR        Sat Dec 25 19:09:08 2004 +0000
+++ b/net/mldonkey/DESCR        Sat Dec 25 19:13:34 2004 +0000
@@ -1,4 +1,8 @@
 mldonkey is a client to access the eDonkey network, a peer-to-peer network
 particularly efficient for big files thanks to a multi-sources download
-protocol. It is written in Objective-Caml, and comes with its own GTK GUI,
-an HTTP interface and a telnet interface. It works on most UNIX platforms.
+protocol.  It is written in Objective-Caml, and comes with its own GTK GUI,
+an HTTP interface and a telnet interface.  It works on most UNIX platforms.
+
+This package provides the mldonkey's core, which can be accessed through a
+web browser.  You may want to install the mldonkey-gui package which provides
+a nice graphical interface to handle it.
diff -r 84bb5ed496bf -r e47fe32604b7 net/mldonkey/MESSAGE
--- a/net/mldonkey/MESSAGE      Sat Dec 25 19:09:08 2004 +0000
+++ b/net/mldonkey/MESSAGE      Sat Dec 25 19:13:34 2004 +0000
@@ -1,9 +1,13 @@
 ===========================================================================
-$NetBSD: MESSAGE,v 1.1.1.1 2003/03/31 15:57:35 jmmv Exp $
+$NetBSD: MESSAGE,v 1.2 2004/12/25 19:13:34 jmmv Exp $
 
-This package provides a wrapper to ease mldonkey's startup. You should use
-it to run mldonkey: ${PREFIX}/bin/mldonkey
+This package only installs mldonkey's core program, which does not have a
+GUI frontend.  To ease its management, it includes a rc.d startup script
+that will safely start the daemon as an independent and unprivileged user.
+Once started, you will be able to access it at a later time by accessing
+http://localhost:4080/.
 
-Do NOT run this program as root.
+However, if you want a GUI, install the mldonkey-gui package, which will
+be able to connect to a local core as well as a remote one.
 
 ===========================================================================
diff -r 84bb5ed496bf -r e47fe32604b7 net/mldonkey/Makefile
--- a/net/mldonkey/Makefile     Sat Dec 25 19:09:08 2004 +0000
+++ b/net/mldonkey/Makefile     Sat Dec 25 19:13:34 2004 +0000
@@ -1,50 +1,29 @@
-# $NetBSD: Makefile,v 1.24 2004/12/24 17:21:01 jmmv Exp $
+# $NetBSD: Makefile,v 1.25 2004/12/25 19:13:34 jmmv Exp $
 #
 
-DISTNAME=      mldonkey-2.5.21
-PKGREVISION=   2
-CATEGORIES=    net
-MASTER_SITES=  http://savannah.nongnu.org/download/mldonkey/
+.include "Makefile.common"
+
+PKGREVISION=           3
 
-MAINTAINER=    wiz%NetBSD.org@localhost
-HOMEPAGE=      http://www.nongnu.org/mldonkey/
-COMMENT=       Free peer-to-peer client with eDonkey support and more
+USE_PKGINSTALL=                YES
 
-GNU_CONFIGURE=         yes
-USE_BUILDLINK3=                yes
-USE_GNU_TOOLS+=                make
-USE_PERL5=             build
+CONFIGURE_ARGS+=       --disable-gui
+
+RCD_SCRIPTS=           mldonkey
 
-MLDONKEY_SUBST=                PREFIX="${PREFIX}"
-MLDONKEY_SUBST_SED=    ${MLDONKEY_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}
+BUILD_DEFS+=           MLDONKEY_GROUP MLDONKEY_HOME MLDONKEY_USER
+
+OWN_DIRS_PERMS=                ${MLDONKEY_HOME} ${MLDONKEY_USER} ${MLDONKEY_GROUP} 0700
 
-CONFIGURE_ENV+=                WGET=""
-CONFIGURE_ENV+=                ac_cv_prog_WGET="no"
-MAKE_ENV+=             BUILDLINK_PREFIX.pthread=${BUILDLINK_PREFIX.pthread}
-CONFIGURE_ARGS+=       --enable-pthread-lib
+PKG_GROUPS=            ${MLDONKEY_GROUP}
+PKG_USERS=             ${MLDONKEY_USER}:${MLDONKEY_GROUP}::Dedicated\\ mldonkey\\ server:${MLDONKEY_HOME}:${SH}
 
-UNLIMIT_RESOURCES=     stacksize
-
-pre-build:
-       ${SED} ${MLDONKEY_SUBST_SED} ${FILESDIR}/mldonkey.sh > \
-           ${WRKDIR}/mldonkey.sh
-       ${CHMOD} +x ${WRKDIR}/mldonkey.sh
+FILES_SUBST+=          MLDONKEY_GROUP="${MLDONKEY_GROUP}"
+FILES_SUBST+=          MLDONKEY_HOME="${MLDONKEY_HOME}"
+FILES_SUBST+=          MLDONKEY_USER="${MLDONKEY_USER}"
 
 do-install:
-       cd ${WRKDIR} && \
-           ${INSTALL_SCRIPT} mldonkey.sh ${PREFIX}/bin/mldonkey
-       cd ${WRKSRC} && \
-           ${INSTALL_PROGRAM_DIR} ${PREFIX}/libexec/mldonkey && \
-           ${INSTALL_PROGRAM} mlchat ${PREFIX}/libexec/mldonkey && \
-           ${INSTALL_PROGRAM} mlguistarter ${PREFIX}/libexec/mldonkey && \
-           ${INSTALL_PROGRAM} mlgui ${PREFIX}/libexec/mldonkey && \
-           ${INSTALL_PROGRAM} mlim ${PREFIX}/libexec/mldonkey && \
-           ${INSTALL_PROGRAM} mlnet ${PREFIX}/libexec/mldonkey && \
-           ${INSTALL_PROGRAM} mlnet+gui ${PREFIX}/libexec/mldonkey
+       ${INSTALL_PROGRAM_DIR} ${PREFIX}/libexec/mldonkey
+       ${INSTALL_PROGRAM} ${WRKSRC}/mlnet ${PREFIX}/libexec/mldonkey
 
-.include "../../archivers/bzip2/buildlink3.mk"
-.include "../../devel/zlib/buildlink3.mk"
-.include "../../lang/ocaml/buildlink3.mk"
-.include "../../x11/lablgtk/buildlink3.mk"
-.include "../../mk/pthread.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r 84bb5ed496bf -r e47fe32604b7 net/mldonkey/Makefile.common
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/mldonkey/Makefile.common      Sat Dec 25 19:13:34 2004 +0000
@@ -0,0 +1,34 @@
+# $NetBSD: Makefile.common,v 1.1 2004/12/25 19:13:34 jmmv Exp $
+#
+
+DISTNAME=      mldonkey-2.5.21
+CATEGORIES=    net
+MASTER_SITES=  http://savannah.nongnu.org/download/mldonkey/
+
+MAINTAINER=    wiz%NetBSD.org@localhost
+HOMEPAGE=      http://www.nongnu.org/mldonkey/
+COMMENT=       Free peer-to-peer client with eDonkey support and more
+
+DISTINFO_FILE=         ${.CURDIR}/../../net/mldonkey/distinfo
+PATCHDIR=              ${.CURDIR}/../../net/mldonkey/patches
+
+GNU_CONFIGURE=         yes
+USE_BUILDLINK3=                yes
+USE_GNU_TOOLS+=                make
+USE_PERL5=             build
+
+CONFIGURE_ENV+=                WGET=""
+CONFIGURE_ENV+=                ac_cv_prog_WGET="no"
+MAKE_ENV+=             BUILDLINK_PREFIX.pthread=${BUILDLINK_PREFIX.pthread}
+CONFIGURE_ARGS+=       --enable-pthread-lib
+
+UNLIMIT_RESOURCES=     stacksize
+
+PRINT_PLIST_AWK+=      /^@dirrm libexec\/mldonkey$$/ \
+                               { print "@unexec $${RMDIR} %D/libexec/mldonkey"\
+                                 " >/dev/null 2>&1 || $${TRUE}"; next }
+
+.include "../../archivers/bzip2/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../lang/ocaml/buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
diff -r 84bb5ed496bf -r e47fe32604b7 net/mldonkey/PLIST
--- a/net/mldonkey/PLIST        Sat Dec 25 19:09:08 2004 +0000
+++ b/net/mldonkey/PLIST        Sat Dec 25 19:13:34 2004 +0000
@@ -1,9 +1,3 @@
-@comment $NetBSD: PLIST,v 1.2 2003/05/19 12:52:58 wiz Exp $
-bin/mldonkey
-libexec/mldonkey/mlchat
-libexec/mldonkey/mlgui
-libexec/mldonkey/mlguistarter
-libexec/mldonkey/mlim
+@comment $NetBSD: PLIST,v 1.3 2004/12/25 19:13:34 jmmv Exp $
 libexec/mldonkey/mlnet
-libexec/mldonkey/mlnet+gui
-@dirrm libexec/mldonkey
+@unexec ${RMDIR} %D/libexec/mldonkey >/dev/null 2>&1 || ${TRUE}
diff -r 84bb5ed496bf -r e47fe32604b7 net/mldonkey/files/mldonkey.sh
--- a/net/mldonkey/files/mldonkey.sh    Sat Dec 25 19:09:08 2004 +0000
+++ b/net/mldonkey/files/mldonkey.sh    Sat Dec 25 19:13:34 2004 +0000
@@ -1,16 +1,39 @@
-#!/bin/sh
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: mldonkey.sh,v 1.3 2004/12/25 19:13:34 jmmv Exp $
 #
-# $NetBSD: mldonkey.sh,v 1.2 2003/05/19 12:52:59 wiz Exp $
-#
-# pkgsrc script to ease mldonkey's startup.
+# KEYWORD: shutdown
+# PROVIDE: mldonkey
+# REQUIRE: DAEMON
 #
 
-if [ ! -d $HOME/mldonkey ]; then
-       echo "Creating user's directory ($HOME/mldonkey)..."
-       mkdir $HOME/mldonkey
+if [ -f /etc/rc.subr ]; then
+       . /etc/rc.subr
 fi
 
-echo "Starting mldonkey..."
-cd $HOME/mldonkey
-PATH=@PREFIX@/libexec/mldonkey:$PATH
-@PREFIX@/libexec/mldonkey/mlnet > $HOME/mldonkey/log 2>&1
+name="mldonkey"
+rcvar=${name}
+command="@PREFIX@/libexec/mldonkey/mlnet"
+command_args=">@MLDONKEY_HOME@/log 2>&1 &"
+required_dirs="@MLDONKEY_HOME@"
+mldonkey_chdir="@MLDONKEY_HOME@"
+mldonkey_group="@MLDONKEY_GROUP@"
+mldonkey_user="@MLDONKEY_USER@"
+start_cmd="mldonkey_start"
+
+mldonkey_start() {
+       if [ -f /etc/rc.subr ]; then
+               @ECHO@ "Starting mldonkey."
+       else
+               @ECHO@ " ${name}"
+       fi
+       @SU@ -l ${mldonkey_user} \
+            -c "${command} ${mldonkey_flags} ${command_args}" &
+}
+
+if [ -f /etc/rc.subr ]; then
+       load_rc_config ${name}
+       run_rc_command "${1}"
+else
+       mldonkey_start
+fi



Home | Main Index | Thread Index | Old Index