summaryrefslogtreecommitdiffstats
path: root/net-p2p/mldonkey/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'net-p2p/mldonkey/Makefile')
-rw-r--r--net-p2p/mldonkey/Makefile140
1 files changed, 105 insertions, 35 deletions
diff --git a/net-p2p/mldonkey/Makefile b/net-p2p/mldonkey/Makefile
index d720f34..9786008 100644
--- a/net-p2p/mldonkey/Makefile
+++ b/net-p2p/mldonkey/Makefile
@@ -6,32 +6,48 @@
#
PORTNAME= mldonkey
-PORTVERSION= 2.5.30.17
-PORTREVISION= 2
+PORTVERSION= 2.8.1
CATEGORIES+= net-p2p
-MASTER_SITES= ${MASTER_SITE_SAVANNAH}
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED} \
+ ${MASTER_SITE_SAVANNAH}
MASTER_SITE_SUBDIR= ${PORTNAME}
-MAINTAINER?= benlutz@datacomm.ch
+MAINTAINER?= lioux@FreeBSD.org
COMMENT?= A OCAML client for multiple peer-to-peer networks
BUILD_DEPENDS= ocamlc:${PORTSDIR}/lang/ocaml
-CONFLICTS= mldonkey-devel-[0-9]*
+NO_LATEST_LINK= yes
+CONFLICTS= mldonkey-[0-9]*
USE_BZIP2= yes
-USE_AUTOTOOLS= autoconf:259:env
-USE_OPENSSL= yes
USE_ICONV= yes
+USE_RC_SUBR= mlnet
+USE_AUTOTOOLS= autoconf:259:env
GNU_CONFIGURE= yes
-CONFIGURE_ARGS= --enable-pthread --enable-ocamlver=3
USE_GMAKE= yes
-ALL_TARGET= depend opt
-
-.if !defined(WITHOUT_CORE)
-USE_RC_SUBR= yes
+ALL_TARGET= opt
+
+CONFIGURE_ARGS+=\
+ --enable-ocamlver=3 \
+ --with-libiconv-prefix=${LOCALBASE}
+CONFIGURE_ENV+= \
+ NEWCXX="${CXX}" \
+ CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \
+ LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib" \
+ PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
+ PTHREAD_LIBS="${PTHREAD_LIBS}"
+
+###
+## Library dependency handling
+###
+.if !exists(/usr/lib/libbz2.so)
+LIB_DEPENDS+= bz2:${PORTSDIR}/archivers/bzip2
.endif
+###
+## Options activation
+###
.if defined(WITHOUT_GUI)
.if defined(WITHOUT_CORE)
IGNORE= cannot install: you defined both WITHOUT_GUI and WITHOUT_CORE. I think I'll do nothing
@@ -39,69 +55,123 @@ IGNORE= cannot install: you defined both WITHOUT_GUI and WITHOUT_CORE. I think I
# have no 'without-' flag
CONFIGURE_ARGS+=--disable-gui
PLIST_SUB+= CORE="" GUI="@comment " GUICORE="@comment "
-CONFLICTS+= mldonkey-core-devel-[0.9]* mldonkey-core-stable-[0.9]* \
- mldonkey-[0-9]*
-PKGNAMESUFFIX= -core
+CONFLICTS+= mldonkey-core-[0.9]* mldonkey-core-stable-[0.9]* \
+ mldonkey-devel-[0-9]*
+PKGNAMESUFFIX= -core-devel
.else
PLIST_SUB+= GUI=""
-CONFLICTS+= mldonkey-gui-devel-[0.9]*
+CONFLICTS+= mldonkey-gui-[0.9]*
.if !defined(WITHOUT_CORE)
-CONFLICTS+= mldonkey-[0-9]*
+CONFLICTS+= mldonkey-devel-[0-9]*
.endif
-BUILD_DEPENDS+= lablgtk:${PORTSDIR}/x11-toolkits/ocaml-lablgtk \
- ${LOCALBASE}/lib/ocaml/jabbr.cma:${PORTSDIR}/net-im/ocaml-jabbr
+BUILD_DEPENDS+= ${LOCALBASE}/lib/ocaml/lablgtk2/lablrsvg.cma:${PORTSDIR}/x11-toolkits/ocaml-lablgtk2
+LIB_DEPENDS+= rsvg-2.2:${PORTSDIR}/graphics/librsvg2
+
+CONFIGURE_ARGS+=--enable-gui=newgui2
# we don't need lablgtk as RUN dependency, but we need gtk+glib
-USE_GNOME= gtk12
+USE_GNOME= gtk20
+
+MAKE_ENV+= OCAMLRUNPARAM="l=256M"
.if defined(WITHOUT_CORE)
-PKGNAMESUFFIX= -gui
+PKGNAMESUFFIX= -gui-devel
PLIST_SUB+= CORE="@comment " GUICORE="@comment "
.else
PLIST_SUB+= CORE="" GUICORE=""
.endif
.endif
+.if defined(WITHOUT_GD)
+CONFIGURE_ARGS+=--disable-gd
+.elif !defined(WITHOUT_CORE)
+LIB_DEPENDS+= gd.4:${PORTSDIR}/graphics/gd
+.endif
DOCFILES= Authors.txt Bugs.txt ChangeLog Developers.txt FAQ.html \
Install.txt Readme.txt Todo.txt ed2k_links.txt
PORTDOCS= ${DOCFILES}
PKGMESSAGE= ${WRKDIR}/pkg-message
+# build additional tools
+ALL_TARGET+= \
+ mld_hash
+
.include <bsd.port.pre.mk>
+# Fix build on 4.x
+.if ${OSVERSION} < 500000
+USE_GCC= 3.4
+.endif
+
+# FreeBSD has reentrant dns code
+.if ( ((${OSVERSION} >= 504102) && (${OSVERSION} < 600000)) || (${OSVERSION} >= 600029) )
+PTHREAD_CFLAGS+= -D_REENTRANT
+.endif
+
+### Development version
+## Thus, we will use non standard threading library
+## We will switch from libpthread to libthr which should produce
+## better results in some scenarios. You can read more at pthread(3)
+.if defined(WITH_THR_THREAD_MODEL)
+PTHREAD_CFLAGS= -D_THREAD_SAFE
+PTHREAD_LIBS= -lthr
+.endif
+
pre-everything::
.if !defined(WITHOUT_GUI) && !defined(WITHOUT_CORE)
@${ECHO_MSG} "You can disable the GUI by defining WITHOUT_GUI."
@${ECHO_MSG} "You can disable the CORE by defining WITHOUT_CORE."
+ @${ECHO_MSG}
.endif
+.ifndef(WITH_THR_THREAD_MODEL)
+ @${ECHO_MSG} "Define WITH_THR_THREAD_MODEL to switch from"
+ @${ECHO_MSG} "pthread to thr threading model which could produce better"
+ @${ECHO_MSG} "results in some scenarios. Use at your discretion."
-pre-configure:
- @cd ${WRKSRC}/config && ${AUTOCONF}
+.endif
post-patch:
-.ifndef(WITHOUT_CORE)
- @${SED} -e "s|%%PREFIX%%|${PREFIX}|g ; s|%%RC_SUBR%%|${RC_SUBR}|g ; s|%%LOCALBASE%%|${LOCALBASE}|g" ${FILESDIR}/mlnet.sh > \
- ${WRKDIR}/mlnet.sh
@${SED} -e "s|%%PREFIX%%|${PREFIX}|" ${FILESDIR}/wrapper.sh > \
${WRKDIR}/wrapper.sh
-.endif
- ${REINPLACE_CMD} -E \
+ @${REINPLACE_CMD} -E \
-e 's|%%AUTOCONF%%|${AUTOCONF}|' \
${BUILD_WRKSRC}/config/Makefile.in
+# update server.met provider
+.for file in \
+ src/daemon/common/commonOptions.ml \
+ src/networks/donkey/donkeyServers.ml
+ @${REINPLACE_CMD} -E \
+ -e 's|http://www.gruk.org/server.met.gz|http://www.jd2k.com/server.met|' \
+ -e 's|http://www.bluetack.co.uk/config/antip2p.txt|http://www.bluetack.co.uk/config/level1.gz|' \
+ ${WRKSRC}/${file}
+.endfor
-post-build:
+pre-configure:
+ @cd ${WRKSRC}/config && ${AUTOCONF}
+
+post-configure:
+ @${REINPLACE_CMD} -E \
+ -e 's|^(PTHREAD_CFLAGS[^=]*=).*$$|\1${PTHREAD_CFLAGS}|' \
+ -e 's|^(PTHREAD_LIBS[^=]*=).*$$|\1${PTHREAD_LIBS}|' \
+ ${BUILD_WRKSRC}/config/Makefile.config
+
+pre-install:
+.if exists(${.CURDIR}/pkg-message)
+ @${SED} -e 's,%%DOCSDIR%%,${DOCSDIR},' \
+ < ${.CURDIR}/pkg-message > ${PKGMESSAGE}
+.elif exists(${MASTERDIR}/pkg-message)
@${SED} -e 's,%%DOCSDIR%%,${DOCSDIR},' \
< ${MASTERDIR}/pkg-message > ${PKGMESSAGE}
+.endif
do-install:
.ifndef(WITHOUT_CORE)
+ @${INSTALL_PROGRAM} ${WRKSRC}/mld_hash ${PREFIX}/bin
@${INSTALL_PROGRAM} ${WRKSRC}/mlnet ${PREFIX}/bin/mlnet-real
- @${INSTALL_SCRIPT} ${FILESDIR}/kill_mldonkey ${PREFIX}/bin
@${INSTALL_SCRIPT} ${WRKDIR}/wrapper.sh ${PREFIX}/bin/mlnet
- @${INSTALL_SCRIPT} ${WRKDIR}/mlnet.sh ${PREFIX}/etc/rc.d
+ @${MKDIR} ${EXAMPLESDIR}
+ @${INSTALL_SCRIPT} ${FILESDIR}/kill_mldonkey ${EXAMPLESDIR}
.endif
.ifndef(WITHOUT_GUI)
- @${INSTALL_PROGRAM} ${WRKSRC}/mlchat ${PREFIX}/bin
@${INSTALL_PROGRAM} ${WRKSRC}/mlgui ${PREFIX}/bin
- @${INSTALL_PROGRAM} ${WRKSRC}/mlim ${PREFIX}/bin
.endif
.ifndef(WITHOUT_CORE && WITHOUT_GUI)
@${INSTALL_SCRIPT} ${WRKSRC}/distrib/mldonkey_previewer ${PREFIX}/bin
@@ -110,8 +180,8 @@ do-install:
.endif
.ifndef(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
-.for file in ${DOCFILES}
- @${INSTALL_DATA} ${WRKSRC}/distrib/${file} ${DOCSDIR}
+.for _file in ${DOCFILES}
+ @${INSTALL_DATA} ${WRKSRC}/distrib/${_file} ${DOCSDIR}
.endfor
.endif
OpenPOWER on IntegriCloud