[package] get the enable/disable ipv6 configure option from the build system, do...
[packages.git] / sound / mpd / Makefile
1
2 # Copyright (C) 2007-2009 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.1
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@SF/musicpd
16 PKG_MD5SUM:=eec9f5642d4a9c59a0df0a458def3505
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/mpd
21   SECTION:=sound
22   CATEGORY:=Sound
23   DEPENDS:=+libflac +libid3tag +libmad +libvorbisidec +libpthread +glib2 +libmms +libcurl
24   TITLE:=Music Player Daemon
25   URL:=http://www.musicpd.org/
26 endef
27
28 define Package/mpd/description
29         MPD is a music player supporting flac, mp3 and ogg files.
30         It is typically controlled over a network using one of it's many
31         clients including mpc(console), gmpc(gnome), phpmp(php) etc.
32 endef
33
34 define Package/mpd/conffiles
35 /etc/mpd.conf
36 endef
37
38 ifndef CONFIG_PACKAGE_kmod-sound-core
39         EXTRA_CONFIG_PARAM:=--disable-alsa
40 endif
41
42 CONFIGURE_VARS += \
43         CURL_LIBS="-L$(STAGING_DIR)/usr/lib -lssl -lcrypto -lcurl" \
44         CURL_CFLAGS="-I$(STAGING_DIR)/usr/include" \
45         ID3TAG_LIBS="$(TARGET_LDFLAGS) -lz -lid3tag" \
46         ID3TAG_CFLAGS="$(TARGET_CPPFLAGS)" \
47         FLAC_LIBS="$(TARGET_LDFLAGS) -lFLAC" \
48         FLAC_CFLAGS="-I$(STAGING_DIR)/usr/include/FLAC" \
49         MAD_LIBS="$(TARGET_LDFLAGS) -lmad" \
50         MAD_CFLAGS="$(TARGET_CPPFLAGS)" \
51         OGGVORBIS_LIBS="$(TARGET_LDLFAGS) -lvorbisidec" \
52         OGGVORBIS_CFLAGS="$(TARGET_CPPFLAGS)" \
53         GLIB_CFLAGS="-I$(STAGING_DIR)/usr/include/glib-2.0 -I$(STAGING_DIR)/usr/lib/glib-2.0/include" \
54         GLIB_LIBS="$(TARGET_LDLFAGS) -L$(STAGING_DIR)/usr/lib/libintl/lib -lintl -L$(STAGING_DIR)/usr/lib/libiconv/lib -liconv -lglib-2.0 -lgthread-2.0 -pthread"
55
56 define Build/Configure
57         $(call Build/Configure/Default, \
58                 $(EXTRA_CONFIG_PARAM) \
59                 --disable-audiofile \
60                 --disable-mpc \
61                 --disable-aac \
62                 --disable-lsr \
63                 --disable-ao \
64                 --disable-mvp \
65                 --disable-lametest \
66                 --disable-lame-encoder \
67                 --enable-flac \
68                 --enable-lastfm \
69                 --enable-mms \
70                 --with-tremor="$(STAGING_DIR)/usr/lib" \
71         )
72 endef
73
74 define Build/Compile
75         $(MAKE) -C $(PKG_BUILD_DIR) \
76                 DESTDIR="$(PKG_INSTALL_DIR)" \
77                 all install
78 endef
79
80 define Package/mpd/install
81         $(INSTALL_DIR) $(1)/etc
82         $(CP) $(PKG_BUILD_DIR)/doc/mpdconf.example $(1)/etc/mpd.conf
83         $(INSTALL_DIR) $(1)/usr/bin
84         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mpd $(1)/usr/bin/
85         $(INSTALL_DIR) $(1)/etc/init.d
86         $(INSTALL_BIN) ./files/mpd.init $(1)/etc/init.d/mpd
87 endef
88
89 $(eval $(call BuildPackage,mpd))