#
# Copyright (C) 2011 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:=protobuf2json-c
PKG_VERSION:=1.2.1


PKG_INSTALL:=1
PKG_FIXUP:=autoreconf

PKG_LICENSE:=BSD-2c

PKG_MAINTAINER:=Jacob Siverskog <jacob@teenageengineering.com>

include $(INCLUDE_DIR)/package.mk

define Package/protobuf2json-c
  SECTION:=DYIOT
  CATEGORY:=DYIOT Software
  TITLE:=gw lora utilities
  URL:=http://code.google.com/p/protobuf-c/
endef

define Package/protobuf2json-c/description
  Runtime library to use Google Protocol Buffers from C applications.
  Protocol Buffers are a way of encoding structured data in an efficient yet
  extensible format. Google uses Protocol Buffers for almost all of its
  internal RPC protocols and file formats.
endef

CONFIGURE_ARGS += \
	--enable-shared \
	--enable-static \
	--disable-protoc

define Build/InstallDev
	$(INSTALL_DIR) $(1)/usr/include/
	$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/protobuf2json-c.{a,la,so*} $(1)/usr/lib/
	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
endef

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

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