简体   繁体   English

ejabberd如何编译新模块

[英]ejabberd how to compile new module

Here I found the code: 在这里,我找到了代码:

erlc -I ~/ejabberd-2.1.13/lib/ejabberd-2.1.13/include -pa ~/ejabberd-2.1.13/lib/ejabberd-2.1.13/ebin   mod_my.erl 

But it did not work? 但这没有用吗?

Here are steps to add your custom module into ejabberd 以下是将自定义模块添加到ejabberd中的步骤

  1. put your module into ejabberd/src folder. 将您的模块放入ejabberd / src文件夹。
  2. come to ejabberd directory in terminal and run command $ sudo make 进入终端的ejabberd目录并运行命令$ sudo make
  3. it will show you that your module is compiled. 它会告诉您您的模块已编译。 Now run $ sudo make install 现在运行$ sudo make install
  4. Add your module into config file at /etc/ejabberd/ejabberd.yml 将您的模块添加到/etc/ejabberd/ejabberd.yml的配置文件中
  5. restart your ejabberd and your custom module will be running. 重新启动ejabberd,您的自定义模块将运行。

Just drop the module in the ejabberd's src/ folder then "make". 只需将模块拖放到ejabberd的src /文件夹中,然后单击“ make”即可。 Nothing special needed to compile it. 无需特殊编译即可。

These are the Instructions based on Ejabberd recommendation 这些是基于Ejabberd建议的说明

1) Form the folder structure like below (refer any module from -- https://github.com/processone/ejabberd-contrib ). 1)形成如下所示的文件夹结构(请参阅-https: //github.com/processone/ejabberd-contrib中的任何模块)。

sources 资料来源

│───conf │───conf
│ └───modulename.yml │└───modulename.yml
│───src │───src
│ └───modulename.erl │└───modulename.erl
│───README.txt │───README.txt
│───COPYING │───复制
│───modulename.spec │───modulename.spec

2) Add your module folder structure to ejabberd user home directory (check ejabberdctl.cfg for CONTRIB_MODULES_PATH param). 2)将模块文件夹结构添加到ejabberd用户主目录(检查ejabberdctl.cfg中的CONTRIB_MODULES_PATH参数)。

3) Type command ejabberdctl modules_available it will list your module 3)输入命令ejabberdctl modules_available它将列出您的模块

4) Type ejabberdctl module_install module_name command 4)输入ejabberdctl module_install module_name命令

For Reference https://docs.ejabberd.im/developer/extending-ejabberd/modules/ 供参考https://docs.ejabberd.im/developer/extending-ejabberd/modules/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM