aboutsummaryrefslogtreecommitdiffstats
path: root/net-im/py-xmpppy-yahoo/Makefile
blob: 6f198045c354622e2469df0694f3c26cfa0aa791 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Created by: Michael Nottebrock <lofi@FreeBSD.org>
# $FreeBSD$

PORTNAME=   yahoo
PORTVERSION=    0.3.20070314
PORTREVISION=   1
CATEGORIES= net-im python
MASTER_SITES=   ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR=lofi
PKGNAMEPREFIX=  xmpppy-
DISTNAME=   yahoo-transport-${PORTVERSION}

MAINTAINER= ports@FreeBSD.org
COMMENT=    Yahoo! transport for Jabber

OPTIONS_DEFINE= EJABBERD
EJABBERD_DESC=  transport with ejabberd

RUN_DEPENDS+=   ${PYTHON_SITELIBDIR}/xmpp/__init__.py:${PORTSDIR}/net-im/py-xmpppy \
        ${PYTHON_SITELIBDIR}/DNS/__init__.py:${PORTSDIR}/dns/py-dns

USE_PYTHON= yes
NO_BUILD=   yes
FILES=      adhoc.py config.py jep0133.py roomlist.py xmlconfig.py \
        yahoo_helpers.py avatar.py htmlutils.py migratespool.py toolbox.py \
        yahoo.py ylib.py
FILES_CURPHOO=  YahooMD5.py __init__.py cpformat.py md5crypt.py pysha.py yahoo_fn.py
PFILES=     ${FILES:S.^.%%PYTHON_SITELIBDIR%%/xmpp/yahoo/.} \
        ${FILES_CURPHOO:S.^.%%PYTHON_SITELIBDIR%%/xmpp/yahoo/curphoo/.}
PLIST_FILES=    ${PFILES} ${PFILES:S.$.c.} ${PFILES:S.$.o.} etc/${UNIQUENAME:S.-._.}.conf.sample
PLIST_DIRS= %%PYTHON_SITELIBDIR%%/xmpp/yahoo/curphoo %%PYTHON_SITELIBDIR%%/xmpp/yahoo
SUB_LIST+=  PYTHON_CMD=${PYTHON_CMD} BINDIR=${PYTHON_SITELIBDIR}/xmpp/yahoo \
        JABBER_USER=${JABBER_USER}
USE_RC_SUBR=    ${UNIQUENAME:S/-/_/}
DDIR=       ${PYTHON_SITELIBDIR}/xmpp/yahoo

NO_STAGE=   yes
.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MEJABBERD}
JABBER_USER?=   ejabberd
SUB_LIST+=  JABBER_REQUIRE=ejabberd
.else
JABBER_USER?=   jabber
SUB_LIST+=  JABBER_REQUIRE=jabberd
.endif

post-patch:
    @${GREP} -lr '/usr/bin/env python' ${WRKSRC} | \
        ${XARGS} ${REINPLACE_CMD} -e "s|/usr/bin/env python|${PYTHON_CMD}|"
    @${REINPLACE_CMD} -e "s|/etc/pyyimt.conf.xml|${PREFIX}/etc/${UNIQUENAME:S.-._.}.conf|" \
        -e 's|pid = ""|pid = "/var/jabberd/pid/PyYIMt.pid"|g' \
        -e 's|spoolFile = "user.dbm"|spoolFile = "/var/spool/jabberd/yahoouser.dbm"|g' \
        ${WRKSRC}/config.py
    @${REINPLACE_CMD} -e '/spoolFile/s|yahoouser.dbm|/var/spool/jabberd/yahoouser.dbm|' \
            -e 's|<debugFile.*|<!-- <debugFile>yahooerror.log</debugFile> -->|' \
        -e 's|PyYIMt.pid|/var/jabberd/pid/PyYIMt.pid|' \
        ${WRKSRC}/config_example.xml

do-install:
    @${INSTALL} -d ${DDIR}
    @${INSTALL_DATA} ${FILES:S.^.${WRKSRC}/.} ${DDIR}/
    @${INSTALL_SCRIPT} ${WRKSRC}/yahoo.py ${DDIR}/
    @${MKDIR} ${DDIR}/curphoo
    @${INSTALL_DATA} ${FILES_CURPHOO:S.^.${WRKSRC}/curphoo/.} ${DDIR}/curphoo/
    @${INSTALL_DATA} ${WRKSRC}/config_example.xml ${PREFIX}/etc/${UNIQUENAME:S.-._.}.conf.sample
    @${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py ${DDIR}
    @${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py ${DDIR}
    @${CHMOD} -R a-w ${DDIR}

post-install:
    @${ECHO_CMD}
    @${ECHO_CMD} "****************************************************"
    @${ECHO_CMD} "A sample configuration file has been installed in"
    @${ECHO_CMD} "${PREFIX}/etc/${UNIQUENAME:S.-._.}.conf.sample"
    @${ECHO_CMD} 
    @${ECHO_CMD} "Follow the setup instructions at"
    @${ECHO_CMD} "http://wiki.blathersource.org/wiki/index.php/PyYIMt."
    @${ECHO_CMD} "****************************************************"
    @${ECHO_CMD}

.include <bsd.port.mk>