mpd: uClibc-0.9.31 fix
[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:=5
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         +libaudiofile \
31         +BUILD_PATENTED:libfaad2 +BUILD_PATENTED:libmad \
32         +glib2 +libcurl +libflac +libmms +libpthread +libshout \
33         +libvorbis +libvorbisidec +libid3tag
34 endef
35
36 define Package/mpd/description
37  MPD is a music player supporting flac, mp3 and ogg files. It is
38  typically controlled over a network using one of it's many clients
39  including mpc(console), gmpc(gnome), phpmp(php), etc...
40 endef
41
42 define Package/mpd/conffiles
43 /etc/avahi/services/mpd.service
44 /etc/mpd.conf
45 endef
46
47 # oggflac is not compatible with tremor
48 CONFIGURE_ARGS += \
49         $(call autoconf_bool,CONFIG_BUILD_PATENTED,mad) \
50         $(call autoconf_bool,CONFIG_AUDIO_SUPPORT,alsa) \
51         --enable-audiofile \
52         --disable-mpc \
53         $(call autoconf_bool,CONFIG_BUILD_PATENTED,aac) \
54         --disable-lsr \
55         --disable-ao \
56         --disable-mvp \
57         --disable-lame-encoder \
58         --disable-ffmpeg \
59         --enable-flac \
60         --enable-vorbis \
61         --disable-oggflac \
62         --disable-cue \
63         --disable-jack \
64         --disable-modplug \
65         --disable-pulse \
66         --disable-sidplay \
67         --disable-sqlite \
68         --enable-shout \
69         --enable-id3 \
70         --enable-lastfm \
71         --enable-mms \
72         --enable-curl \
73         --disable-oss \
74         --enable-aac \
75         --with-zeroconf=no \
76         --disable-libOggFLACtest \
77         --disable-test \
78         --with-tremor=yes \
79         --with-faad="$(STAGING_DIR)/usr" \
80
81 CONFIGURE_VARS += \
82         FLAC_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/FLAC" \
83         FLAC_LIBS="$(TARGET_LDFLAGS) -lFLAC" \
84         $(if $(CONFIG_BUILD_PATENTED),MAD_CFLAGS="$(TARGET_CFLAGS)") \
85         $(if $(CONFIG_BUILD_PATENTED),MAD_LIBS="$(TARGET_LDFLAGS) -lmad") \
86
87 TARGET_CFLAGS += \
88         -std=gnu99 \
89         -I$(STAGING_DIR)/usr/lib/libintl/include/ \
90         -I$(STAGING_DIR)/usr/lib/libiconv/include/ \
91
92 TARGET_LDFLAGS += \
93         -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
94         -L$(STAGING_DIR)/usr/lib/libintl/lib/ \
95         -L$(STAGING_DIR)/usr/lib/libiconv/lib/ \
96
97 # use gcc instead of g++ to avoid unnecessary linking against libstdc++
98 TARGET_CXX:=$(TARGET_CC)
99
100 define Package/mpd/install
101         $(INSTALL_DIR) $(1)/etc
102         $(CP) $(PKG_BUILD_DIR)/doc/mpdconf.example $(1)/etc/mpd.conf
103         $(INSTALL_DIR) $(1)/usr/bin
104         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mpd $(1)/usr/bin/
105         $(INSTALL_DIR) $(1)/etc/init.d
106         $(INSTALL_BIN) ./files/mpd.init $(1)/etc/init.d/mpd
107         $(INSTALL_DIR) $(1)/etc/avahi/services
108         $(INSTALL_DATA) ./files/mpd.service $(1)/etc/avahi/services/
109 endef
110
111 $(eval $(call BuildPackage,mpd))