8c7aca5ef1c80d503eb9cb27c280d8668b835e8e
[packages.git] / sound / mpd / Makefile
1 #
2 # Copyright (C) 2007-2010 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.15.8
12 PKG_RELEASE:=4
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@SF/musicpd
16 PKG_MD5SUM:=824e1ce46c0f468865d9e5e403cdaf5d
17
18 PKG_INSTALL:=1
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/mpd
23   SECTION:=sound
24   CATEGORY:=Sound
25   TITLE:=Music Player Daemon
26   URL:=http://www.musicpd.org/
27 # libvorbis and therewith libogg are needed for shout support
28   DEPENDS:= \
29         +AUDIO_SUPPORT:alsa-lib \
30         +BUILD_PATENTED:libfaad2 +BUILD_PATENTED:libmad \
31         +glib2 +libcurl +libflac +libmms +libpthread +libshout \
32         +libvorbis +libvorbisidec 
33 endef
34
35 define Package/mpd/description
36  MPD is a music player supporting flac, mp3 and ogg files. It is
37  typically controlled over a network using one of it's many clients
38  including mpc(console), gmpc(gnome), phpmp(php), etc...
39 endef
40
41 define Package/mpd/conffiles
42 /etc/avahi/services/mpd.service
43 /etc/mpd.conf
44 endef
45
46 # oggflac is not compatible with tremor
47 CONFIGURE_ARGS += \
48         $(call autoconf_bool,CONFIG_BUILD_PATENTED,mad) \
49         $(call autoconf_bool,CONFIG_AUDIO_SUPPORT,alsa) \
50         --enable-audiofile \
51         --disable-mpc \
52         $(call autoconf_bool,CONFIG_BUILD_PATENTED,aac) \
53         --disable-lsr \
54         --disable-ao \
55         --disable-mvp \
56         --disable-lame-encoder \
57         --disable-ffmpeg \
58         --enable-flac \
59         --enable-vorbis \
60         --disable-oggflac \
61         --disable-cue \
62         --disable-jack \
63         --disable-modplug \
64         --disable-pulse \
65         --disable-sidplay \
66         --disable-sqlite \
67         --enable-shout \
68         --enable-id3 \
69         --enable-lastfm \
70         --enable-mms \
71         --enable-curl \
72         --disable-oss \
73         --enable-aac \
74         --with-zeroconf=no \
75         --disable-libOggFLACtest \
76         --disable-test \
77         --with-tremor=yes \
78         --with-faad="$(STAGING_DIR)/usr" \
79
80 CONFIGURE_VARS += \
81         FLAC_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/FLAC" \
82         FLAC_LIBS="$(TARGET_LDFLAGS) -lFLAC" \
83         $(if $(CONFIG_BUILD_PATENTED),MAD_CFLAGS="$(TARGET_CFLAGS)") \
84         $(if $(CONFIG_BUILD_PATENTED),MAD_LIBS="$(TARGET_LDFLAGS) -lmad") \
85
86 TARGET_CFLAGS += \
87         -std=gnu99 \
88         -I$(STAGING_DIR)/usr/lib/libintl/include/ \
89         -I$(STAGING_DIR)/usr/lib/libiconv/include/ \
90
91 TARGET_LDFLAGS += \
92         -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
93         -L$(STAGING_DIR)/usr/lib/libintl/lib/ \
94         -L$(STAGING_DIR)/usr/lib/libiconv/lib/ \
95
96 # use gcc instead of g++ to avoid unnecessary linking against libstdc++
97 TARGET_CXX:=$(TARGET_CC)
98
99 define Package/mpd/install
100         $(INSTALL_DIR) $(1)/etc
101         $(CP) $(PKG_BUILD_DIR)/doc/mpdconf.example $(1)/etc/mpd.conf
102         $(INSTALL_DIR) $(1)/usr/bin
103         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mpd $(1)/usr/bin/
104         $(INSTALL_DIR) $(1)/etc/init.d
105         $(INSTALL_BIN) ./files/mpd.init $(1)/etc/init.d/mpd
106         $(INSTALL_DIR) $(1)/etc/avahi/services
107         $(INSTALL_DATA) ./files/mpd.service $(1)/etc/avahi/services/
108 endef
109
110 $(eval $(call BuildPackage,mpd))