summaryrefslogtreecommitdiff
path: root/audio/mt-daapd/Makefile
blob: 9c44b2049de981dd727d0e1d668f76b1e9791158 (plain)
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
# New ports collection makefile for:	mt-daapd
# Date created:				10 March 2004
# Whom:					Meno Abels <meno.abels@adviser.com>
#
# $FreeBSD$
#

PORTNAME=	mt-daapd
PORTVERSION=	0.2.3
PORTREVISION=	1
CATEGORIES=	audio
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR=	mt-daapd

MAINTAINER=	Meno.Abels@Adviser.com
COMMENT=	Multithread daapd yet another Server for Apple iTunes

BUILD_DEPENDS=	${LOCALBASE}/lib/libgdbm.a:${PORTSDIR}/databases/gdbm
LIB_DEPENDS=	id3tag.0:${PORTSDIR}/audio/libid3tag

GNU_CONFIGURE=	yes
CONFIGURE_ENV=	AUTOCONF=autoconf259 AUTOHEADER=autoheader259 CC="${CC} -pthread"
CONFIGURE_ARGS=	--with-id3tag=${PREFIX}

USE_AUTOTOOLS=	autoheader:259 autoconf:259:env

DAAPD_USER?=	daapd
DAAPD_GROUP?=	daapd

PKGINSTALL=	${WRKDIR}/pkg-install
PKGDEINSTALL=	${WRKDIR}/pkg-deinstall

FILES_SUB=	USER=${DAAPD_USER} GROUP=${DAAPD_GROUP} \
		PREFIX=${PREFIX} LOGDIR=${LOGDIR} DOCSDIR=${DOCSDIR} \
		LOCALBASE=${LOCALBASE}
pre-install:
	@${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
		${PKGDIR}/pkg-install > ${PKGINSTALL}
	@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL

post-install:
.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
.for i in README AUTHORS COPYING CREDITS \
	ChangeLog INSTALL NEWS TODO
	${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
.endfor
.endif
	${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
		${FILESDIR}/mt-daapd.sh > ${WRKDIR}/mt-daapd.sh
	${INSTALL_SCRIPT} ${WRKDIR}/mt-daapd.sh ${PREFIX}/etc/rc.d/mt-daapd.sh
	${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
		${FILESDIR}/mt-daapd.conf > ${WRKDIR}/mt-daapd.conf
	${INSTALL_DATA} ${WRKDIR}/mt-daapd.conf ${PREFIX}/etc/mt-daapd.conf.sample
	${MKDIR} ${PREFIX}/var/mt-daapd/db
	${MKDIR} ${PREFIX}/share/mt-daapd/mp3
	${CHMOD} 0755 ${PREFIX}/var/mt-daapd/db
	${CHMOD} 0755 ${PREFIX}/share/mt-daapd/mp3
	${CHOWN} ${DAAPD_USER}:${DAAPD_GROUP} ${PREFIX}/var/mt-daapd/db
	${CHOWN} ${DAAPD_USER}:${DAAPD_GROUP} ${PREFIX}/share/mt-daapd/mp3
	${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
		${PKGDIR}/pkg-deinstall > ${PKGDEINSTALL}
	${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL

.include <bsd.port.mk>