aboutsummaryrefslogtreecommitdiffstats
path: root/finance/openerp/Makefile
blob: 37c82978f46fbef2adf7c10cbdac892bcaa41b86 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# New ports collection makefile for:    openerp-server
# Date created:                27 February 2009
# Whom:                        Wen Heping <wenheping@gmail.com>
#
# $FreeBSD$
#

PORTNAME=   openerp-server
PORTVERSION=    6.0.3
PORTEPOCH=  1
CATEGORIES= finance python
MASTER_SITES=   http://www.openerp.com/download/stable/source/

MAINTAINER= laurent@ospowa.com
COMMENT=    Open source application ERP & CRM in Python using Postgresql

BUILD_DEPENDS=  ${PYTHON_SITELIBDIR}/PIL/__init__.py:${PORTSDIR}/graphics/py-imaging \
        ${PYTHON_SITELIBDIR}/libxml2.py:${PORTSDIR}/textproc/py-libxml2 \
        ${PYTHON_PKGNAMEPREFIX}pytz>0:${PORTSDIR}/devel/py-pytz \
        ${PYTHON_SITELIBDIR}/mx/__init__.py:${PORTSDIR}/lang/py-mx-base \
        ${PYTHON_PKGNAMEPREFIX}psycopg2>0:${PORTSDIR}/databases/py-psycopg2 \
        ${PYTHON_PKGNAMEPREFIX}chart>0:${PORTSDIR}/graphics/py-chart \
        ${PYTHON_PKGNAMEPREFIX}pydot>0:${PORTSDIR}/graphics/py-pydot \
        ${PYTHON_PKGNAMEPREFIX}libxslt>0:${PORTSDIR}/textproc/py-libxslt \
        ${PYTHON_PKGNAMEPREFIX}lxml>0:${PORTSDIR}/devel/py-lxml \
        ${PYTHON_PKGNAMEPREFIX}xml>0:${PORTSDIR}/textproc/py-xml \
        ${PYTHON_PKGNAMEPREFIX}yaml>0:${PORTSDIR}/devel/py-yaml \
        ${PYTHON_PKGNAMEPREFIX}mako>0:${PORTSDIR}/textproc/py-mako \
        ${PYTHON_PKGNAMEPREFIX}dateutil>0:${PORTSDIR}/devel/py-dateutil \
        ${PYTHON_SITELIBDIR}/reportlab/__init__.py:${PORTSDIR}/print/py-reportlab2
RUN_DEPENDS=    ${PYTHON_SITELIBDIR}/PIL/__init__.py:${PORTSDIR}/graphics/py-imaging \
        ${PYTHON_SITELIBDIR}/libxml2.py:${PORTSDIR}/textproc/py-libxml2 \
        ${PYTHON_PKGNAMEPREFIX}pytz>0:${PORTSDIR}/devel/py-pytz \
        ${PYTHON_SITELIBDIR}/mx/__init__.py:${PORTSDIR}/lang/py-mx-base \
        ${PYTHON_PKGNAMEPREFIX}psycopg2>0:${PORTSDIR}/databases/py-psycopg2 \
        ${PYTHON_PKGNAMEPREFIX}chart>0:${PORTSDIR}/graphics/py-chart \
        ${PYTHON_PKGNAMEPREFIX}pydot>0:${PORTSDIR}/graphics/py-pydot \
        ${PYTHON_PKGNAMEPREFIX}libxslt>0:${PORTSDIR}/textproc/py-libxslt \
        ${PYTHON_PKGNAMEPREFIX}lxml>0:${PORTSDIR}/devel/py-lxml \
        ${PYTHON_PKGNAMEPREFIX}xml>0:${PORTSDIR}/textproc/py-xml \
        ${PYTHON_PKGNAMEPREFIX}yaml>0:${PORTSDIR}/devel/py-yaml \
        ${PYTHON_PKGNAMEPREFIX}mako>0:${PORTSDIR}/textproc/py-mako \
        ${PYTHON_PKGNAMEPREFIX}dateutil>0:${PORTSDIR}/devel/py-dateutil \
        ${PYTHON_SITELIBDIR}/reportlab/__init__.py:${PORTSDIR}/print/py-reportlab2

USE_RC_SUBR=    openerpd
SUB_FILES=  openerp-server.conf pkg-message
SUB_LIST=   PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR}

USE_PYTHON=         2.5+
USE_PYDISTUTILS=        yes
PYDISTUTILS_EGGINFODIR=     ${PYTHON_SITELIBDIR}/openerp_server-${PORTVERSION}-${PYTHON_VERSION:S/thon//}.egg-info
PYDISTUTILS_EGGINFO=        PKG-INFO

USERS=      openerpd
GROUPS=     openerpd

MAN1=       openerp-server.1
MAN5=       openerp_serverrc.5

.include <bsd.port.pre.mk>

post-patch:
    @${REINPLACE_CMD} -e 's|/usr/bin/env python|${PYTHON_CMD}|g' ${WRKSRC}/bin/openerp-server.py

post-install:
.if !defined(NOPORTDOCS)
    ${MKDIR} ${DOCSDIR}
    @cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${DOCSDIR}
    @${FIND} -s -d ${DOCSDIR} -type f | ${SED} 's#${PREFIX}/##g' >> ${TMPPLIST}
    @${FIND} -s -d ${DOCSDIR} -type d | ${SED} 's#${PREFIX}/#@dirrm #g' >> ${TMPPLIST}
.endif

    ${INSTALL_MAN} ${WRKSRC}/man/openerp-server.1 ${PREFIX}/man/man1
    ${INSTALL_MAN} ${WRKSRC}/man/openerp_serverrc.5 ${PREFIX}/man/man5

    ${INSTALL_DATA} ${WRKDIR}/openerp-server.conf ${PREFIX}/etc/openerp-server.conf.sample
    @if  [ ! -f ${PREFIX}/etc/openerp-server.conf ]; then \
        ${CP} -p ${PREFIX}/etc/openerp-server.conf.sample ${PREFIX}/etc/openerp-server.conf ; \
    fi
    @${ECHO} '@unexec if cmp -s %D/etc/openerp-server.conf.sample %D/etc/openerp-server.conf; then rm -f %D/etc/openerp-server.conf; fi' >> ${TMPPLIST}
    @${ECHO} etc/openerp-server.conf.sample >> ${TMPPLIST}
    @${ECHO} '@exec if [ ! -f %D/etc/openerp-server.conf ]; then cp -p %D/%F %B/openerp-server.conf; fi' >> ${TMPPLIST}

    @${CHMOD} a+x ${PYTHONPREFIX_SITELIBDIR}/${PORTNAME}/openerp-server.py

    @${ECHO} bin/openerp-server >> ${TMPPLIST}
    @${FIND} -s -d ${PYTHON_SITELIBDIR}/${PORTNAME} \
        -type f | ${SED} 's#${PREFIX}/##g' >> ${TMPPLIST}
    @${FIND} -s -d ${PYTHON_SITELIBDIR}/${PORTNAME} \
        -type d | ${SED} 's#${PREFIX}/#@dirrm #g' >> ${TMPPLIST}
    @${FIND} -s -d ${PYDISTUTILS_EGGINFODIR} \
        -type f -print |grep -v PKG-INFO| ${SED} 's#${PREFIX}/##g' >> ${TMPPLIST}
    @${FIND} -s -d ${PYDISTUTILS_EGGINFODIR} \
        -type d | ${SED} 's#${PREFIX}/#@dirrm #g' >> ${TMPPLIST}

    @${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>