aboutsummaryrefslogtreecommitdiff
path: root/net/mediatomb/Makefile
blob: 00b615371243e7d0e993d67c15443df9bf8c770f (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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# Created by: Leonhard Wimmer <leo@mediatomb.cc>
# $FreeBSD$

PORTNAME=	mediatomb
PORTVERSION=	0.12.1
PORTREVISION=	12
CATEGORIES=	net multimedia
MASTER_SITES=	SF/${PORTNAME}/MediaTomb/${PORTVERSION}

MAINTAINER=	leo@mediatomb.cc
COMMENT=	UPnP AV MediaServer

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/COPYING

LIB_DEPENDS=	libexpat.so:${PORTSDIR}/textproc/expat2

GNU_CONFIGURE=	yes
CPPFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-lpthread -L${LOCALBASE}/lib ${ICONV_LIB}
CONFIGURE_ARGS=	--with-search="${LOCALBASE}" \
		--disable-inotify
CONFIGURE_ENV=	PTHREAD_LIBS="-lpthread"
USES=		compiler:gcc-c++11-lib iconv
USE_RC_SUBR=	mediatomb

USERS=		mediatomb
GROUPS=		${USERS}

SUB_FILES=	config.xml.dist \
		pkg-install \
		pkg-deinstall

SUB_LIST=	MEDIATOMB_USER=${USERS} \
		MEDIATOMB_GROUP=${GROUPS} \
		MEDIATOMB_DIR=${DESTDIR}/var/db/mediatomb

OPTIONS_DEFINE=	JS LIBEXIF FFMPEGTHUMBNAILER \
		EXTERNAL_TRANSCODING CURL DEBUG
OPTIONS_MULTI=	DB
OPTIONS_MULTI_DB=	SQLITE MYSQL
OPTIONS_RADIO=	METADATA TAG
OPTIONS_RADIO_METADATA=	FFMPEG LIBEXTRACTOR
OPTIONS_RADIO_TAG=	TAGLIB ID3LIB
METADATA_DESC=	Metadata extractor
TAG_DESC=	Tag library
OPTIONS_DEFAULT=	SQLITE MYSQL JS LIBEXIF TAGLIB FFMPEG FFMPEGTHUMBNAILER \
			EXTERNAL_TRANSCODING CURL
DB_DESC=			Database backend
JS_DESC=			JavaScript (SpiderMonkey) support
TAGLIB_DESC=			taglib support
FFMPEG_DESC=			ffmpeg metadata extraction support
FFMPEGTHUMBNAILER_DESC=		ffmpeg thumbnailer support
EXTERNAL_TRANSCODING_DESC=	external transcoding support
ID3LIB_DESC=			id3lib support
LIBEXTRACTOR_DESC=		libextractor support

.include <bsd.port.pre.mk>

.if ${PORT_OPTIONS:MSQLITE}
CONFIGURE_ARGS+=	--enable-sqlite3 \
			--with-sqlite3-h="${LOCALBASE}/include" \
			--with-sqlite3-libs="${LOCALBASE}/lib"
LIB_DEPENDS+=		libsqlite3.so:${PORTSDIR}/databases/sqlite3
.else
CONFIGURE_ARGS+=	--disable-sqlite3
.endif

.if ${PORT_OPTIONS:MMYSQL}
CONFIGURE_ARGS+=	--enable-mysql \
			--with-mysql-cfg="${LOCALBASE}/bin/mysql_config"
USE_MYSQL=		yes
.else
CONFIGURE_ARGS+=	--disable-mysql
.endif

.if ${PORT_OPTIONS:MJS}
CONFIGURE_ARGS+=	--enable-libjs \
			--with-js-h="${LOCALBASE}/include" \
			--with-js-libs="${LOCALBASE}/lib"
LIB_DEPENDS+=		libjs.so:${PORTSDIR}/lang/spidermonkey17
.else
CONFIGURE_ARGS+=	--disable-libjs
.endif

.if ${PORT_OPTIONS:MLIBEXIF}
CONFIGURE_ARGS+=	--enable-libexif \
			--with-libexif-h="${LOCALBASE}/include" \
			--with-libexif-libs="${LOCALBASE}/lib"
LIB_DEPENDS+=		libexif.so:${PORTSDIR}/graphics/libexif
.else
CONFIGURE_ARGS+=	--disable-libexif
.endif

.if ${PORT_OPTIONS:MEXTERNAL_TRANSCODING}
CONFIGURE_ARGS+=	--enable-external-transcoding
.else
CONFIGURE_ARGS+=	--disable-external-transcoding
.endif

.if ${PORT_OPTIONS:MFFMPEGTHUMBNAILER}
CONFIGURE_ARGS+=	--enable-ffmpegthumbnailer \
			--with-ffmpegthumbnailer-h="${LOCALBASE}/include" \
			--with-ffmpegthumbnailer-libs="${LOCALBASE}/lib"
LIB_DEPENDS+=		libffmpegthumbnailer.so:${PORTSDIR}/multimedia/ffmpegthumbnailer
.else
CONFIGURE_ARGS+=	--disable-ffmpegthumbnailer
.endif

# CURL is only useful in combination with EXTERNAL_TRANSCODING
.if ${PORT_OPTIONS:MCURL} && ${PORT_OPTIONS:MEXTERNAL_TRANSCODING}
CONFIGURE_ARGS+=	--enable-curl \
			--with-curl-cfg="${LOCALBASE}/bin/curl-config"
LIB_DEPENDS+=	libcurl.so:${PORTSDIR}/ftp/curl
.else
CONFIGURE_ARGS+=	--disable-curl
.endif

.if ${PORT_OPTIONS:MFFMPEG}
CONFIGURE_ARGS+=	--enable-ffmpeg
LIB_DEPENDS+=		libavformat.so:${PORTSDIR}/multimedia/ffmpeg
.else
CONFIGURE_ARGS+=	--disable-ffmpeg
.endif

.if ${PORT_OPTIONS:MLIBEXTRACTOR}
CONFIGURE_ARGS+=	--enable-libextractor \
			--with-extractor-h="${LOCALBASE}/include" \
			--with-extractor-libs="${LOCALBASE}/lib"
LIB_DEPENDS+=		libextractor.so:${PORTSDIR}/textproc/libextractor
.else
CONFIGURE_ARGS+=	--disable-libextractor
.endif

.if ${PORT_OPTIONS:MID3LIB}
CONFIGURE_ARGS+=	--enable-id3lib \
			--with-id3lib-h="${LOCALBASE}/include" \
			--with-id3lib-libs="${LOCALBASE}/lib"
LIB_DEPENDS+=		libid3.so:${PORTSDIR}/audio/id3lib
.else
CONFIGURE_ARGS+=	--disable-id3lib
.endif

.if ${PORT_OPTIONS:MTAGLIB}
CONFIGURE_ARGS+=	--enable-taglib \
			--with-taglib-cfg="${LOCALBASE}/bin/taglib-config"
LIB_DEPENDS+=		libtag.so:${PORTSDIR}/audio/taglib
.else
CONFIGURE_ARGS+=	--disable-taglib
.endif

.if ${PORT_OPTIONS:MDEBUG}
CONFIGURE_ARGS+=	--enable-tombdebug
.else
CONFIGURE_ARGS+=	--disable-tombdebug
.endif

post-install:
	${MKDIR} ${STAGEDIR}${PREFIX}/etc/mediatomb
	${MKDIR} ${STAGEDIR}/var/log/mediatomb
	${MKDIR} ${STAGEDIR}/var/db/mediatomb
	@${INSTALL} ${COPY} ${WRKDIR}/config.xml.dist ${STAGEDIR}${PREFIX}/etc/mediatomb/config.xml.dist

.include <bsd.port.post.mk>