#!/usr/bin/make -f export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all include /usr/share/dpkg/default.mk export ERL_COMPILER_OPTIONS=deterministic DESTDIR=$(CURDIR)/debian/ejabberd %: dh $@ .PHONY: override_dh_auto_configure override_dh_auto_configure: mkdir $(CURDIR)/deps && touch $(CURDIR)/deps/.got $(CURDIR)/deps/.built ./autogen.sh sed -i "s/^PACKAGE_VERSION=.*/PACKAGE_VERSION='$(DEB_VERSION_UPSTREAM_REVISION)'/" configure sed -i "s/^PACKAGE_STRING=.*/PACKAGE_STRING='ejabberd $(DEB_VERSION_UPSTREAM_REVISION)'/" configure dh_auto_configure -- \ --enable-mysql \ --enable-odbc \ --enable-pam \ --enable-pgsql \ --enable-redis \ --enable-sip \ --enable-sqlite \ --enable-stun \ --enable-zlib \ --enable-system-deps \ --with-rebar=/usr/bin/rebar .PHONY: override_dh_auto_install override_dh_auto_install: dh_auto_install # symlink version ln -s ejabberd-$(DEB_VERSION_UPSTREAM_REVISION) $(DESTDIR)/usr/lib/$(DEB_TARGET_MULTIARCH)/ejabberd-$(DEB_VERSION_UPSTREAM) # install init script and service file install -m 755 $(CURDIR)/ejabberd.init $(CURDIR)/debian/ install -m 644 $(CURDIR)/ejabberd.service.template $(CURDIR)/debian/ejabberd.service # ejabberd.yml is generated from the template through debconf and installed as /etc/ejabberd/ejabberd.yml rm $(DESTDIR)/etc/ejabberd/ejabberd.yml install -m 644 ejabberd.yml.example $(DESTDIR)/usr/share/ejabberd/ejabberd.yml.example # ejabberdctl.cfg is generated from the template through debconf and installed as /etc/default/ejabberd rm $(DESTDIR)/etc/ejabberd/ejabberdctl.cfg install -m 644 ejabberdctl.cfg.example $(DESTDIR)/usr/share/ejabberd/ejabberdctl.cfg.example # set up /etc/ejabberd/modules.d cp -v $(CURDIR)/debian/README.modules $(DESTDIR)/etc/ejabberd/modules.d/ # move captcha.sh to /usr/share/ejabberd rm $(DESTDIR)/usr/lib/$(DEB_TARGET_MULTIARCH)/ejabberd-$(DEB_VERSION_UPSTREAM_REVISION)/priv/bin/captcha.sh rmdir $(DESTDIR)/usr/lib/$(DEB_TARGET_MULTIARCH)/ejabberd-$(DEB_VERSION_UPSTREAM_REVISION)/priv/bin install -m 755 tools/captcha.sh $(DESTDIR)/usr/share/ejabberd/ # move image files to /usr/share/ejabberd/img mv -v $(DESTDIR)/usr/lib/$(DEB_TARGET_MULTIARCH)/ejabberd-$(DEB_VERSION_UPSTREAM_REVISION)/priv/img $(DESTDIR)/usr/share/ejabberd/img ln -s ../../../../share/ejabberd/img $(DESTDIR)/usr/lib/$(DEB_TARGET_MULTIARCH)/ejabberd-$(DEB_VERSION_UPSTREAM_REVISION)/priv/img # install sql code cp -vr sql $(DESTDIR)/usr/share/ejabberd/ # install ufw profile install -m 644 debian/ejabberd.ufw.profile $(DESTDIR)/etc/ufw/applications.d/ejabberd # install AppArmor profile install -m 644 debian/usr.sbin.ejabberdctl $(DESTDIR)/etc/apparmor.d/usr.sbin.ejabberdctl dh_apparmor --profile-name=usr.sbin.ejabberdctl .PHONY: override_dh_installinit override_dh_installinit: dh_installinit -vR .PHONY: override_dh_installsystemd override_dh_installsystemd: dh_installsystemd --restart-after-upgrade .PHONY: override_dh_compress override_dh_compress: dh_compress --exclude=ejabberd.yml # compress manpage gzip -9n $(DESTDIR)/usr/share/man/man5/ejabberd.yml.5 .PHONY: override_dh_auto_test override_dh_auto_test: .PHONY: override_dh_installdeb override_dh_installdeb: erlang-depends rm -rf $(DESTDIR)/var/lock $(DESTDIR)/usr/bin find $(DESTDIR)/usr/ -name COPYING -delete find $(DESTDIR)/usr/ -name COPYING.gz -delete dh_installdeb .PHONY: override_dh_auto_clean override_dh_auto_clean: rm -rf aclocal.m4 autom4te.cache/ configure rm -f Makefile config.log config.status vars.config priv/sql rm -rf .rebar deps ebin src/XmppAddr.asn1db src/XmppAddr.erl src/eldap_filter_yecc.erl src/ejabberd.app.src rm -f debian/ejabberd.init debian/ejabberd.service ejabberd.init ejabberdctl.example ejabberd.service dh_auto_clean debconf-updatepo override_dh_installexamples: