port mpd to buildroot-ng
[openwrt/svn-archive/archive.git] / utils / mpd / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=mpd
12 PKG_VERSION:=0.12.0
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=http://users.tpg.com.au/davico/openwrt/
18 PKG_MD5SUM:=65e62cc813f2186dff0f96f164a853f8
19 PKG_CAT:=zcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/mpd
26 SECTION:=utils
27 CATEGORY:=Utilities
28 DEPENDS:=+libflac +libid3tag +libmad +libvorbisidec
29 TITLE:=Music Player Daemon
30 DESCRIPTION:=Music Player Daemon.\\\
31 MPD is a music player supporting flac, mp3 and ogg files.\\\
32 It is typically controlled over a network using one of it's many \\\
33 clients including mpc(console), gmpc(gnome), phpmp(php) etc.
34 URL:=http://www.musicpd.org/
35 endef
36
37 define Package/mpd/conffiles
38 /etc/mpd.conf
39 endef
40
41 PKG_CONFIGURE_OPTIONS := \
42 --disable-alsa \
43 --disable-shout \
44 --disable-mod \
45 --disable-audiofile \
46 --disable-iconv \
47 --disable-mpc \
48 --disable-aac \
49 --with-id3tag-includes="$(STAGING_DIR)/usr/include" \
50 --with-id3tag-libraries="$(STAGING_DIR)/usr/lib" \
51 --with-libFLAC-includes="$(STAGING_DIR)/usr/include" \
52 --with-libFLAC-libraries="$(STAGING_DIR)/usr/lib" \
53 --with-mad-includes="$(STAGING_DIR)/usr/include" \
54 --with-mad-libraries="$(STAGING_DIR)/usr/lib" \
55 --with-tremor \
56 --with-tremor-includes="$(STAGING_DIR)/usr/include" \
57 --with-tremor-libraries="$(STAGING_DIR)/usr/lib" \
58
59 define Build/Configure
60 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
61 $(TARGET_CONFIGURE_OPTS) \
62 CFLAGS="$(strip $(TARGET_CFLAGS))" \
63 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
64 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
65 ./configure \
66 --target=$(GNU_TARGET_NAME) \
67 --host=$(GNU_TARGET_NAME) \
68 --build=$(GNU_HOST_NAME) \
69 --program-prefix="" \
70 --program-suffix="" \
71 --prefix=/usr \
72 --exec-prefix=/usr \
73 --bindir=/usr/bin \
74 --datadir=/usr/share \
75 --includedir=/usr/include \
76 --infodir=/usr/share/info \
77 --libdir=/usr/lib \
78 --libexecdir=/usr/lib \
79 --localstatedir=/var \
80 --mandir=/usr/share/man \
81 --sbindir=/usr/sbin \
82 --sysconfdir=/etc \
83 $(DISABLE_LARGEFILE) \
84 $(DISABLE_NLS) \
85 $(PKG_CONFIGURE_OPTIONS) \
86 );
87 endef
88
89 define Build/Compile
90 rm -rf $(PKG_INSTALL_DIR)
91 mkdir -p $(PKG_INSTALL_DIR)
92 $(MAKE) -C $(PKG_BUILD_DIR) \
93 $(TARGET_CONFIGURE_OPTS) \
94 DESTDIR="$(PKG_INSTALL_DIR)" \
95 all install
96 endef
97
98 define Package/mpd/install
99 install -d -m0755 $(1)/etc
100 $(CP) $(PKG_BUILD_DIR)/doc/mpdconf.example $(1)/etc/mpd.conf
101 install -d -m0755 $(1)/usr/bin
102 $(CP) $(PKG_INSTALL_DIR)/usr/bin/mpd $(1)/usr/bin/
103 endef
104
105 $(eval $(call BuildPackage,mpd))