xref: /OK3568_Linux_fs/buildroot/package/prosody/prosody.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# prosody
4#
5################################################################################
6
7PROSODY_VERSION = 0.11.10
8PROSODY_SITE = https://prosody.im/downloads/source
9PROSODY_LICENSE = MIT
10PROSODY_LICENSE_FILES = COPYING
11PROSODY_CPE_ID_VENDOR = prosody
12PROSODY_DEPENDENCIES = host-luainterpreter luainterpreter libidn openssl
13
14PROSODY_CFLAGS = $(TARGET_CFLAGS) -fPIC -std=c99 \
15	$(if BR2_TOOLCHAIN_USES_MUSL,-DWITHOUT_MALLINFO)
16
17PROSODY_CONF_OPTS = \
18	--with-lua-bin=$(HOST_DIR)/bin \
19	--with-lua=$(STAGING_DIR)/usr \
20	--lua-version=$(LUAINTERPRETER_ABIVER) \
21	--c-compiler=$(TARGET_CC) \
22	--cflags="$(PROSODY_CFLAGS)" \
23	--linker=$(TARGET_CC) \
24	--ldflags="$(TARGET_LDFLAGS) -shared" \
25	--sysconfdir=/etc/prosody \
26	--prefix=/usr
27
28ifeq ($(BR2_PACKAGE_LUAJIT),y)
29PROSODY_CONF_OPTS += --runwith=luajit
30endif
31
32define PROSODY_CONFIGURE_CMDS
33	cd $(@D) && \
34		$(TARGET_CONFIGURE_OPTS) \
35		./configure $(PROSODY_CONF_OPTS)
36endef
37
38define PROSODY_BUILD_CMDS
39	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
40endef
41
42define PROSODY_INSTALL_TARGET_CMDS
43	$(TARGET_MAKE_ENV) $(MAKE) DESTDIR="$(TARGET_DIR)" -C $(@D) install
44endef
45
46define PROSODY_INSTALL_INIT_SYSV
47	$(INSTALL) -D -m 0755 package/prosody/S50prosody \
48		$(TARGET_DIR)/etc/init.d/S50prosody
49endef
50
51define PROSODY_USERS
52	prosody -1 prosody -1 * - - - Prosody user
53endef
54
55# make install installs a Makefile and meta data to generate certs
56define PROSODY_REMOVE_CERT_GENERATOR
57	rm -f $(TARGET_DIR)/etc/prosody/certs/Makefile
58	rm -f $(TARGET_DIR)/etc/prosody/certs/*.cnf
59endef
60
61PROSODY_POST_INSTALL_TARGET_HOOKS += PROSODY_REMOVE_CERT_GENERATOR
62
63$(eval $(generic-package))
64