baa805972117069b75b7f1507bb75891e93e6d32
[packages.git] / sound / mpd / Makefile
1 #
2 # Copyright (C) 2007-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=mpd
11 PKG_VERSION:=0.16.8
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://www.musicpd.org/download/mpd/0.16/
16 PKG_MD5SUM:=b412a9d0b3457bea1bb87904a8f80c04
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
19 PKG_BUILD_PARALLEL:=1
20
21 PKG_CONFIG_DEPENDS:= \
22         CONFIG_IPV6 \
23
24 PKG_INSTALL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27 include $(INCLUDE_DIR)/nls.mk
28
29 define Package/mpd/Default
30   SECTION:=sound
31   CATEGORY:=Sound
32   TITLE:=Music Player Daemon
33   URL:=http://www.musicpd.org/
34   DEPENDS:= +glib2 +libcurl +libpthread \
35         +libflac +BUILD_PATENTED:libmad +libvorbisidec
36 endef
37
38 define Package/mpd/Default/description
39  Music Player Daemon (MPD) is a flexible, powerful, server-side 
40  application for playing music. It is typically controlled over a 
41  network using one of it's many clients including mpc (console), 
42  gmpc (gnome), phpmp (php), etc...
43 endef
44
45
46 define Package/mpd-full
47 $(call Package/mpd/Default)
48   TITLE+= (full)
49   DEPENDS+= \
50         +AUDIO_SUPPORT:alsa-lib \
51         +libaudiofile +BUILD_PATENTED:libfaad2 +libffmpeg +libid3tag \
52         +libmms +libogg +libshout +libsndfile +libvorbis
53   PROVIDES:=mpd
54   VARIANT:=full
55 endef
56
57 define Package/mpd-full/description
58 $(call Package/mpd/Default/description)
59  .
60  This package contains a full-blown Music Player Daemon.
61 endef
62
63 define Package/mpd-full/conffiles
64 /etc/avahi/services/mpd.service
65 /etc/mpd.conf
66 endef
67
68
69 define Package/mpd-mini
70 $(call Package/mpd/Default)
71   TITLE+= (mini)
72   PROVIDES:=mpd
73   VARIANT:=mini
74 endef
75
76 define Package/mpd-mini/description
77 $(call Package/mpd/Default/description)
78  .
79  This package contains a minimal Music Player Daemon, with support for 
80  only Flac, MP3 & OGG media types & only file: & http: protocols.
81 endef
82
83 define Package/mpd-mini/conffiles
84 /etc/mpd.conf
85 endef
86
87
88 CONFIGURE_ARGS += \
89         $(call autoconf_bool,CONFIG_IPV6,ipv6) \
90         --disable-debug \
91         --disable-documentation \
92         --disable-gprof \
93         --disable-test \
94         --disable-werror \
95         \
96         --disable-ao \
97         --disable-bzip2 \
98         --disable-cue \
99         --disable-ffado \
100         --disable-fluidsynth \
101         --disable-gme \
102         --disable-inotify \
103         --disable-iso9660 \
104         --disable-jack \
105         --disable-lame-encoder \
106         --disable-libwrap \
107         --disable-lsr \
108         --disable-mikmod \
109         --disable-modplug \
110         --disable-mpc \
111         --disable-mpg123 \
112         --disable-mvp \
113         --disable-openal \
114         --disable-pulse \
115         --disable-sidplay \
116         --disable-solaris-output \
117         --disable-sqlite \
118         --disable-twolame-encoder \
119         --disable-wave-encoder \
120         --disable-wavpack \
121         --disable-wildmidi \
122         --disable-zzip \
123         --with-zeroconf=no \
124         \
125         --enable-curl \
126         --enable-flac \
127         --enable-httpd-output \
128         $(call autoconf_bool,CONFIG_BUILD_PATENTED,mad) \
129         $(call autoconf_bool,CONFIG_AUDIO_SUPPORT,oss) \
130         --enable-tcp \
131         --enable-un \
132
133 CONFIGURE_VARS += \
134         FLAC_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/FLAC" \
135         FLAC_LIBS="$(TARGET_LDFLAGS) -lFLAC" \
136         $(if $(CONFIG_BUILD_PATENTED),MAD_CFLAGS="$(TARGET_CFLAGS)") \
137         $(if $(CONFIG_BUILD_PATENTED),MAD_LIBS="$(TARGET_LDFLAGS) -lmad") \
138
139 TARGET_CFLAGS += -std=gnu99
140 TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
141
142 # use gcc instead of g++ to avoid unnecessary linking against libstdc++
143 TARGET_CXX:=$(TARGET_CC)
144
145 ifeq ($(BUILD_VARIANT),full)
146
147   CONFIGURE_ARGS += \
148         $(call autoconf_bool,CONFIG_BUILD_PATENTED,aac) \
149         $(call autoconf_bool,CONFIG_AUDIO_SUPPORT,alsa) \
150         --enable-audiofile \
151         --enable-fifo \
152         --enable-ffmpeg \
153         --enable-id3 \
154         --enable-lastfm \
155         --enable-mms \
156         --enable-oggflac \
157         --enable-pipe-output \
158         --enable-recorder-output \
159         --enable-shout \
160         --enable-sndfile \
161         --enable-vorbis \
162         --enable-vorbis-encoder \
163         --with-faad="$(STAGING_DIR)/usr" \
164         --with-tremor=no \
165
166 endif
167
168 ifeq ($(BUILD_VARIANT),mini)
169
170   # oggflac is not compatible with tremor
171   CONFIGURE_ARGS += \
172         --disable-aac \
173         --disable-alsa \
174         --disable-audiofile \
175         --disable-fifo \
176         --disable-ffmpeg \
177         --disable-id3 \
178         --disable-lastfm \
179         --disable-mms \
180         --disable-oggflac \
181         --disable-pipe-output \
182         --disable-recorder-output \
183         --disable-shout \
184         --disable-sndfile \
185         --disable-vorbis \
186         --disable-vorbis-encoder \
187         --with-tremor=yes \
188
189 endif
190
191 define Package/mpd/install
192         $(INSTALL_DIR) $(1)/usr/bin
193         $(CP) $(PKG_INSTALL_DIR)/usr/bin/mpd $(1)/usr/bin/
194         $(INSTALL_DIR) $(1)/etc
195         $(CP) $(PKG_BUILD_DIR)/doc/mpdconf.example $(1)/etc/mpd.conf
196         $(INSTALL_DIR) $(1)/etc/init.d
197         $(INSTALL_BIN) ./files/mpd.init $(1)/etc/init.d/mpd
198 endef
199
200 define Package/mpd-full/install
201 $(call Package/mpd/install,$1)
202         $(INSTALL_DIR) $(1)/etc/avahi/services
203         $(INSTALL_DATA) ./files/mpd.service $(1)/etc/avahi/services/
204 endef
205
206 define Package/mpd-mini/install
207 $(call Package/mpd/install,$1)
208 endef
209
210 $(eval $(call BuildPackage,mpd-full))
211 $(eval $(call BuildPackage,mpd-mini))