summaryrefslogtreecommitdiffstats
path: root/package/prosody/prosody.mk
blob: d95578253d6d200b890851f84e5bf141590ae9e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
################################################################################
#
# prosody
#
################################################################################

PROSODY_VERSION = 0.10.0
PROSODY_SITE = https://prosody.im/downloads/source
PROSODY_LICENSE = MIT
PROSODY_LICENSE_FILES = COPYING
PROSODY_DEPENDENCIES = host-luainterpreter luainterpreter libidn openssl

PROSODY_CFLAGS = $(TARGET_CFLAGS) -fPIC -std=c99 \
	$(if BR2_TOOLCHAIN_USES_MUSL,-DWITHOUT_MALLINFO)

PROSODY_CONF_OPTS = \
	--with-lua-bin=$(HOST_DIR)/usr/bin \
	--with-lua=$(STAGING_DIR)/usr \
	--lua-version=$(LUAINTERPRETER_ABIVER) \
	--c-compiler=$(TARGET_CC) \
	--cflags="$(PROSODY_CFLAGS)" \
	--linker=$(TARGET_CC) \
	--ldflags="$(TARGET_LDFLAGS) -shared" \
	--sysconfdir=/etc/prosody \
	--prefix=/usr

ifeq ($(BR2_PACKAGE_LUAJIT),y)
PROSODY_CONF_OPTS += --runwith=luajit
endif

define PROSODY_CONFIGURE_CMDS
	cd $(@D) && \
		$(TARGET_CONFIGURE_OPTS) \
		./configure $(PROSODY_CONF_OPTS)
endef

define PROSODY_BUILD_CMDS
	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
endef

define PROSODY_INSTALL_TARGET_CMDS
	$(TARGET_MAKE_ENV) $(MAKE) DESTDIR="$(TARGET_DIR)" -C $(@D) install
endef

define PROSODY_INSTALL_INIT_SYSV
	$(INSTALL) -D -m 0755 package/prosody/S50prosody \
		$(TARGET_DIR)/etc/init.d/S50prosody
endef

define PROSODY_USERS
	prosody -1 prosody -1 * - - - Prosody user
endef

# make install installs a Makefile and meta data to generate certs
define PROSODY_REMOVE_CERT_GENERATOR
	rm -f $(TARGET_DIR)/etc/prosody/certs/Makefile
	rm -f $(TARGET_DIR)/etc/prosody/certs/*.cnf
endef

PROSODY_POST_INSTALL_TARGET_HOOKS += PROSODY_REMOVE_CERT_GENERATOR

$(eval $(generic-package))
OpenPOWER on IntegriCloud