aboutsummaryrefslogtreecommitdiffstats
path: root/misc/freeswitch-scripts/Makefile
blob: a1e55697909f274748bae8ae84c70677e2f6ae30 (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
# Ports collection makefile for: freeswitch scripts
# Date created: september , 2009
# Whom: Richard Neese <r.neese@gmail.com>
#
# $FreeBSD$
#

PORTNAME=   freeswitch-scripts
PORTVERSION=    201044
CATEGORIES= misc
MASTER_SITES=   ftp://ftp.secure-computing.net/pub/freeswitch/ \
        ftp://ftp2.secure-computing.net/pub/freeswitch/
DISTNAME=   ${BASE_PORTNAME}-${PORTVERSION}
DIST_SUBDIR=    ${BASE_PORTNAME}

MAINTAINER= r.neese@gmail.com
COMMENT=    FreeSwitch Scripts

NO_BUILD=   yes
BASE_PORTNAME=  freeswitch
SUB_FILES=  pkg-install

FREESWITCH_USER=    freeswitch
FREESWITCH_GROUP=   ${FREESWITCH_USER}

WRKSRC=     ${WRKDIR}/${BASE_PORTNAME}-${PORTVERSION}/scripts/

OPTIONS=    JAVASCRIPT  "Install FreeSWITCH JAVASCRIPTS" off \
        PERL        "Install FreeSWITCH Perl Scripts" off \
        PYTHON      "Install FreeSWITCH Python Scripts" off \
        PHP     "Install FreeSWITCH PHP Scripts" off \
        RSS     "Install FreeSWITCH RSS Scripts" off \
        LUA     "Install FreeSWITCH LUA Scripts" off

.include <bsd.port.options.mk>

.for i in JAVASCRIPT PERL PYTHON PHP RSS LUA C
.if !defined(WITH_${i})
PLIST_SUB+= WITH_${i}="@comment "
.else
PLIST_SUB+= WITH_${i}=""
.endif
.endfor

pre-install:
    @${SH} ${PKGINSTALL} ${BASE_PORTNAME} PRE-INSTALL

.if ! exists(${PREFIX}/etc/${BASE_PORTNAME}/scripts)
    ${MKDIR} ${PREFIX}/etc/${BASE_PORTNAME}/scripts
    ${CHOWN} ${FREESWITCH_USER}:${FREESWITCH_GROUP} ${PREFIX}/etc/${BASE_PORTNAME}/scripts
.endif
    ${TOUCH} ${PREFIX}/etc/${BASE_PORTNAME}/scripts/.freeswitch-scripts
    ${CHOWN} ${FREESWITCH_USER}:${FREESWITCH_GROUP} ${PREFIX}/etc/${BASE_PORTNAME}/scripts/.freeswitch-scripts

do-install:
.if defined(WITH_JAVASCRIPT)
    @${RM} ${WRKSRC}/javascript/ps_pizza.js
    @${RM} ${WRKSRC}/javascript/pizza.js
    @${RM} -rf ${WRKSRC}/javascript/js_modules
    @cd ${WRKSRC}; ${FIND} javascript  \
        | ${CPIO} -pdm -R ${FREESWITCH_USER}:${FREESWITCH_GROUP} ${PREFIX}/etc/${BASE_PORTNAME}/scripts
.endif

.if defined(WITH_PERL)
    @cd ${WRKSRC}; ${FIND} perl \
        | ${CPIO} -pdm -R ${FREESWITCH_USER}:${FREESWITCH_GROUP} ${PREFIX}/etc/${BASE_PORTNAME}/scripts
.endif

.if defined(WITH_PYTHON)
    @cd ${WRKSRC}; ${FIND} python  \
        | ${CPIO} -pdm -R ${FREESWITCH_USER}:${FREESWITCH_GROUP} ${PREFIX}/etc/${BASE_PORTNAME}/scripts

.endif

.if defined(WITH_PHP)
    @cd ${WRKSRC}; ${FIND} php  \
        | ${CPIO} -pdm -R ${FREESWITCH_USER}:${FREESWITCH_GROUP} ${PREFIX}/etc/${BASE_PORTNAME}/scripts
.endif

.if defined(WITH_RSS)
    @cd ${WRKSRC}; ${FIND} rss  \
        | ${CPIO} -pdm -R ${FREESWITCH_USER}:${FREESWITCH_GROUP} ${PREFIX}/etc/${BASE_PORTNAME}/scripts
.endif

.if defined(WITH_LUA)
    @cd ${WRKSRC}; ${FIND} lua  \
        | ${CPIO} -pdm -R ${FREESWITCH_USER}:${FREESWITCH_GROUP} ${PREFIX}/etc/${BASE_PORTNAME}/scripts
.endif

.include <bsd.port.mk>