summaryrefslogtreecommitdiff
path: root/community/mldonkey
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/mldonkey
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/mldonkey')
-rw-r--r--community/mldonkey/PKGBUILD44
-rw-r--r--community/mldonkey/mldonkey.conf8
-rw-r--r--community/mldonkey/mldonkey.desktop8
-rw-r--r--community/mldonkey/mldonkey.install17
-rw-r--r--community/mldonkey/mldonkeyd50
5 files changed, 127 insertions, 0 deletions
diff --git a/community/mldonkey/PKGBUILD b/community/mldonkey/PKGBUILD
new file mode 100644
index 000000000..5cd449c3f
--- /dev/null
+++ b/community/mldonkey/PKGBUILD
@@ -0,0 +1,44 @@
+# $Id: PKGBUILD 40262 2011-02-22 17:18:28Z cbrannon $
+# Maintainer: Chris Brannon <cmbrannon79@gmail.com>
+# Contributor: Corrado Primier <bardo@aur.archlinux.org>
+# Contributor: Alessio 'mOLOk' Bolognino <themolok@gmail.com>
+
+pkgname=mldonkey
+pkgver=3.0.7
+pkgrel=2
+pkgdesc="A multi-network P2P client"
+arch=('i686' 'x86_64')
+url="http://mldonkey.sourceforge.net/"
+license=('GPL')
+depends=('desktop-file-utils' 'file' 'gd' 'bzip2')
+makedepends=('lablgtk2' 'librsvg' 'ocaml')
+optdepends=('librsvg: GUI support'
+ 'libx11: GUI support')
+backup=('etc/conf.d/mldonkey')
+install=mldonkey.install
+source=(http://downloads.sourceforge.net/sourceforge/mldonkey/$pkgname-$pkgver.tar.bz2
+ mldonkeyd mldonkey.conf mldonkey.desktop)
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ ./configure --prefix=/usr --enable-gui=newgui2
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+
+ install -Dm644 "$srcdir/$pkgname-$pkgver/icons/rsvg/type_source_normal.svg" \
+ "$pkgdir/usr/share/icons/mldonkey.svg"
+ install -Dm644 "$srcdir/mldonkey.desktop" \
+ "$pkgdir/usr/share/applications/mldonkey.desktop"
+
+ install -Dm755 "$srcdir/mldonkeyd" "$pkgdir/etc/rc.d/mldonkey"
+ install -Dm644 "$srcdir/mldonkey.conf" "$pkgdir/etc/conf.d/mldonkey"
+}
+md5sums=('162b78fc4e20335a8fe31d91e1656db2'
+ 'c42526cb7ff703b313728dfdd92dfb1e'
+ '190cbbc30b510981e0d8b0ed8bae87a4'
+ '1de3266caa49f82bee73ba891eea12cf')
diff --git a/community/mldonkey/mldonkey.conf b/community/mldonkey/mldonkey.conf
new file mode 100644
index 000000000..7aa683f1a
--- /dev/null
+++ b/community/mldonkey/mldonkey.conf
@@ -0,0 +1,8 @@
+# Username under which the daemon will run (mandatory)
+MLDUSER=""
+
+# Parameters to be passed to the daemon (default is empty)
+PARAMS=""
+
+# PID file location (defaults to "/var/lock" if empty)
+PIDDIR=""
diff --git a/community/mldonkey/mldonkey.desktop b/community/mldonkey/mldonkey.desktop
new file mode 100644
index 000000000..b307261e1
--- /dev/null
+++ b/community/mldonkey/mldonkey.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Name=MLDonkey GUI
+Comment=multi-protocol P2P program
+Exec=mldonkey_gui
+Icon=mldonkey
+Terminal=false
+Type=Application
+Categories=Network;P2P;
diff --git a/community/mldonkey/mldonkey.install b/community/mldonkey/mldonkey.install
new file mode 100644
index 000000000..dd8ea0407
--- /dev/null
+++ b/community/mldonkey/mldonkey.install
@@ -0,0 +1,17 @@
+post_install() {
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ if [ -f /etc/mldonkey.conf ]; then
+ mv /etc/mldonkey.conf /etc/conf.d/mldonkey
+ cat << EOM
+
+==> mldonkey post upgrade message:
+==> /etc/mldonkey.conf has been moved in /etc/conf.d/mldonkey
+
+EOM
+ fi
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/community/mldonkey/mldonkeyd b/community/mldonkey/mldonkeyd
new file mode 100644
index 000000000..bbd6954c2
--- /dev/null
+++ b/community/mldonkey/mldonkeyd
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/conf.d/mldonkey
+. /etc/rc.d/functions
+
+if [ -z $MLDUSER ] ; then
+ echo "Unable to run MLDonkey. You must set a user in /etc/conf.d/mldonkey ."
+ exit 2
+fi
+
+USERDIR=$(getent passwd $MLDUSER | cut -d: -f6)
+
+if [ ! -d $USERDIR ]; then
+ echo "Unable to run MLDonkey. Home directory for ${MLDUSER} does not exist."
+ exit 2
+fi
+
+PID=$(cat $USERDIR/.mldonkey/mlnet.pid 2>/dev/null)
+
+case "$1" in
+ start)
+ stat_busy "Starting MLDonkey"
+ [ -z $PID ] && su $MLDUSER -s /bin/sh -c "/usr/bin/mlnet $PARAMS -log_to_syslog true &> /tmp/mldonkey.log &"
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon mldonkey
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping MLDonkey"
+ [ ! -z $PID ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon mldonkey
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0