aboutsummaryrefslogtreecommitdiffstats
path: root/audio/musicpd/Makefile
blob: 6e56ad3fe1402d34cb4fe76225a3a55355687111 (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
# New ports collection makefile for:    musicpd
# Date created:     Tue Oct 02 2003
# Whom:         Mark Reidel <ports@mark.reidel.info>
#
# $FreeBSD$
#

PORTNAME=   musicpd
PORTVERSION=    0.11.5
PORTREVISION=   1
CATEGORIES= audio ipv6
MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
DISTNAME=   mpd-${PORTVERSION}

MAINTAINER= ports@mark.reidel.info
COMMENT=    A remote-controllable music-daemon

LIB_DEPENDS+=   ao.3:${PORTSDIR}/audio/libao \
        mad.2:${PORTSDIR}/audio/mad

GNU_CONFIGURE=  yes
PKGMESSAGE= ${WRKDIR}/pkg-message

OPTIONS=    FLAC "Support for FLAC Audio" on \
        VORBIS "Support for OGG Vorbis Audio" on \
        WAV "Support for WAV Audio" on \
        AAC "Support for MP4/AAC Audio" off \
        MOD "Support for MOD Audio" off \
        ICONV "Support for international characters" on \
            ID3TAG "Support for id3v1 tag encoding" off \
        IPV6 "Support for IPV6" on

.include <bsd.port.pre.mk>

.if ${OSVERSION} >= 500038
RC_SUBR?=   ${DESTDIR}/etc/rc.subr
.else
USE_RC_SUBR=    yes
.endif

.ifdef(WITHOUT_FLAC)
CONFIGURE_ARGS+=--disable-flac
.else
LIB_DEPENDS+=   FLAC.7:${PORTSDIR}/audio/flac
.endif

.ifdef(WITHOUT_VORBIS)
CONFIGURE_ARGS+=--disable-ogg
.else
LIB_DEPENDS+=   vorbis.3:${PORTSDIR}/audio/libvorbis
.endif

.ifdef(WITHOUT_WAV)
CONFIGURE_ARGS+=--disable-audiofile
.else
LIB_DEPENDS+=   ao.3:${PORTSDIR}/audio/libaudiofile
.endif

.ifdef(WITH_AAC)
LIB_DEPENDS+=   faad.0:${PORTSDIR}/audio/faad
.else
CONFIGURE_ARGS+=--disable-aac
.endif

.ifdef(WITH_MOD)
LIB_DEPENDS+=   mikmod.2:${PORTSDIR}/audio/libmikmod
.else
CONFIGURE_ARGS+=--disable-mod
.endif

.ifdef(WITHOUT_ICONV)
CONFIGURE_ARGS+=--disable-iconv
.else
USE_ICONV=  yes
.endif

.ifdef(WITH_ID3TAG)
CONFIGURE_ARGS+=--enable-mpd-id3tag
.endif

.ifdef(WITHOUT_IPV6)
CONFIGURE_ARGS+=--disable-ipv6
.endif

CONFIGURE_ENV=  CPPFLAGS="-I${LOCALBASE}/include" \
        LDFLAGS="-L${LOCALBASE}/lib"

CFLAGS+=    -I${PREFIX}/include

MAN1=       mpd.1

DOCS=       README \
        UPGRADING \
        doc/COMMANDS

SED_SCRIPT+=    -e 's,%%PREFIX%%,${PREFIX},g' \
        -e 's,%%EXAMPLESDIR%%,${EXAMPLESDIR},g' \
        -e 's,%%RC_SUBR%%,${RC_SUBR},g'

post-build:
    @${SED} ${SED_SCRIPT} ${FILESDIR}/musicpd.sh >${WRKDIR}/musicpd.sh
    @${SED} ${SED_SCRIPT} ${MASTERDIR}/pkg-message >${PKGMESSAGE}

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/src/mpd ${PREFIX}/bin/
    ${MKDIR} ${EXAMPLESDIR}
    ${INSTALL_DATA} ${FILESDIR}/mpd.conf.sample ${EXAMPLESDIR}/mpd.conf
    ${INSTALL_SCRIPT} ${WRKDIR}/musicpd.sh ${PREFIX}/etc/rc.d/
    ${INSTALL_MAN} ${WRKSRC}/doc/mpd.1 ${MAN1PREFIX}/man/man1/
.if !defined(NOPORTDOCS)
    ${MKDIR} ${DOCSDIR}
    @cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}/
.endif
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>