summaryrefslogtreecommitdiff
path: root/audio/mt-daapd/Makefile
blob: 77f1ffba19498cdd468dc9baeb2b05905875038a (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
# $NetBSD: Makefile,v 1.10 2010/02/01 01:17:59 joerg Exp $

DISTNAME=	mt-daapd-0.2.4.2
PKGREVISION=	1
CATEGORIES=	audio
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=mt-daapd/}

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://www.mt-daapd.org/
COMMENT=	Server for DAAP (iTunes)

PKG_DESTDIR_SUPPORT=	user-destdir

USE_LANGUAGES=	c
USE_TOOLS+=	gmake

GNU_CONFIGURE=	yes

.include "../../mk/bsd.prefs.mk"

RCD_SCRIPTS=	mtdaapd
EGDIR=		${PREFIX}/share/examples/${PKGBASE}
MTDAAPD_USER?=	mtdaapd
MTDAAPD_GROUP?=	mtdaapd
PKG_USERS=	${MTDAAPD_USER}:${MTDAAPD_GROUP}
PKG_GROUPS=	${MTDAAPD_GROUP}
BUILD_DEFS+=	VARBASE

PKG_USERS_VARS+=	MTDAAPD_USER
PKG_GROUPS_VARS+=	MTDAAPD_GROUP

CONF_FILES_PERMS=	${EGDIR}/mt-daapd.conf ${PKG_SYSCONFDIR}/mt-daapd.conf \
			${MTDAAPD_USER} ${MTDAAPD_GROUP} 0660

OWN_DIRS_PERMS=		${VARBASE}/cache/mt-daapd \
			${MTDAAPD_USER} ${MTDAAPD_GROUP} 0750

.include "options.mk"

SUBST_CLASSES+=		conf
SUBST_STAGE.conf=	post-patch
SUBST_FILES.conf=	contrib/mt-daapd.conf
SUBST_SED.conf=		-e "s,@PREFIX@,${PREFIX},"
SUBST_SED.conf+=	-e "s,@VARBASE@,${VARBASE},g"
SUBST_SED.conf+=	-e "s,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},"
SUBST_SED.conf+=	-e "s,@MTDAAPD_USER@,${MTDAAPD_USER},"

SUBST_CLASSES+=		paths
SUBST_MESSAGE.paths=	Fixing hardcoded paths.
SUBST_STAGE.paths=	post-patch
SUBST_FILES.paths=	src/main.c
SUBST_SED.paths=	-e "s,/etc,${PKG_SYSCONFDIR},"
SUBST_SED.paths+=	-e "s,/var,${VARBASE},"

INSTALLATION_DIRS+=	${EGDIR}

post-install:
	${INSTALL_DATA} ${WRKSRC}/contrib/mt-daapd.conf ${DESTDIR}${EGDIR}
	${INSTALL_DATA} ${WRKSRC}/contrib/mt-daapd.playlist ${DESTDIR}${EGDIR}

.include "../../audio/libid3tag/buildlink3.mk"
.include "../../databases/gdbm/buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"