aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia/vdr/Makefile
blob: 578df8da442a931f2eb31edadabb03ce71ed3054 (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
# New ports collection makefile for:    vdr
# Date created:     Wed Apr 14 18:11:42 CEST 2010
# Whom:         Juergen Lock <nox@freebsd.org>
#
# $FreeBSD$
#

PORTNAME=   vdr
PORTVERSION=    1.7.17
PORTREVISION=   1
CATEGORIES= multimedia
MASTER_SITES=   ftp://ftp.tvdr.de/vdr/Developer/

MAINTAINER= nox@FreeBSD.org
COMMENT=    Video Disk Recorder - development version

BUILD_DEPENDS=  ${LOCALBASE}/include/linux/dvb/frontend.h:${PORTSDIR}/multimedia/v4l_compat
LIB_DEPENDS=    jpeg.11:${PORTSDIR}/graphics/jpeg
BUILD_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/fontconfig.pc:${PORTSDIR}/x11-fonts/fontconfig
RUN_DEPENDS+=   ${LOCALBASE}/libdata/pkgconfig/fontconfig.pc:${PORTSDIR}/x11-fonts/fontconfig

OPTIONS=    IPTVPATCH "Stops EIT scans on IPTV channels" On \
        AC3PATCH "North America DVB-S AC3 audio workaround" Off

DIST_SUBDIR=    vdr
USE_BZIP2=  yes
USE_GMAKE=  yes
USE_GNOME+= pkgconfig
USE_GETTEXT=    yes
PORTDOCS=   COPYING INSTALL MANUAL README
MAKE_JOBS_SAFE= yes
MAN1=       vdr.1
MAN5=       vdr.5
MANCOMPRESSED=  yes
MAKE_JOBS_SAFE= yes
CONFDIR=    $(ETCDIR)
MAKE_ARGS+= DVBDIR=${LOCALBASE}/include
MAKE_ARGS+= VDR_USER=${VDR_USER}
MAKE_ARGS+= CONFDIR=$(CONFDIR)
MAKE_ARGS+= OSTYPE=FreeBSD
MAKE_ARGS+= LIRC_DEVICE=/var/run/lirc/lircd
ALL_TARGET= all plugins

VIDEODIR=   /video
SUB_LIST+=  VIDEODIR=${VIDEODIR}
USE_RC_SUBR=    vdr
VDR_USER=   vdr
VDR_GROUP=  vdr
USERS=      ${VDR_USER}
GROUPS=     ${VDR_GROUP}
PLIST_SUB=  VDR_USER=${VDR_USER}
PLIST_SUB+= VDR_GROUP=${VDR_GROUP}

.include <bsd.port.options.mk>

.if defined(WITH_IPTVPATCH)
EXTRA_PATCHES+= ${FILESDIR}/vdr-1.7.15-disable_ca_updates.patch \
    ${FILESDIR}/vdr-1.7.15-disable_eitscan.patch
.endif
.if defined(WITH_AC3PATCH)
EXTRA_PATCHES+= ${FILESDIR}/vdr-1.7.17-fix_na_dvbs_ac3.diff
.endif

.if !defined(WITHOUT_NLS)
PLIST_SUB+= NLS=""
.else
PLIST_SUB+= NLS="@comment "
ALL_TARGET= vdr plugins
.endif

post-patch:
    @${SED} 's|^\(VIDEODIR[[:space:]]*\)[?]*\(=[[:space:]]*\).*|\1\2${VIDEODIR}|' \
        ${WRKSRC}/Make.config.template >${WRKSRC}/Make.config
    @${REINPLACE_CMD} -e 's|%%CONFDIR%%|${CONFDIR}|' ${WRKSRC}/vdr.1

post-install:
.if !defined(WITHOUT_NLS)
    @(cd ${WRKSRC} && ${COPYTREE_SHARE} locale ${PREFIX}/share/)
.endif
    ${MKDIR} ${CONFDIR}/plugins
    ${CHOWN} ${VDR_USER}:${VDR_GROUP} ${CONFDIR} ${CONFDIR}/plugins
    ${INSTALL_DATA} ${FILESDIR}/remote.conf ${CONFDIR}/remote.conf.sample
    @if [ ! -f ${CONFDIR}/remote.conf ]; then \
        ${INSTALL_DATA} -o ${VDR_USER} -g ${VDR_GROUP} ${FILESDIR}/remote.conf ${CONFDIR}; \
    fi
    for i in $$(cd ${WRKSRC} && ls *.conf); do \
        ${INSTALL_DATA} ${WRKSRC}/$$i ${CONFDIR}/$$i.sample; \
        if [ ! -f ${CONFDIR}/$$i ]; then \
            ${INSTALL_DATA} -o ${VDR_USER} -g ${VDR_GROUP} ${WRKSRC}/$$i ${CONFDIR}/$$i; \
        fi; \
    done
.if !defined(NOPORTDOCS)
    ${MKDIR} ${DOCSDIR}
    (cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR})
.endif

.include <bsd.port.mk>