2013/02/04

[工作點滴] message pack rpc install on openwrt

Message pack with RPC extension required 3 packages.


  • msgpack
  • msgpack-rpc
  • mpio

The msgpack and mpio are required by msgpack-rpc. The following are openwrt makefiles that I use to build the packages.


msgpack library
include $(TOPDIR)/rules.mk

PKG_NAME:=msgpack
PKG_VERSION:=0.5.7
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://msgpack.org/releases/cpp/
PKG_MD5SUM:=705106a9378c792fe22d285dba5c142c
PKG_INSTALL:=1

include $(INCLUDE_DIR)/package.mk

define Package/msgpack
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=Message Pack library
  URL:=http://msgpack.org
endef

define Package/msgpack/description
  MessagePack is an efficient binary serialization format.
  It lets you exchange data among multiple languages like JSON but it's faster and smaller.
endef

define Build/Configure
     $(call Build/Configure/Default, )
endef

define Build/InstallDev
     $(INSTALL_DIR) $(1)/usr/include/
     $(CP) \
          $(PKG_INSTALL_DIR)/usr/include/* \
          $(1)/usr/include/

     $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
     $(CP) \
          $(PKG_INSTALL_DIR)/usr/lib/libmsgpack*.{la,so*} \
          $(1)/usr/lib/
endef

define Package/msgpack/install
     $(INSTALL_DIR) $(1)/usr/lib
     $(CP) \
          $(PKG_INSTALL_DIR)/usr/lib/libmsgpack*.* \
          $(1)/usr/lib/
endef

$(eval $(call BuildPackage,msgpack))

mpio library
include $(TOPDIR)/rules.mk

PKG_NAME:=mpio
PKG_VERSION:=0.3.7
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=libtool
PKG_INSTALL:=1

include $(INCLUDE_DIR)/package.mk

define Package/mpio
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=Multipurpose parallel IO
  URL:=https://github.com/frsyuki/mpio
endef

define Package/mpio/description
  Multipurpose parallel I/O framework for C++ with fully multithreaded
  event loop implementation
endef

define Build/Prepare
     mkdir -p $(PKG_BUILD_DIR)
     $(CP) src/* $(PKG_BUILD_DIR)/
endef

define Build/Configure
     $(call Build/Configure/Default, )
endef

define Build/InstallDev
     $(INSTALL_DIR) $(1)/usr/include/
     $(CP) \
          $(PKG_INSTALL_DIR)/usr/include/* \
          $(1)/usr/include/

     $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
     $(CP) \
          $(PKG_INSTALL_DIR)/usr/lib/libmpio*.{la,so*} \
          $(1)/usr/lib/
endef

define Package/mpio/install
     $(INSTALL_DIR) $(1)/usr/lib
     $(CP) \
          $(PKG_INSTALL_DIR)/usr/lib/libmpio*.* \
          $(1)/usr/lib/
endef

$(eval $(call BuildPackage,mpio))

msgpack-rpc library
include $(TOPDIR)/rules.mk

PKG_NAME:=msgpack-rpc
PKG_VERSION:=0.3.1
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://msgpack.org/releases/cpp/
PKG_MD5SUM:=e5e8f3631ac83d20cdf65fa0d7bfee21
PKG_INSTALL:=1

include $(INCLUDE_DIR)/package.mk

define Package/msgpack-rpc
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=Message Pack library
  URL:=http://msgpack.org
  DEPENDS:=+libmsgpack +libmpio
endef

define Package/msgpack-rpc/description
  MessagePack-RPC is an extension to support RPC through message pack.
endef

define Build/Configure
     $(call Build/Configure/Default, )
endef

define Build/InstallDev
     $(INSTALL_DIR) $(1)/usr/include/
     $(CP) \
          $(PKG_INSTALL_DIR)/usr/include/ \
          $(1)/usr/include/
endef

define Package/msgpack-rpc/install
     $(INSTALL_DIR) $(1)/usr/lib
endef

$(eval $(call BuildPackage,msgpack-rpc))

沒有留言: