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