File: rules

package info (click to toggle)
ejabberd-contrib 0.2018.12.10~dfsg0-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,068 kB
  • sloc: erlang: 10,472; sql: 92; makefile: 80; sh: 27
file content (58 lines) | stat: -rwxr-xr-x 2,334 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
DH_VERBOSE = 1

include /usr/share/dpkg/default.mk

BIN_PACKAGES=$(shell grep ^Package: debian/control  | sed 's/^Package: //' | grep -v ejabberd-contrib)
EJABBERDDIR=$(shell basename `find /usr/lib -regextype posix-egrep -maxdepth 2 -type d -regex ".*/ejabberd-[0-9.]{5,10}-.*"`)
EJABBERDVER=$(shell dpkg-query --show --showformat '$${Version;-25}' ejabberd)

ejabberd-mod-cron_BUILD_PATH=mod_cron/
ejabberd-mod-log-chat_BUILD_PATH=mod_log_chat/
ejabberd-mod-logsession_BUILD_PATH=mod_logsession/
ejabberd-mod-logxml_BUILD_PATH=mod_logxml/
ejabberd-mod-message-log_BUILD_PATH=mod_message_log/
ejabberd-mod-muc-log-http_BUILD_PATH=mod_muc_log_http/
ejabberd-mod-post-log_BUILD_PATH=mod_post_log/
ejabberd-mod-pottymouth_BUILD_PATH=mod_pottymouth/
ejabberd-mod-rest_BUILD_PATH=mod_rest/
ejabberd-mod-s2s-log_BUILD_PATH=mod_s2s_log/
ejabberd-mod-shcommands_BUILD_PATH=mod_shcommands/
ejabberd-mod-statsdx_BUILD_PATH=mod_statsdx/
ejabberd-mod-webpresence_BUILD_PATH=mod_webpresence/

%:
	dh $@

compile-%:
	mkdir ${$*_BUILD_PATH}ebin
	cd ${$*_BUILD_PATH} && erlc -o ebin -I /usr/lib/$(DEB_TARGET_MULTIARCH)/$(EJABBERDDIR)/include -DLAGER \
		-pa /usr/lib/$(DEB_TARGET_MULTIARCH)/$(EJABBERDDIR)/ebin/ src/*.erl

override_dh_auto_build: $(BIN_PACKAGES:%=compile-%)

module-install-%:
	mkdir -p debian/$*/usr/lib/$(DEB_TARGET_MULTIARCH)/$(EJABBERDDIR)/ebin
	mkdir -p debian/$*/usr/share/doc/$*
	mv -v ${$*_BUILD_PATH}ebin/*.beam debian/$*/usr/lib/$(DEB_TARGET_MULTIARCH)/$(EJABBERDDIR)/ebin/
	debian/dh_moduleupdate $*
	if [ -f ${$*_BUILD_PATH}ChangeLog ]; then cp ${$*_BUILD_PATH}ChangeLog debian/$*/usr/share/doc/$*/changelog; fi
	if [ -d ${$*_BUILD_PATH}conf ];	then cp -a ${$*_BUILD_PATH}conf debian/$*/usr/share/doc/$*/; fi
	if [ -f ${$*_BUILD_PATH}README.* ]; then cp -v ${$*_BUILD_PATH}README.* debian/$*/usr/share/doc/$*/; fi
	if [ -f ${$*_BUILD_PATH}TODO* ]; then cp -v ${$*_BUILD_PATH}TODO* debian/$*/usr/share/doc/$*/; fi

override_dh_auto_install: $(BIN_PACKAGES:%=module-install-%)
	erlang-depends
	dh_auto_install

override_dh_gencontrol:
	echo "ejabberd=$(EJABBERDVER)" >> $(CURDIR)/debian/substvars
	dh_gencontrol -- -T$(CURDIR)/debian/substvars

override_dh_installdeb:
	dh_installdeb
	rm -f debian/ejabberd-contrib/DEBIAN/postinst

override_dh_auto_clean:
	rm -rf */ebin debian/substvars
	dh_auto_clean