summaryrefslogtreecommitdiff
path: root/net-p2p/mldonkey
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-p2p/mldonkey
reinit the tree, so we can have metadata
Diffstat (limited to 'net-p2p/mldonkey')
-rw-r--r--net-p2p/mldonkey/Manifest12
-rw-r--r--net-p2p/mldonkey/files/mldonkey.confd-2.839
-rw-r--r--net-p2p/mldonkey/files/mldonkey.initd121
-rw-r--r--net-p2p/mldonkey/files/ocaml-4.03.patch145
-rw-r--r--net-p2p/mldonkey/files/ocaml4.patch12
-rw-r--r--net-p2p/mldonkey/metadata.xml20
-rw-r--r--net-p2p/mldonkey/mldonkey-3.1.5-r1.ebuild174
-rw-r--r--net-p2p/mldonkey/mldonkey-3.1.6-r1.ebuild176
-rw-r--r--net-p2p/mldonkey/mldonkey-3.1.6.ebuild172
9 files changed, 871 insertions, 0 deletions
diff --git a/net-p2p/mldonkey/Manifest b/net-p2p/mldonkey/Manifest
new file mode 100644
index 000000000000..7b31803ecef0
--- /dev/null
+++ b/net-p2p/mldonkey/Manifest
@@ -0,0 +1,12 @@
+AUX mldonkey.confd-2.8 887 SHA256 d395ecece23a23dcb41addf63b70220996011ceb29d8738afb3c048b666cd96e SHA512 0ec0fe4fcf87222e31852e7e254e5e054bc31b713d5e4679b2a794c6df8cf0347f9a1d3d345bb48144b13d3e8dcb38168d0be32c766b7d678a8055fc066beb4d WHIRLPOOL 9c90eda42233ee60c988fdaca0a0ddb567c0deb84ae32fd77a7ac7d947d1b2b612a691e0e32e7f3dc4263a6d201c95519422a461712aec79d4183f7256fa6e0a
+AUX mldonkey.initd 3158 SHA256 651d525c5bfaff9421183b73b80939dfc3a3d4e105d6da941258eb05a29210b0 SHA512 33530e71032be0771296fde58a46dc02859a82de5173ff71bbbcdebf879e6d7d6b597b4104db0ab2f319d3f5848db41d17cadbdd781c6f97dd23387b7f823054 WHIRLPOOL b9317e011eac450cbb5bb79820de2cd2cd0881b96148b24b5c4a2b7bddf79c225126208e5a1ca453b1925c364a559e6abe07aacd2776d11dc2aca218dba65473
+AUX ocaml-4.03.patch 5140 SHA256 e82fb67c7a29503a77104cd1c7976a6f7a9ecda14c9ee2e4a33d9bc5521df36e SHA512 19f0736c72abcbb992aa55bb7a685bc21234c6f807b0efcfb09791aee9843823779ae6c94f70a9c891b9aa0ac388618d8c775beee1244e264c0b27096e8a2399 WHIRLPOOL 2c37ef6cf9234eceb628501249ca3cdde078050a992174bca3cfeff45f39f32bdcf7a1a7c5ff1e02c1d2f066b9d329dc3704544c4800b4129061c4a9f30a76d1
+AUX ocaml4.patch 547 SHA256 465361e9b96a2fc69b61105ade1a14715bd2e93f1c2fb80a35a2ee11cb06dd37 SHA512 f99d4050613e210c2092153a7b1a45028ea26d4e90d295b1d19ed3a25b7ae656c15efca84a5f694703dca339c1a5e7baec5d71ad815f96c41620a8ed7c34422c WHIRLPOOL 77e859eba9e9cea69c5fb6d2f4ed43116dcfaee0b0e4797960b4e2a53656e42cd0a568b7b334d751956954e0f4f628de60ef6bca01e127ac421a42cb72ee6823
+DIST mldonkey-3.1.5.tar.bz2 2847382 SHA256 74f9d4bcc72356aa28d0812767ef5b9daa03efc5d1ddabf56447dc04969911cb SHA512 96e75acf91d7ecc41490f898e06d284da27404c7e567f173936d8113885a3b4b6bc93341358f92a30d3f699eef681d97ce56414a37bb02a535ad2da4d4ad13a3 WHIRLPOOL b9e15809a49cc12e69a6d1188441e9d5603ec76cb7bfe2b2e0bfce3c50abb31296904c842f487076b227f577046ccbd3ceb7cd1a601d3faa6928b1bfde8c780f
+DIST mldonkey-3.1.6.tar.bz2 2886916 SHA256 1b36b57c05a83c2e363c085bf8e80630884c6c92ecdeffc1ad5e1c39a98e043d SHA512 d0c7256c7c43934bc132183cfe0c8d85c61a874e295b86ba989f43fd4d9f3672bdf18439a9fefce52c30a6a8df08a5a464dcc21d4bf199d1b502fa344683081a WHIRLPOOL 1d5b6118dbe25fc3aad2cf9d57808cfc4c5466b4bb6b5c590c4541fdd400de0cf7ac55616f224eee763d88e08b03af26d873d9b6bf679808f7b5ade285f4d6d2
+EBUILD mldonkey-3.1.5-r1.ebuild 4405 SHA256 1db6bfbd02ad0b2daa093239f6f490d8de06a738a06c825bf892f59875cbdcab SHA512 0336f99f282cd2b1bfe318f2a09c533fc498b24f5c8af129bdb50bb4fe8c76bf249daaff8ddefba2ffb0d52677300468a32c6a96f42549e952f1117521cc7d3d WHIRLPOOL 0ab514b7fae99d98ffe1e5a32fe6420982c427682d484f6ea1a8123808b7ddafe7333d8d0a529b391cabef37be34eb74290706e8fcb2baf5813dbbeab6bab7ad
+EBUILD mldonkey-3.1.6-r1.ebuild 4505 SHA256 4bd75404bf0ffde60b3a91d04643e44f30e3753d38bdcffc3e258c5b5b06458d SHA512 5e653a7f07625c3894941dd3a8e71dd36039f867e584888a5f0d6aaa17723f393bbe86552c0f4373eb95b58e26dc05c885add6932ddaa57aeefa6f31624c585e WHIRLPOOL 0ca42224ab057db0876bec155ec7fd7f7e4f6a0ef1618d6485bed214eae075ed626841f41ca8a8d3f7aa1875aa90c7d0a8a9d921cd68ba86220a7a25f069da23
+EBUILD mldonkey-3.1.6.ebuild 4379 SHA256 807660378f2f72a28d8c6b3d82a68e42f7f84c8698fc902ffacafe126849302e SHA512 bb905d69f042ca25c34065f131bb646ecfc64343eada6a244100e79093f66578038af3654342b25c43595e7a14fb56615557b87424c191afc3d4ec058381e726 WHIRLPOOL e9d28ab4c2dde504fcfe68b22507b512c978b80bf012df8b16c59201ef5a8c4e6c8613d1491a7abcbfbd98e10c9b216d7aceeb6a61bfb75e716589acd73e66db
+MISC ChangeLog 4453 SHA256 b58d7acbd22018080feb470ce49ff1587adcbc77e3f1cf28f821a1c7b6a9923f SHA512 44af6c7d1fa2f250eb85466336ec704bd031075e845d6bac50a3d0653394b21788411cdc1eb7cb2d85247ffaa8b229afbe99a5de253b768c1407564128b3dc64 WHIRLPOOL c97ff5dcbfbc42b99042e3333db0247268f514246c5c9ac026f1febf8b1f3da3df1fbb25f51db023a622a007b3d4d410c086791b629972183cdfd1fc9965294f
+MISC ChangeLog-2015 39071 SHA256 c1ed6b1aec282601df4c8ba44349a435b42881e8daca5777f1403255561532d7 SHA512 cb3f49538750c65a410db4b61c689d8b2e1412bf7b5ce4f2a7f5a6b0157fd1c800424f1e7a03cf9bdd779c791df84d9942d6c60a9553cb45ff5cee6a16198c29 WHIRLPOOL ad788fc24545330a172b3522b91457b60546eb1471140bacbc0fc8b3bae4e60fcc4a068428359eea3edfb0fac83b50e0888042a789d152f0172aab47f6889084
+MISC metadata.xml 793 SHA256 cbf13265cfecc4eaca51c4f317f1ef3c48925b230933cf4bece91f67858e3fcf SHA512 faff7076c4e3f4c6e0972ee0f0ff1a667dc44dd5bce6444b76723c6c3c151633c2598bf2ba3fd12ba64232a7de6d56f46bb1da014b26db7b544cd4cabff2b4e8 WHIRLPOOL e7925741edb0b2fab1562be4e056747ad388a200b9e8cd24ebef9886e8de498a46fec6366661e18f0309d33456e74dd9a3b3c9ee3d871aa818783a6cac44759b
diff --git a/net-p2p/mldonkey/files/mldonkey.confd-2.8 b/net-p2p/mldonkey/files/mldonkey.confd-2.8
new file mode 100644
index 000000000000..1d1f282234f7
--- /dev/null
+++ b/net-p2p/mldonkey/files/mldonkey.confd-2.8
@@ -0,0 +1,39 @@
+# /etc/conf.d/mldonkey
+# Config file for mldonkey control script
+
+# Change the following vars only if you know
+# what you're doing, there's no checking for
+# invalid data yet!
+
+# owner of mlnet process (don't change, must be existing)
+USER="p2p"
+
+# mldonkey's working dir (must be existing)
+MLDONKEY_DIR="/home/p2p/mldonkey"
+
+# logfile (/dev/null for nowhere)
+LOG="/var/log/mldonkey.log"
+
+# set to true, if you have enabled logging to syslog in MLDonkey with
+# 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<x<19, more nice -> less cpuspeed consumed
+NICE="19"
+
+# mldonkey server ip, usually localhost
+SERVER="localhost"
+
+# port for webinterface, usually 4080
+PORT="4080"
+
+# 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
new file mode 100644
index 000000000000..12dd599de7be
--- /dev/null
+++ b/net-p2p/mldonkey/files/mldonkey.initd
@@ -0,0 +1,121 @@
+#!/sbin/openrc-run
+
+extra_started_commands="reload slow fast info"
+
+MLDONKEY_BINARY=${MLDONKEY_BINARY:-/usr/bin/mlnet}
+MLDONKEY_TIMEOUT=${TIMEOUT:-10}
+
+depend() {
+ need localmount net
+ ${USE_LOGGER} && use logger
+}
+
+start() {
+ 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"
+ fi
+
+ if [ ! -d "${MLDONKEY_DIR}" ]; then
+ ebegin "Directory ${MLDONKEY_DIR} not existing, trying to create..."
+ mkdir -p "${MLDONKEY_DIR}" && chown ${USER}:users "${MLDONKEY_DIR}"
+ eend $? || return 1
+ 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
+ eend $?
+}
+
+setup_uri() {
+ BASE="http://"
+ if [ -n "${USERNAME}" -a -n "${PASSWORD}" ]; then
+ BASE="${BASE}${USERNAME}:${PASSWORD}@"
+ fi
+ BASE="${BASE}${SERVER}:${PORT}"
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME} -- please wait"
+
+ setup_uri
+ wget --spider --timeout="${MLDONKEY_TIMEOUT}" "${BASE}"/submit?q=close_fds -q
+ wget --spider --timeout="${MLDONKEY_TIMEOUT}" "${BASE}"/submit?q=save -q
+ wget --spider --timeout="${MLDONKEY_TIMEOUT}" "${BASE}"/submit?q=kill -q
+
+ # give it a chance to die:
+ local timeout=${MLDONKEY_TIMEOUT}
+ while [ $timeout -gt 0 ]; do
+ if ! start-stop-daemon --test --quiet --stop \
+ --exec "${MLDONKEY_BINARY}" \
+ --pidfile /var/run/"${SVCNAME}".pid ; then
+ eend 0
+ return 0
+ fi
+ sleep 1
+ timeout=$((${timeout} - 1))
+ done
+
+ eend 1 "Failed to cleanly stop ${SVCNAME}"
+ ebegin "Forcing ${SVCNAME} to stop"
+ start-stop-daemon --stop --exec "${MLDONKEY_BINARY}" \
+ --pidfile /var/run/"${SVCNAME}".pid
+ eend $?
+}
+
+# This doesn't work for baselayout-2
+restart() {
+ svc_stop
+ sleep 5
+ svc_start
+}
+
+reload() {
+ ebegin "Reloading ${SVCNAME}"
+ start-stop-daemon --stop --signal HUP --oknodo \
+ --exec "${MLDONKEY_BINARY}" --pidfile /var/run/"${SVCNAME}".pid
+ eend $?
+}
+
+slow() {
+ ebegin "Reducing bandwidth to ${LOW_DOWN}k/${LOW_UP}k"
+ setup_uri
+ wget --spider --timeout="${MLDONKEY_TIMEOUT}" \
+ "${BASE}/submit?q=set+max_hard_download_rate+${LOW_DOWN}" -q
+ wget --spider --timeout=${MLDONKEY_TIMEOUT} \
+ "${BASE}/submit?q=set+max_hard_upload_rate+${LOW_UP}" -q
+ eend $?
+}
+
+fast() {
+ ebegin "Increasing bandwidth to ${HIGH_DOWN}k/${HIGH_UP}k"
+
+ setup_uri
+ wget --spider --timeout="${MLDONKEY_TIMEOUT}" \
+ "${BASE}/submit?q=set+max_hard_upload_rate+${HIGH_UP}" -q
+ wget --spider --timeout="${MLDONKEY_TIMEOUT}" \
+ "${BASE}/submit?q=set+max_hard_download_rate+${HIGH_DOWN}" -q
+ eend $?
+}
+
+
+info() {
+ setup_uri
+ local result=$(wget --timeout="${MLDONKEY_TIMEOUT}" \
+ -O - "${BASE}"/submit?q=vo 2>/dev/null | \
+ grep -C1 max_hard_upload | \
+ grep value=\" | cut -d\" -f2)
+ if [ "${result}" = "${LOW_UP}" ]; then
+ einfo "${SVCNAME} runs slow"
+ else
+ einfo "${SVCNAME} runs fast"
+ fi
+}
diff --git a/net-p2p/mldonkey/files/ocaml-4.03.patch b/net-p2p/mldonkey/files/ocaml-4.03.patch
new file mode 100644
index 000000000000..fce94c851e2d
--- /dev/null
+++ b/net-p2p/mldonkey/files/ocaml-4.03.patch
@@ -0,0 +1,145 @@
+Index: mldonkey-3.1.5/src/config/unix/os_stubs_c.c
+===================================================================
+--- mldonkey-3.1.5.orig/src/config/unix/os_stubs_c.c
++++ mldonkey-3.1.5/src/config/unix/os_stubs_c.c
+@@ -66,7 +66,7 @@ ssize_t os_read(OS_FD fd, char *buf, siz
+
+ void os_ftruncate(OS_FD fd, OFF_T len, /* bool */ int sparse)
+ {
+- int64 cursize;
++ int64_t cursize;
+ if(!fd) failwith("ftruncate32: file is closed");
+
+ cursize = os_getfdsize(fd);
+@@ -109,7 +109,7 @@ int os_getdtablesize()
+
+ *******************************************************************/
+
+-int64 os_getfdsize(OS_FD fd)
++int64_t os_getfdsize(OS_FD fd)
+ {
+ struct stat buf;
+
+@@ -127,7 +127,7 @@ int64 os_getfdsize(OS_FD fd)
+
+ *******************************************************************/
+
+-int64 os_getfilesize(char *path)
++int64_t os_getfilesize(char *path)
+ {
+ struct stat buf;
+
+Index: mldonkey-3.1.5/src/networks/donkey/donkeyGlobals.ml
+===================================================================
+--- mldonkey-3.1.5.orig/src/networks/donkey/donkeyGlobals.ml
++++ mldonkey-3.1.5/src/networks/donkey/donkeyGlobals.ml
+@@ -781,7 +781,6 @@ let set_client_name c name md4 =
+ c.client_md4 <- md4;
+ end
+
+-exception ClientFound of client
+ let find_client_by_name name =
+ try
+ H.iter (fun c ->
+Index: mldonkey-3.1.5/src/utils/cdk/zip.ml
+===================================================================
+--- mldonkey-3.1.5.orig/src/utils/cdk/zip.ml
++++ mldonkey-3.1.5/src/utils/cdk/zip.ml
+@@ -72,8 +72,6 @@ type out_file =
+ mutable of_entries: entry list;
+ of_comment: string }
+
+-exception Error of string * string * string
+-
+ (* Return the position of the last occurrence of s1 in s2, or -1 if not
+ found. *)
+
+Index: mldonkey-3.1.5/src/utils/cdk/zlibstubs.c
+===================================================================
+--- mldonkey-3.1.5.orig/src/utils/cdk/zlibstubs.c
++++ mldonkey-3.1.5/src/utils/cdk/zlibstubs.c
+@@ -191,7 +191,7 @@ value camlzip_inflateEnd(value vzs)
+
+ value camlzip_update_crc32(value crc, value buf, value pos, value len)
+ {
+- return copy_int32(crc32((uint32) Int32_val(crc),
++ return copy_int32(crc32((uint32_t) Int32_val(crc),
+ &Byte_u(buf, Long_val(pos)),
+ Long_val(len)));
+ }
+Index: mldonkey-3.1.5/src/utils/lib/fst_hash.c
+===================================================================
+--- mldonkey-3.1.5.orig/src/utils/lib/fst_hash.c
++++ mldonkey-3.1.5/src/utils/lib/fst_hash.c
+@@ -197,7 +197,7 @@ unsigned short fst_hash_checksum (unsign
+ /*****************************************************************************/
+
+ // hash file
+-int fst_hash_file (unsigned char *fth, char *file, int64 filesize)
++int fst_hash_file (unsigned char *fth, char *file, int64_t filesize)
+ {
+ FILE *fp;
+ unsigned char *buf;
+@@ -271,7 +271,7 @@ int fst_hash_file (unsigned char *fth, c
+ }
+
+
+-void fst_hash_string (unsigned char *fth, unsigned char *file, int64 filesize)
++void fst_hash_string (unsigned char *fth, unsigned char *file, int64_t filesize)
+ {
+ unsigned char * buf = file;
+ size_t len = filesize;
+Index: mldonkey-3.1.5/src/utils/lib/options.ml4
+===================================================================
+--- mldonkey-3.1.5.orig/src/utils/lib/options.ml4
++++ mldonkey-3.1.5/src/utils/lib/options.ml4
+@@ -332,7 +332,6 @@ let exit_exn = Exit
+
+
+ let unsafe_get = String.unsafe_get
+-external is_printable : char -> bool = "caml_is_printable"
+ let unsafe_set = String.unsafe_set
+
+ let escaped s =
+@@ -343,7 +342,7 @@ let escaped s =
+ (match unsafe_get s i with
+ '"' | '\\' -> 2
+ | '\n' | '\t' -> 1
+- | c -> if is_printable c then 1 else 4)
++ | c -> 1)
+ done;
+ if !n = String.length s then s
+ else
+@@ -354,16 +353,7 @@ let escaped s =
+ '"' | '\\' as c -> unsafe_set s' !n '\\'; incr n; unsafe_set s' !n c
+ | '\n' | '\t' as c -> unsafe_set s' !n c
+ | c ->
+- if is_printable c then unsafe_set s' !n c
+- else
+- let a = int_of_char c in
+- unsafe_set s' !n '\\';
+- incr n;
+- unsafe_set s' !n (char_of_int (48 + a / 100));
+- incr n;
+- unsafe_set s' !n (char_of_int (48 + a / 10 mod 10));
+- incr n;
+- unsafe_set s' !n (char_of_int (48 + a mod 10))
++ unsafe_set s' !n c
+ end;
+ incr n
+ done;
+Index: mldonkey-3.1.5/src/utils/lib/os_stubs.h
+===================================================================
+--- mldonkey-3.1.5.orig/src/utils/lib/os_stubs.h
++++ mldonkey-3.1.5/src/utils/lib/os_stubs.h
+@@ -155,8 +155,8 @@ extern OFF_T os_lseek(OS_FD fd, OFF_T po
+ extern void os_ftruncate(OS_FD fd, OFF_T len, int sparse);
+ extern ssize_t os_read(OS_FD fd, char *buf, size_t len);
+ extern int os_getdtablesize();
+-extern int64 os_getfdsize(OS_FD fd);
+-extern int64 os_getfilesize(char *path);
++extern int64_t os_getfdsize(OS_FD fd);
++extern int64_t os_getfilesize(char *path);
+ extern void os_set_nonblock(OS_SOCKET fd);
+ extern void os_uname(char buf[]);
+ extern int os_os_supported();
diff --git a/net-p2p/mldonkey/files/ocaml4.patch b/net-p2p/mldonkey/files/ocaml4.patch
new file mode 100644
index 000000000000..32882417b62c
--- /dev/null
+++ b/net-p2p/mldonkey/files/ocaml4.patch
@@ -0,0 +1,12 @@
+Index: mldonkey-3.1.5/src/utils/net/terminal.ml
+===================================================================
+--- mldonkey-3.1.5.orig/src/utils/net/terminal.ml
++++ mldonkey-3.1.5/src/utils/net/terminal.ml
+@@ -185,7 +185,6 @@ module Output = struct
+ let canal = List.assoc chan !chanmap in
+ etat.chan <- Some (chan, canal);
+ info (sprintf "connecte au canal '%s'" chan);
+- (* {| canal ALL } *)
+ with Not_found -> (* pas encore de recepteur pour ce canal *)
+ try (* on en cree un *)
+ let serveur = nsrecord.get_loc chan in
diff --git a/net-p2p/mldonkey/metadata.xml b/net-p2p/mldonkey/metadata.xml
new file mode 100644
index 000000000000..6cefea4a1841
--- /dev/null
+++ b/net-p2p/mldonkey/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>ml@gentoo.org</email>
+ <name>Gentoo ML Project</name>
+ </maintainer>
+ <longdescription>An ocaml client to access the eDonkey network.</longdescription>
+ <use>
+ <flag name="bittorrent">enable bittorrent support</flag>
+ <flag name="fasttrack">enable fasttrack support</flag>
+ <flag name="gnutella">enable gnutella and gnutella2 support</flag>
+ <flag name="guionly">enable client build only</flag>
+ <flag name="magic">enable use of libmagic</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">mldonkey</remote-id>
+ <remote-id type="github">ygrek/mldonkey</remote-id>
+ </upstream>
+</pkgmetadata>
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 000000000000..d532cb725f30
--- /dev/null
+++ b/net-p2p/mldonkey/mldonkey-3.1.5-r1.ebuild
@@ -0,0 +1,174 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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 in mlnet mld_hash get_range copysources subconv; do
+ newbin $i$myext $i
+ done
+ use bittorrent && newbin make_torrent$myext make_torrent
+
+ newconfd "${FILESDIR}/mldonkey.confd-2.8" mldonkey
+ fperms 600 /etc/conf.d/mldonkey
+ newinitd "${FILESDIR}/mldonkey.initd" mldonkey
+ fi
+
+ if use gtk; then
+ for i in mlgui mlguistarter; do
+ newbin $i$myext $i
+ done
+ make_desktop_entry mlgui "MLDonkey GUI" mldonkey "Network;P2P"
+ newicon "${S}"/packages/rpm/mldonkey-icon-48.png ${PN}.png
+ fi
+
+ if use doc ; then
+ cd "${S}"/distrib
+ dodoc ChangeLog *.txt
+
+ insinto /usr/share/doc/${PF}/scripts
+ doins kill_mldonkey mldonkey_command mldonkey_previewer make_buginfo
+
+ cd "${S}"/docs
+ dodoc *.txt *.tex *.pdf
+ dohtml *.html
+
+ cd "${S}"/docs/developers
+ dodoc *.txt *.tex
+
+ cd "${S}"/docs/images
+ insinto /usr/share/doc/${PF}/html/images
+ doins *
+ fi
+}
+
+pkg_preinst() {
+ if ! use guionly; then
+ enewuser ${MLUSER} -1 -1 /home/p2p users
+ fi
+}
+
+pkg_postinst() {
+ if ! use guionly; then
+ echo
+ einfo "If you want to start MLDonkey as a system service, use"
+ einfo "the /etc/init.d/mldonkey script. To control bandwidth, use"
+ einfo "the 'slow' and 'fast' arguments. Be sure to have a look at"
+ einfo "/etc/conf.d/mldonkey also."
+ echo
+ else
+ echo
+ einfo "Simply run mlgui to start the chosen MLDonkey gui."
+ einfo "It puts its config files into ~/.mldonkey"
+ fi
+}
diff --git a/net-p2p/mldonkey/mldonkey-3.1.6-r1.ebuild b/net-p2p/mldonkey/mldonkey-3.1.6-r1.ebuild
new file mode 100644
index 000000000000..3acb3317ffdb
--- /dev/null
+++ b/net-p2p/mldonkey/mldonkey-3.1.6-r1.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+WANT_AUTOCONF=2.5
+
+inherit versionator flag-o-matic eutils autotools toolchain-funcs user
+
+IUSE="bittorrent doc fasttrack gd gnutella gtk guionly magic +ocamlopt upnp"
+
+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="https://github.com/ygrek/mldonkey/releases/download/release-$(replace_all_version_separators '-')/${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 )
+ upnp? ( net-libs/miniupnpc:= net-libs/libnatpmp:= )
+"
+
+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"
+
+ 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) \
+ $(use_enable upnp upnp-natpmp) \
+ --disable-force-upnp-natpmp \
+ ${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 in mlnet mld_hash get_range copysources subconv; do
+ newbin $i$myext $i
+ done
+ use bittorrent && newbin make_torrent$myext make_torrent
+
+ newconfd "${FILESDIR}/mldonkey.confd-2.8" mldonkey
+ fperms 600 /etc/conf.d/mldonkey
+ newinitd "${FILESDIR}/mldonkey.initd" mldonkey
+ fi
+
+ if use gtk; then
+ for i in mlgui mlguistarter; do
+ newbin $i$myext $i
+ done
+ make_desktop_entry mlgui "MLDonkey GUI" mldonkey "Network;P2P"
+ newicon "${S}"/packages/rpm/mldonkey-icon-48.png ${PN}.png
+ fi
+
+ if use doc ; then
+ cd "${S}"/distrib
+ dodoc ChangeLog *.txt
+
+ insinto /usr/share/doc/${PF}/scripts
+ doins kill_mldonkey mldonkey_command mldonkey_previewer make_buginfo
+
+ cd "${S}"/docs
+ dodoc *.txt *.tex *.pdf
+ dohtml *.html
+
+ cd "${S}"/docs/developers
+ dodoc *.txt *.tex
+
+ cd "${S}"/docs/images
+ insinto /usr/share/doc/${PF}/html/images
+ doins *
+ fi
+}
+
+pkg_preinst() {
+ if ! use guionly; then
+ enewuser ${MLUSER} -1 -1 /home/p2p users
+ fi
+}
+
+pkg_postinst() {
+ if ! use guionly; then
+ echo
+ einfo "If you want to start MLDonkey as a system service, use"
+ einfo "the /etc/init.d/mldonkey script. To control bandwidth, use"
+ einfo "the 'slow' and 'fast' arguments. Be sure to have a look at"
+ einfo "/etc/conf.d/mldonkey also."
+ echo
+ else
+ echo
+ einfo "Simply run mlgui to start the chosen MLDonkey gui."
+ einfo "It puts its config files into ~/.mldonkey"
+ fi
+}
diff --git a/net-p2p/mldonkey/mldonkey-3.1.6.ebuild b/net-p2p/mldonkey/mldonkey-3.1.6.ebuild
new file mode 100644
index 000000000000..82f88b95c717
--- /dev/null
+++ b/net-p2p/mldonkey/mldonkey-3.1.6.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+WANT_AUTOCONF=2.5
+
+inherit versionator 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="https://github.com/ygrek/mldonkey/releases/download/release-$(replace_all_version_separators '-')/${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"
+
+ 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 in mlnet mld_hash get_range copysources subconv; do
+ newbin $i$myext $i
+ done
+ use bittorrent && newbin make_torrent$myext make_torrent
+
+ newconfd "${FILESDIR}/mldonkey.confd-2.8" mldonkey
+ fperms 600 /etc/conf.d/mldonkey
+ newinitd "${FILESDIR}/mldonkey.initd" mldonkey
+ fi
+
+ if use gtk; then
+ for i in mlgui mlguistarter; do
+ newbin $i$myext $i
+ done
+ make_desktop_entry mlgui "MLDonkey GUI" mldonkey "Network;P2P"
+ newicon "${S}"/packages/rpm/mldonkey-icon-48.png ${PN}.png
+ fi
+
+ if use doc ; then
+ cd "${S}"/distrib
+ dodoc ChangeLog *.txt
+
+ insinto /usr/share/doc/${PF}/scripts
+ doins kill_mldonkey mldonkey_command mldonkey_previewer make_buginfo
+
+ cd "${S}"/docs
+ dodoc *.txt *.tex *.pdf
+ dohtml *.html
+
+ cd "${S}"/docs/developers
+ dodoc *.txt *.tex
+
+ cd "${S}"/docs/images
+ insinto /usr/share/doc/${PF}/html/images
+ doins *
+ fi
+}
+
+pkg_preinst() {
+ if ! use guionly; then
+ enewuser ${MLUSER} -1 -1 /home/p2p users
+ fi
+}
+
+pkg_postinst() {
+ if ! use guionly; then
+ echo
+ einfo "If you want to start MLDonkey as a system service, use"
+ einfo "the /etc/init.d/mldonkey script. To control bandwidth, use"
+ einfo "the 'slow' and 'fast' arguments. Be sure to have a look at"
+ einfo "/etc/conf.d/mldonkey also."
+ echo
+ else
+ echo
+ einfo "Simply run mlgui to start the chosen MLDonkey gui."
+ einfo "It puts its config files into ~/.mldonkey"
+ fi
+}