I am trying to compile a dovecot plugin that can use elasticsearch, which is basically a wrapper that sends json commands to elasticsearch nodes.
https://github.com/ascendantcom/fts-elasticsearch
the normal compile sequence is:
./autogen.sh
./configure --with-dovecot=/path/to/dovecot/src/root
make
make install
I haven't found any package Makefile example with autogen.sh, so I think this means I have to setup my own configure/Makefiles??
So far I have the following Makefile placed in package/fts-elasticsearch and it seems to take care of the downloading and dependencies (dovecot + libjson-c).
include $(TOPDIR)/rules.mk
PKG_NAME:=fts-elasticsearch
PKG_VERSION:=20150731
PKG_RELEASE=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/ascendantcom/fts-elasticsearch.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=HEAD
include $(INCLUDE_DIR)/package.mk
define Package/fts-elasticsearch
SECTION:=mail
CATEGORY:=Mail
DEPENDS:=+dovecot +libjson-c
TITLE:=fts-elasticsearch plugin for dovecot
endef
define Package/fts-elasticsearch/description
fts-elasticsearch plugin for dovecot
endef
$(eval $(call BuildPackage,fts-elasticsearch))
What I don't seem to be able to grasp is what needs to be in the package Makefile so that I can incorporate the following from src/Makefile.am so I can compile the actual code?
AM_CFLAGS= \
-I$(dovecotdir)/src/plugins/fts \
$(LIBDOVECOT_INCLUDE)
AM_LDFLAGS= -ljson-c
lib21_fts_elasticsearch_plugin_la_LDFLAGS = -module -avoid-version
lib21_fts_elasticsearch_plugin_ladir = $(dovecot_pkglibdir)
lib21_fts_elasticsearch_plugin_la_LTLIBRARIES = lib21_fts_elasticsearch_plugin.la
lib21_fts_elasticsearch_plugin_la_SOURCES = fts-elasticsearch-plugin.c fts-backend-elasticsearch.c elasticsearch-conn.c
Is it just me or is the package making documentation really cryptic? I suppose it's very difficult to cover all possible ways to compile.