summaryrefslogtreecommitdiff
path: root/net/mldonkey
diff options
context:
space:
mode:
authorjmmv <jmmv>2004-12-25 19:13:34 +0000
committerjmmv <jmmv>2004-12-25 19:13:34 +0000
commit23abc7a48089fa9ce950c1d1a4c1c0059d4105c1 (patch)
treea087cc508cc90b07450147ae0526cb3fe8fad183 /net/mldonkey
parentdeb15090c99fb3bdafa90b6f2e5c98d86da810bf (diff)
downloadpkgsrc-23abc7a48089fa9ce950c1d1a4c1c0059d4105c1.tar.gz
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 (limited to 'net/mldonkey')
-rw-r--r--net/mldonkey/DESCR8
-rw-r--r--net/mldonkey/MESSAGE12
-rw-r--r--net/mldonkey/Makefile57
-rw-r--r--net/mldonkey/Makefile.common34
-rw-r--r--net/mldonkey/PLIST10
-rw-r--r--net/mldonkey/files/mldonkey.sh43
6 files changed, 101 insertions, 63 deletions
diff --git a/net/mldonkey/DESCR b/net/mldonkey/DESCR
index 010179c9b6b..ccd64c3d321 100644
--- a/net/mldonkey/DESCR
+++ b/net/mldonkey/DESCR
@@ -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 --git a/net/mldonkey/MESSAGE b/net/mldonkey/MESSAGE
index b752f68b858..0196329338e 100644
--- a/net/mldonkey/MESSAGE
+++ b/net/mldonkey/MESSAGE
@@ -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 --git a/net/mldonkey/Makefile b/net/mldonkey/Makefile
index d4eda9c9f83..769a4dd0f56 100644
--- a/net/mldonkey/Makefile
+++ b/net/mldonkey/Makefile
@@ -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"
-MAINTAINER= wiz@NetBSD.org
-HOMEPAGE= http://www.nongnu.org/mldonkey/
-COMMENT= Free peer-to-peer client with eDonkey support and more
+PKGREVISION= 3
-GNU_CONFIGURE= yes
-USE_BUILDLINK3= yes
-USE_GNU_TOOLS+= make
-USE_PERL5= build
+USE_PKGINSTALL= YES
-MLDONKEY_SUBST= PREFIX="${PREFIX}"
-MLDONKEY_SUBST_SED= ${MLDONKEY_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}
+CONFIGURE_ARGS+= --disable-gui
-CONFIGURE_ENV+= WGET=""
-CONFIGURE_ENV+= ac_cv_prog_WGET="no"
-MAKE_ENV+= BUILDLINK_PREFIX.pthread=${BUILDLINK_PREFIX.pthread}
-CONFIGURE_ARGS+= --enable-pthread-lib
+RCD_SCRIPTS= mldonkey
-UNLIMIT_RESOURCES= stacksize
+BUILD_DEFS+= MLDONKEY_GROUP MLDONKEY_HOME MLDONKEY_USER
-pre-build:
- ${SED} ${MLDONKEY_SUBST_SED} ${FILESDIR}/mldonkey.sh > \
- ${WRKDIR}/mldonkey.sh
- ${CHMOD} +x ${WRKDIR}/mldonkey.sh
+OWN_DIRS_PERMS= ${MLDONKEY_HOME} ${MLDONKEY_USER} ${MLDONKEY_GROUP} 0700
+
+PKG_GROUPS= ${MLDONKEY_GROUP}
+PKG_USERS= ${MLDONKEY_USER}:${MLDONKEY_GROUP}::Dedicated\\ mldonkey\\ server:${MLDONKEY_HOME}:${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
-
-.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"
+ ${INSTALL_PROGRAM_DIR} ${PREFIX}/libexec/mldonkey
+ ${INSTALL_PROGRAM} ${WRKSRC}/mlnet ${PREFIX}/libexec/mldonkey
+
.include "../../mk/bsd.pkg.mk"
diff --git a/net/mldonkey/Makefile.common b/net/mldonkey/Makefile.common
new file mode 100644
index 00000000000..4945dfb4019
--- /dev/null
+++ b/net/mldonkey/Makefile.common
@@ -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
+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 --git a/net/mldonkey/PLIST b/net/mldonkey/PLIST
index 21f308c17c4..1c1d0aa05bb 100644
--- a/net/mldonkey/PLIST
+++ b/net/mldonkey/PLIST
@@ -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 --git a/net/mldonkey/files/mldonkey.sh b/net/mldonkey/files/mldonkey.sh
index d90361c04ef..bb2c20f39b0 100644
--- a/net/mldonkey/files/mldonkey.sh
+++ b/net/mldonkey/files/mldonkey.sh
@@ -1,16 +1,39 @@
-#!/bin/sh
+#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: mldonkey.sh,v 1.2 2003/05/19 12:52:59 wiz Exp $
+# $NetBSD: mldonkey.sh,v 1.3 2004/12/25 19:13:34 jmmv 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