aboutsummaryrefslogtreecommitdiffstats
path: root/comms/svxlink/Makefile
blob: 61a43a32e9d1a6a59a09c30d4a1ac197e2524e2c (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
100
101
102
103
104
105
106
# Created by: shurd
# $FreeBSD$

PORTNAME?=  svxlink
PORTVERSION=    15.11
PORTREVISION=   5
CATEGORIES= comms hamradio

MAINTAINER= hamradio@FreeBSD.org
COMMENT?=   General purpose ham radio voice services

LICENSE=    GPLv2

LIB_DEPENDS?=   libgsm.so:audio/gsm \
        libspeex.so:audio/speex \
        libgpg-error.so:security/libgpg-error \
        libgcrypt.so:security/libgcrypt \
        libsigc-2.0.so:devel/libsigc++20 \
        libpopt.so:devel/popt \
        libopus.so:audio/opus \
        librtlsdr.so:comms/rtl-sdr
BUILD_DEPENDS=  ${LOCALBASE}/include/linux/input.h:devel/evdev-proto

USES+=      cmake compiler:c++11-lang groff pkgconfig tcl 
USE_GITHUB= yes
GH_ACCOUNT= sm0svx
GH_PROJECT= svxlink

CMAKE_SOURCE_PATH=  ${WRKSRC}/src
CMAKE_ARGS+=    -DMAN_INSTALL_DIR:FILEPATH=${MANDIRS} \
        -DLOCAL_STATE_DIR=/var
.if ${PORTNAME}==svxlink
CMAKE_ARGS+=    -DUSE_QT:BOOL=NO
.endif
USE_LDCONFIG=   yes

ALL_TARGET?=    all man
OPTIONS_DEFINE= DOXYGEN STATIC DOCS
STATIC_DESC=    Build and install static libraries
STATIC_CMAKE_ON=    -DBUILD_STATIC_LIBS=YES
.if ${PORTNAME}==svxlink
OPTIONS_DEFAULT=OSS ALSA
OPTIONS_MULTI=  SOUND
OPTIONS_MULTI_SOUND=    ALSA OSS
ALSA_LIB_DEPENDS=   libasound.so:audio/alsa-lib
ALSA_CMAKE_OFF= -DUSE_ALSA:BOOL=OFF
ALSA_CMAKE_ON=  -DUSE_ALSA:BOOL=ON
OSS_CMAKE_OFF=  -DUSE_OSS:BOOL=OFF
OSS_CMAKE_ON=   -DUSE_OSS:BOOL=ON
.endif
DOXYGEN_IMPLIES=    DOCS
DOXYGEN_ALL_TARGET=doc
DOXYGEN_CMAKE_OFF=  -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen:BOOL=TRUE
DOXYGEN_BUILD_DEPENDS=  doxygen:devel/doxygen \
            dot:graphics/graphviz
OPTIONS_SUB=    yes
PORTDOCS=   *

post-patch:
    @${GREP} -lr /dev/ttyS0 ${WRKSRC} | ${GREP} -v .bak | ${GREP} -v .orig | ${XARGS} \
        ${REINPLACE_CMD} -e 's|/dev/ttyS0|/dev/ttyu0|'
    @${REINPLACE_CMD} -e 's|/usr/share/icons|${PREFIX}/share/icons|' \
        ${WRKSRC}/src/qtel/qtel.desktop
    @${REINPLACE_CMD} -e 's|/usr/share/svxlink|${DOCSDIR}|' \
        ${WRKSRC}/src/doc/man/svxlink.conf.5
    @${REINPLACE_CMD} -e 's|/usr/bin/|${PREFIX}/bin/|' ${WRKSRC}/src/qtel/qtel.desktop \
        ${WRKSRC}/src/doc/man/svxlink.conf.5 \
        ${WRKSRC}/src/svxlink/svxlink/svxlink.conf.in
    @${REINPLACE_CMD} -e 's|/usr/lib|${PREFIX}/lib|' \
        ${WRKSRC}/src/doc/man/svxlink.conf.5 \
        ${WRKSRC}/src/svxlink/svxlink/svxlink.conf.in
post-patch-OSS-on:
    @${GREP} -lr alsa:default ${WRKSRC} | ${GREP} -v .bak | ${GREP} -v .orig | ${XARGS} \
        ${REINPLACE_CMD} -e 's|alsa:default|oss:/dev/dsp|'
    @${GREP} -lr alsa:plughw:0 ${WRKSRC} | ${GREP} -v .bak | ${GREP} -v .orig | ${XARGS} \
        ${REINPLACE_CMD} -e 's|alsa:plughw:0|oss:/dev/dsp|'

.if ${PORTNAME}==svxlink
post-install:
    ${MV}   ${STAGEDIR}${PREFIX}/etc/svxlink/.procmailrc \
        ${STAGEDIR}${PREFIX}/etc/svxlink/.procmailrc.sample
    ${MV}   ${STAGEDIR}${PREFIX}/etc/svxlink/TclVoiceMail.conf \
        ${STAGEDIR}${PREFIX}/etc/svxlink/TclVoiceMail.conf.sample
    ${MV}   ${STAGEDIR}${PREFIX}/etc/svxlink/remotetrx.conf \
        ${STAGEDIR}${PREFIX}/etc/svxlink/remotetrx.conf.sample
    ${MV}   ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.conf \
        ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.conf.sample
    ${MV}   ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleDtmfRepeater.conf \
        ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleDtmfRepeater.conf.sample
    ${MV}   ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleEchoLink.conf \
        ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleEchoLink.conf.sample
    ${MV}   ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleHelp.conf \
        ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleHelp.conf.sample
    ${MV}   ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleMetarInfo.conf \
        ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleMetarInfo.conf.sample
    ${MV}   ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleParrot.conf \
        ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleParrot.conf.sample
    ${MV}   ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModulePropagationMonitor.conf \
        ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModulePropagationMonitor.conf.sample
    ${MV}   ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleSelCallEnc.conf \
        ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleSelCallEnc.conf.sample
    ${MV}   ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleTclVoiceMail.conf \
        ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleTclVoiceMail.conf.sample
.endif

.include <bsd.port.mk>