include $(TOPDIR)/rules.mk

PKG_NAME:=swftools
PKG_VERSION:=0.9.1
PKG_RELEASE:=1


PKG_BUILD_DIR:=$(BUILD_DIR)/swftools-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://swftools.org/
PKG_MD5SUM:=72dc4a7bf5cdf98c28f9cf9b1d8f5d7a

include $(INCLUDE_DIR)/package.mk
define Package/swftools
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE:=SWFTools
  URL:=http://swftools.org/
  DEPENDS:=+libfreetype +libjpeg
endef
define Package/swftools/description
  SWFTools is a collection of utilities for working with Adobe Flash files (SWF files).
endef

CONFIGURE_ARGS += \
	--prefix=/opt

define Package/swftools/install
	$(INSTALL_DIR) $(1)/opt/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/as3compile $(1)/opt/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/avi2swf $(1)/opt/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/font2swf $(1)/opt/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/gif2swf $(1)/opt/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/jpeg2swf $(1)/opt/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/pdf2swf $(1)/opt/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/png2swf $(1)/opt/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/swfbbox $(1)/opt/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/swfc $(1)/opt/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/swfcombine $(1)/opt/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/swfdump $(1)/opt/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/swfextract $(1)/opt/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/swfrender $(1)/opt/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/swfstrings $(1)/opt/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/opt/bin/wav2swf $(1)/opt/bin/
endef

$(eval $(call BuildPackage,swftools))
