aboutsummaryrefslogtreecommitdiff
path: root/multimedia/sms1xxx-kmod/Makefile
blob: 748090c18ec06f13a4c5a3d7fd4e341a8efabdc5 (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
107
108
# Created by: Ganael Laplanche <ganael.laplanche@martymac.org>

PORTNAME=	sms1xxx
PORTVERSION=	20120113
PORTREVISION=	2
CATEGORIES=	multimedia
MASTER_SITES=	http://contribs.martymac.org/FreeBSD-siano/
PKGNAMESUFFIX=	-kmod
DISTNAME=	siano-${PORTVERSION}
DIST_SUBDIR=	${PORTNAME}

MAINTAINER=	martymac@FreeBSD.org
COMMENT=	Native FreeBSD driver for Siano-based USB DVB devices

LICENSE=	GPLv2

ONLY_FOR_ARCHS=	amd64 i386

WRKSRC=	${WRKDIR}/siano-${PORTVERSION}

NO_PACKAGE=	should be recompiled for a particular FreeBSD kernel

NO_OPTIONS_SORT=	yes
OPTIONS_DEFINE=	DOCS RC5WATCH DEBUG
OPTIONS_MULTI=	FIRMWARE
OPTIONS_MULTI_FIRMWARE=	STELLAR NOVA
OPTIONS_DEFAULT=	RC5WATCH NOVA
OPTIONS_SUB=	yes
RC5WATCH_DESC=	Build rc5watch IR utility
DEBUG_ALL_TARGET=	debug
STELLAR_DESC=	Build Terratec Cinergy Piranha FW
NOVA_DESC=	Build Hauppauge WinTV MiniStick FW

SUB_FILES=	pkg-message

PORTDOCS=	CHANGELOG README COPYING

# Supported firmwares / firmwares to build
STELLAR_FW=	stellar_dvbt
NOVA_FW=	novab0_dvbbda
BUILD_FWS=

USES=		kmod tar:tgz

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MSTELLAR}
BUILD_FWS+=	${STELLAR_FW}
.if !exists(${DISTDIR}/${DIST_SUBDIR}/${STELLAR_FW}.fw)
.if !defined(DISTFILE_INSTRUCTIONS)
DISTFILE_INSTRUCTIONS=\n\
	Due to licensing restrictions, firmware files must be fetched manually.\n
.endif
DISTFILE_INSTRUCTIONS+=	\
	\n- Please, get the appropriate firmware for your Stellar device\n\
	and copy the file to '${DISTDIR}/${DIST_SUBDIR}/${STELLAR_FW}.fw'\n
.endif
.endif

.if ${PORT_OPTIONS:MNOVA}
BUILD_FWS+=	${NOVA_FW}
.if !exists(${DISTDIR}/${DIST_SUBDIR}/${NOVA_FW}.fw)
.if !defined(DISTFILE_INSTRUCTIONS)
DISTFILE_INSTRUCTIONS=\n\
	Due to licensing restrictions, firmware files must be fetched manually.\n
.endif
DISTFILE_INSTRUCTIONS+=	\
	\n- Please, get the appropriate firmware for your Nova device\n\
	and copy the file to '${DISTDIR}/${DIST_SUBDIR}/${NOVA_FW}.fw'\n
.endif
.endif

.if defined(DISTFILE_INSTRUCTIONS)
.if defined(PACKAGE_BUILDING)
IGNORE=	requires manual fetch
.else
pre-fetch:
	@${MKDIR} ${DISTDIR}/${DIST_SUBDIR}; \
	 ${PRINTF} "${DISTFILE_INSTRUCTIONS}"; \
	exit 1
.endif
.endif

post-patch:
	@${REINPLACE_CMD} -e 's|SUBDIR=|SUBDIR= ${BUILD_FWS}|' \
		${WRKSRC}/firmwares/Makefile

pre-build:
.if ${PORT_OPTIONS:MSTELLAR}
	@${CP} ${DISTDIR}/${DIST_SUBDIR}/${STELLAR_FW}.fw ${WRKSRC}/firmwares/${STELLAR_FW}/
.endif
.if ${PORT_OPTIONS:MNOVA}
	@${CP} ${DISTDIR}/${DIST_SUBDIR}/${NOVA_FW}.fw ${WRKSRC}/firmwares/${NOVA_FW}/
.endif

post-build:
.if ${PORT_OPTIONS:MRC5WATCH}
	 @cd ${WRKSRC}/apps/rc5watch/ && ${MAKE} all
.endif

post-install:
.if ${PORT_OPTIONS:MRC5WATCH}
	${INSTALL_PROGRAM} ${WRKSRC}/apps/rc5watch/rc5watch ${STAGEDIR}${PREFIX}/bin/rc5watch
.endif
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>