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