2002-09-20 18:48:34 +02:00
|
|
|
# New ports collection makefile for: mldonkey
|
|
|
|
# Date created: 21 August 2002
|
|
|
|
# Whom: Holger Lamm <holger@e-gitt.net>
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
PORTNAME= mldonkey
|
2005-11-02 01:36:53 +01:00
|
|
|
PORTVERSION= 2.6.7
|
2004-03-11 04:15:15 +01:00
|
|
|
CATEGORIES+= net
|
2005-07-11 04:29:35 +02:00
|
|
|
MASTER_SITES= ${MASTER_SITE_SAVANNAH}
|
|
|
|
MASTER_SITE_SUBDIR= ${PORTNAME}
|
2005-01-09 05:00:39 +01:00
|
|
|
PKGNAMESUFFIX= -devel
|
2002-09-20 18:48:34 +02:00
|
|
|
|
2005-01-09 05:00:39 +01:00
|
|
|
MAINTAINER?= lioux@FreeBSD.org
|
2003-06-15 21:54:06 +02:00
|
|
|
COMMENT?= A OCAML client for multiple peer-to-peer networks
|
2002-09-20 18:48:34 +02:00
|
|
|
|
2005-01-09 05:00:39 +01:00
|
|
|
BUILD_DEPENDS= ocamlc:${PORTSDIR}/lang/ocaml
|
2002-09-20 18:48:34 +02:00
|
|
|
|
2005-01-09 05:00:39 +01:00
|
|
|
NO_LATEST_LINK= yes
|
2005-08-28 21:01:22 +02:00
|
|
|
CONFLICTS= mldonkey-[0-9]*
|
2005-01-09 05:00:39 +01:00
|
|
|
|
|
|
|
USE_BZIP2= yes
|
2005-04-17 09:39:33 +02:00
|
|
|
USE_ICONV= yes
|
2005-10-10 18:38:19 +02:00
|
|
|
USE_RC_SUBR= yes
|
2005-03-18 04:15:06 +01:00
|
|
|
WANT_AUTOCONF_VER= 259
|
2005-01-09 05:00:39 +01:00
|
|
|
USE_REINPLACE= yes
|
2003-06-15 21:39:42 +02:00
|
|
|
GNU_CONFIGURE= yes
|
2005-01-09 05:00:39 +01:00
|
|
|
USE_GMAKE= yes
|
|
|
|
ALL_TARGET= opt
|
|
|
|
|
2005-04-17 09:39:33 +02:00
|
|
|
CONFIGURE_ARGS+=\
|
|
|
|
--enable-ocamlver=3 \
|
|
|
|
--with-libiconv-prefix=${LOCALBASE}
|
|
|
|
CONFIGURE_ENV+= \
|
2005-10-12 03:19:04 +02:00
|
|
|
NEWCXX="${CXX}" \
|
2005-04-17 09:39:33 +02:00
|
|
|
CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \
|
2005-05-07 05:27:18 +02:00
|
|
|
LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib" \
|
|
|
|
PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
|
|
|
|
PTHREAD_LIBS="${PTHREAD_LIBS}"
|
2005-01-09 05:00:39 +01:00
|
|
|
|
2005-05-07 05:27:18 +02:00
|
|
|
###
|
|
|
|
## Options activation
|
|
|
|
###
|
2003-06-15 21:39:42 +02:00
|
|
|
.if defined(WITHOUT_GUI)
|
|
|
|
.if defined(WITHOUT_CORE)
|
|
|
|
.error "Cool, you defined both WITHOUT_GUI and WITHOUT_CORE. I think I'll do nothing."
|
|
|
|
.endif
|
|
|
|
# have no 'without-' flag
|
2005-04-27 12:41:38 +02:00
|
|
|
CONFIGURE_ARGS+=--disable-gui \
|
|
|
|
--disable-gd
|
2003-06-15 21:39:42 +02:00
|
|
|
PLIST_SUB+= CORE="" GUI="@comment " GUICORE="@comment "
|
2005-08-28 21:01:22 +02:00
|
|
|
CONFLICTS+= mldonkey-core-[0.9]* mldonkey-core-stable-[0.9]* \
|
|
|
|
mldonkey-devel-[0-9]*
|
2005-01-09 05:00:39 +01:00
|
|
|
PKGNAMESUFFIX= -core-devel
|
2003-06-15 21:39:42 +02:00
|
|
|
.else
|
|
|
|
PLIST_SUB+= GUI=""
|
2005-08-28 21:01:22 +02:00
|
|
|
CONFLICTS+= mldonkey-gui-[0.9]*
|
|
|
|
.if !defined(WITHOUT_CORE)
|
|
|
|
CONFLICTS+= mldonkey-devel-[0-9]*
|
|
|
|
.endif
|
2003-06-15 21:39:42 +02:00
|
|
|
BUILD_DEPENDS+= lablgtk:${PORTSDIR}/x11-toolkits/ocaml-lablgtk \
|
2005-11-09 09:21:21 +01:00
|
|
|
${LOCALBASE}/lib/ocaml/jabbr.cma:${PORTSDIR}/net-im/ocaml-jabbr
|
2005-04-27 12:41:38 +02:00
|
|
|
LIB_DEPENDS+= gd.4:${PORTSDIR}/graphics/gd
|
2005-08-28 21:01:22 +02:00
|
|
|
|
|
|
|
CONFIGURE_ARGS+=--enable-gui=newgui1
|
2003-06-15 21:39:42 +02:00
|
|
|
# we don't need lablgtk as RUN dependency, but we need gtk+glib
|
|
|
|
USE_GNOME= gtk12
|
2005-03-16 04:45:21 +01:00
|
|
|
|
|
|
|
MAKE_ENV+= OCAMLRUNPARAM="l=256M"
|
2003-06-15 21:39:42 +02:00
|
|
|
.if defined(WITHOUT_CORE)
|
2005-01-09 05:00:39 +01:00
|
|
|
PKGNAMESUFFIX= -gui-devel
|
2003-06-15 21:39:42 +02:00
|
|
|
PLIST_SUB+= CORE="@comment " GUICORE="@comment "
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= CORE="" GUICORE=""
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2004-03-18 15:54:46 +01:00
|
|
|
DOCFILES= Authors.txt Bugs.txt ChangeLog Developers.txt FAQ.html \
|
|
|
|
Install.txt Readme.txt Todo.txt ed2k_links.txt
|
2005-01-09 05:00:39 +01:00
|
|
|
PORTDOCS= ${DOCFILES}
|
2005-08-28 21:01:22 +02:00
|
|
|
PKGMESSAGE= ${WRKDIR}/pkg-message
|
2003-06-15 21:39:42 +02:00
|
|
|
|
2004-09-19 03:05:44 +02:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2005-07-21 01:53:43 +02:00
|
|
|
.if ${ARCH} == "amd64" || ${ARCH} == "ia64"
|
|
|
|
BROKEN= "Does not compile on ${ARCH}"
|
|
|
|
.endif
|
|
|
|
|
2005-10-17 03:39:22 +02:00
|
|
|
# Fix build on 4.x
|
|
|
|
.if ${OSVERSION} < 500000
|
|
|
|
USE_GCC= 3.4
|
|
|
|
.endif
|
|
|
|
|
2005-05-07 05:27:18 +02:00
|
|
|
### 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
|
|
|
|
|
2003-06-15 21:39:42 +02:00
|
|
|
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."
|
2005-05-07 05:27:18 +02:00
|
|
|
@${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."
|
|
|
|
|
2003-06-15 21:39:42 +02:00
|
|
|
.endif
|
2002-09-20 18:48:34 +02:00
|
|
|
|
|
|
|
post-patch:
|
|
|
|
@${SED} -e "s|%%PREFIX%%|${PREFIX}|" ${FILESDIR}/wrapper.sh > \
|
|
|
|
${WRKDIR}/wrapper.sh
|
2005-01-09 05:00:39 +01:00
|
|
|
@${REINPLACE_CMD} -E \
|
|
|
|
-e 's|%%AUTOCONF%%|${AUTOCONF}|' \
|
2005-03-16 04:45:21 +01:00
|
|
|
${BUILD_WRKSRC}/config/Makefile.in
|
2005-10-10 18:38:19 +02:00
|
|
|
# rc.d
|
|
|
|
@${SED} -e "s|%%PREFIX%%|${PREFIX}|" \
|
|
|
|
${FILESDIR}/mlnet.sh > ${WRKDIR}/mlnet.sh
|
2005-03-16 04:45:21 +01:00
|
|
|
|
|
|
|
pre-configure:
|
|
|
|
cd ${WRKSRC}/config && ${AUTOCONF}
|
2002-09-20 18:48:34 +02:00
|
|
|
|
2005-05-07 05:27:18 +02:00
|
|
|
post-configure:
|
|
|
|
@${REINPLACE_CMD} -E \
|
|
|
|
-e 's|^(PTHREAD_CFLAGS[^=]*=).*$$|\1${PTHREAD_CFLAGS}|' \
|
|
|
|
-e 's|^(PTHREAD_LIBS[^=]*=).*$$|\1${PTHREAD_LIBS}|' \
|
|
|
|
${BUILD_WRKSRC}/config/Makefile.config
|
|
|
|
|
2005-08-28 21:01:22 +02:00
|
|
|
pre-install:
|
2005-08-30 23:45:04 +02:00
|
|
|
.if exists(${.CURDIR}/pkg-message)
|
2005-08-28 21:01:22 +02:00
|
|
|
@${SED} -e 's,%%DOCSDIR%%,${DOCSDIR},' \
|
|
|
|
< ${.CURDIR}/pkg-message > ${PKGMESSAGE}
|
2005-08-30 23:45:04 +02:00
|
|
|
.elif exists(${MASTERDIR}/pkg-message)
|
|
|
|
@${SED} -e 's,%%DOCSDIR%%,${DOCSDIR},' \
|
|
|
|
< ${MASTERDIR}/pkg-message > ${PKGMESSAGE}
|
|
|
|
.endif
|
2005-08-28 21:01:22 +02:00
|
|
|
|
2002-09-20 18:48:34 +02:00
|
|
|
do-install:
|
2003-06-15 21:39:42 +02:00
|
|
|
.ifndef(WITHOUT_CORE)
|
|
|
|
@${INSTALL_PROGRAM} ${WRKSRC}/mlnet ${PREFIX}/bin/mlnet-real
|
2003-01-27 18:53:01 +01:00
|
|
|
@${INSTALL_SCRIPT} ${FILESDIR}/kill_mldonkey ${PREFIX}/bin
|
2003-06-15 21:39:42 +02:00
|
|
|
@${INSTALL_SCRIPT} ${WRKDIR}/wrapper.sh ${PREFIX}/bin/mlnet
|
|
|
|
.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
|
|
|
|
@${INSTALL_PROGRAM} ${WRKSRC}/mlguistarter ${PREFIX}/bin
|
|
|
|
@${INSTALL_PROGRAM} ${WRKSRC}/mlnet+gui ${PREFIX}/bin
|
|
|
|
.endif
|
2002-09-20 18:48:34 +02:00
|
|
|
.ifndef(NOPORTDOCS)
|
|
|
|
@${MKDIR} ${DOCSDIR}
|
2003-01-26 19:42:48 +01:00
|
|
|
.for file in ${DOCFILES}
|
2003-06-15 21:39:42 +02:00
|
|
|
@${INSTALL_DATA} ${WRKSRC}/distrib/${file} ${DOCSDIR}
|
2003-01-26 19:42:48 +01:00
|
|
|
.endfor
|
2002-09-20 18:48:34 +02:00
|
|
|
.endif
|
2005-10-10 18:38:19 +02:00
|
|
|
# rc.d
|
|
|
|
@${INSTALL_SCRIPT} ${WRKDIR}/mlnet.sh \
|
|
|
|
${PREFIX}/etc/rc.d
|
2002-09-20 18:48:34 +02:00
|
|
|
|
|
|
|
post-install:
|
2003-06-15 21:39:42 +02:00
|
|
|
@${CAT} ${PKGMESSAGE}
|
2003-01-31 17:53:15 +01:00
|
|
|
|
2003-06-15 21:39:42 +02:00
|
|
|
install-user: extract
|
|
|
|
.if !defined(LANG)
|
|
|
|
@${ECHO_MSG} "Please call as: make install-user LANG=<lang>"
|
|
|
|
@${ECHO_MSG} "with <lang> one of en,de,fr,fr.noaccents,sp !"
|
|
|
|
.else
|
|
|
|
@${CP} ${WRKSRC}/distrib/i18n/gui_messages.ini.${LANG}\
|
|
|
|
${HOME}/.mldonkey_gui_messages.ini
|
2003-01-31 17:53:15 +01:00
|
|
|
.endif
|
|
|
|
|
2004-09-19 03:05:44 +02:00
|
|
|
.include <bsd.port.post.mk>
|