aboutsummaryrefslogtreecommitdiffstats
path: root/audio/mt-daapd/Makefile
blob: 2c284f5be7309546652e43e840f0f869b5b0b209 (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
# 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.0
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.2:${PORTSDIR}/audio/libid3tag

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

USE_AUTOHEADER_VER= 259
WANT_AUTOCONF_VER=  259

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>