#
# Copyright (C) 2007-2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id: Makefile 11950 2008-07-26 22:32:55Z nico $

include $(TOPDIR)/rules.mk

PKG_NAME:=xmlrpc-c
PKG_VERSION:=1.06.32
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=http://jaist.dl.sourceforge.net/sourceforge/xmlrpc-c/
PKG_MD5SUM:=1a5a0771a22e75819d90e7fab38ef377

PKG_FIXUP = libtool

include $(INCLUDE_DIR)/package.mk

define Package/xmlrpc-c
  SECTION:=net
  CATEGORY:=Network
  TITLE:=xmlrpc client
  URL:=http://xmlrpc-c.sourceforge.net/
  DEPENDS:=+curl  
endef

define Package/xmlrpc-c/description
 xmlrpc-c is a quick-and-easy way to make procedure calls over the Internet.
 It converts the procedure call into XML document, sends it to a remote
 server using HTTP, and gets back the response as XML.
endef

CONFIGURE_ARGS+= \
	--disable-cplusplus\
	#--disable-static \
	#--disable-debug \
	#--with-xmlrpc-c \

CONFIGURE_VARS += \
	LIBS="-lm" \

define Build/Compile
	$(MAKE) -C $(PKG_BUILD_DIR) \
		DESTDIR="$(PKG_INSTALL_DIR)" \
		all install
endef

define Build/InstallDev
	$(INSTALL_DIR) $(1)/usr/include
	$(CP) $(PKG_INSTALL_DIR)/usr/include/xmlrpc-c $(1)/usr/include/
	$(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
	$(INSTALL_DIR) $(1)/usr/bin
	$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
	$(INSTALL_DIR) $(2)/bin
	$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(2)/bin/
endef

define Package/xmlrpc-c/install
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so $(1)/usr/lib/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
	$(INSTALL_DIR) $(1)/usr/bin
	$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
endef

$(eval $(call BuildPackage,xmlrpc-c))
