several changes to mpd Makefile
[openwrt/svn-archive/archive.git] / sound / mpd / Makefile
index 592179cde040f05fdaa6d9200b28bd859a5fea06..32307c2a777ac9755bddd213782ae2c46095da52 100644 (file)
-# 
-# Copyright (C) 2007 OpenWrt.org
+#
+# Copyright (C) 2007-2010 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
-# $Id$
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mpd
-PKG_VERSION:=0.13.0
-PKG_RELEASE:=1
+PKG_VERSION:=0.15.8
+PKG_RELEASE:=2
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.musicpd.org/uploads/files/
-PKG_MD5SUM:=0b33bdb9d706439949344073e90f812a
-PKG_CAT:=zcat
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/musicpd
+PKG_MD5SUM:=824e1ce46c0f468865d9e5e403cdaf5d
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
 define Package/mpd
   SECTION:=sound
   CATEGORY:=Sound
-  DEPENDS:=+libflac +libid3tag +libmad +libvorbisidec +libpthread +alsa-lib
+  # libvorbis and therewith libogg are needed for shout support
+  DEPENDS:=+libflac +BUILD_PATENTED:libfaad2 +BUILD_PATENTED:libmad +libvorbisidec +libpthread +glib2 +libmms +libcurl +libshout +alsa-lib +libvorbis
   TITLE:=Music Player Daemon
-  DESCRIPTION:=\
-       MPD is a music player supporting flac, mp3 and ogg files.\\\
-       It is typically controlled over a network using one of it's many \\\
-       clients including mpc(console), gmpc(gnome), phpmp(php) etc.
   URL:=http://www.musicpd.org/
 endef
 
+define Package/mpd/description
+       MPD is a music player supporting flac, mp3 and ogg files.
+       It is typically controlled over a network using one of it's many
+       clients including mpc(console), gmpc(gnome), phpmp(php) etc.
+endef
+
 define Package/mpd/conffiles
 /etc/mpd.conf
 endef
 
-ifndef CONFIG_PACKAGE_kmod-soundcore
-       EXTRA_CONFIG_PARAM:=--disable-alsa
-endif
-
-define Build/Configure
-       $(call Build/Configure/Default, \
-               $(EXTRA_CONFIG_PARAM) \
-               --disable-shout \
-               --disable-mod \
-               --disable-audiofile \
-               --disable-iconv \
-               --disable-mpc \
-               --disable-aac \
-               --disable-oggvorbis \
-               --disable-oggflac \
-               --with-id3tag-includes="$(STAGING_DIR)/usr/include" \
-               --with-id3tag-libraries="$(STAGING_DIR)/usr/lib" \
-               --with-libFLAC-includes="$(STAGING_DIR)/usr/include" \
-               --with-libFLAC-libraries="$(STAGING_DIR)/usr/lib" \
-               --with-mad-includes="$(STAGING_DIR)/usr/include" \
-               --with-mad-libraries="$(STAGING_DIR)/usr/lib" \
-       )
-endef
+TARGET_CFLAGS += \
+       -I$(STAGING_DIR)/usr/lib/libintl/include/ \
+       -I$(STAGING_DIR)/usr/lib/libiconv/include/
 
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               DESTDIR="$(PKG_INSTALL_DIR)" \
-               all install
-endef
+TARGET_LDFLAGS += \
+       -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
+       -L$(STAGING_DIR)/usr/lib/libintl/lib/ \
+       -L$(STAGING_DIR)/usr/lib/libiconv/lib/
+
+# oggflac is not compatible with tremor
+CONFIGURE_ARGS+= \
+       --$(if $(CONFIG_BUILD_PATENTED),enable-mad,disable-mad) \
+       --enable-alsa \
+       --enable-audiofile \
+       --disable-mpc \
+       --$(if $(CONFIG_BUILD_PATENTED),enable-aac,disable-aac) \
+       --disable-lsr \
+       --disable-ao \
+       --disable-mvp \
+       --disable-lame-encoder \
+       --disable-ffmpeg \
+       --enable-flac \
+       --enable-vorbis \
+       --disable-oggflac \
+       --disable-sqlite \
+       --enable-shout \
+       --enable-id3 \
+       --enable-lastfm \
+       --enable-mms \
+       --enable-curl \
+       --disable-oss \
+       --enable-aac \
+       --with-zeroconf=no \
+       --disable-libOggFLACtest \
+       --disable-test \
+       --with-tremor=yes \
+       --with-faad="$(STAGING_DIR)/usr" \
+
+# use gcc instead of g++ to avoid unnecessary linking against libstdc++
+TARGET_CXX=$(TARGET_CC)
+
+TARGET_CFLAGS+=-std=gnu99
+
+
+CONFIGURE_VARS += \
+       FLAC_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/FLAC" \
+       FLAC_LIBS="$(TARGET_LDFLAGS) -lFLAC" \
+       $(if $(CONFIG_BUILD_PATENTED),MAD_CFLAGS="$(TARGET_CFLAGS)") \
+       $(if $(CONFIG_BUILD_PATENTED),MAD_LIBS="$(TARGET_LDFLAGS) -lmad") \
 
 define Package/mpd/install
        $(INSTALL_DIR) $(1)/etc
        $(CP) $(PKG_BUILD_DIR)/doc/mpdconf.example $(1)/etc/mpd.conf
        $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/mpd $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mpd $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/mpd.init $(1)/etc/init.d/mpd
 endef
 
 $(eval $(call BuildPackage,mpd))