#
# Copyright (C) 2010-2014 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:=libquickmail
PKG_VERSION:=0.1.25
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@SF/libquickmail
PKG_MD5SUM:=9cdaa47ab041b214795d2b4dc2f7e22b

PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=brechtsanders

include $(BUILD_DIR)/package.mk

define Package/libquickmail
	SECTION:=libs
	CATEGORY:=Libraries
	TITLE:=Quick SMTP Libraries
	DEPENDS:= +libcurl
endef

define Package/libquickmail/description
  C library for sending e-mail (with attachments) from C/C++
endef

TARGET_CFLAGS += $(FPIC)

define Build/Compile
	$(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_INSTALL_FLAGS) \
	  CC="$(TARGET_CC)" \
	  CFLAGS="$(TARGET_CFLAGS)" \
	  PREFIX="$(CONFIGURE_PREFIX)" \
	  install
endef

define Build/InstallDev
	$(CP) $(PKG_INSTALL_DIR)/* $(1)/
endef

define Package/libquickmail/install
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libquickmail.so* $(1)/usr/lib/
endef

$(eval $(call BuildPackage,$(PKG_NAME)))