#
# Copyright (C) 2007-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=xmlstarlet
PKG_VERSION:=1.6.1
PKG_RELEASE:=2

PKG_SOURCE_VERSION:=1.6.1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_URL:=http://sourceforge.net/projects/xmlstar/files/$(PKG_NAME)/$(PKG_SOURCE_VERSION)

PKG_HASH:=15d838c4f3375332fd95554619179b69e4ec91418a3a5296e7c631b7ed19e7ca

PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING

PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/package.mk

define Package/xmlstarlet
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE:=An xml editor
  URL:=http://xmlstar.sourceforge.net/
  DEPENDS:=+libxml2 +libxslt +libexslt
endef

define Package/xmlstarlet/description
  XMLStarlet is open source free software under MIT license which allows free use and distribution for both commercial and non-commercial projects.
endef

CONFIGURE_ARGS += \
	--with-libxml-include-prefix=$(STAGING_DIR)/usr/include/libxml2/ \
	ac_cv_header_regex_h=no \
	LIBXML_LIBDIR=. \
	LIBXSLT_LIBDIR=.

define Package/xmlstarlet/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(CP) $(PKG_INSTALL_DIR)/usr/bin/xml $(1)/usr/bin/xmlstarlet
endef

$(eval $(call BuildPackage,xmlstarlet))
