summaryrefslogtreecommitdiffhomepage
path: root/pkg/deb/debian.module/rules.in
diff options
context:
space:
mode:
authorAndrei Belov <defan@nginx.com>2017-10-19 18:23:32 +0300
committerAndrei Belov <defan@nginx.com>2017-10-19 18:23:32 +0300
commit156877f3c99b54c78e3cae111542f5519a97a68a (patch)
tree2c21edccede53614245118f927f0a2aea8d3e944 /pkg/deb/debian.module/rules.in
parenteabe25d98e6805221025daf7bc60d881af1af6b1 (diff)
downloadunit-156877f3c99b54c78e3cae111542f5519a97a68a.tar.gz
unit-156877f3c99b54c78e3cae111542f5519a97a68a.tar.bz2
Introduced deb packages building tools.0.2
Diffstat (limited to 'pkg/deb/debian.module/rules.in')
-rwxr-xr-xpkg/deb/debian.module/rules.in95
1 files changed, 95 insertions, 0 deletions
diff --git a/pkg/deb/debian.module/rules.in b/pkg/deb/debian.module/rules.in
new file mode 100755
index 00000000..4498cdca
--- /dev/null
+++ b/pkg/deb/debian.module/rules.in
@@ -0,0 +1,95 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+BUILDDIR_unit = $(CURDIR)/debian/build-unit
+BUILDDIR_unit_debug = $(CURDIR)/debian/build-unit-debug
+INSTALLDIR = $(CURDIR)/debian/%%NAME%%
+BASEDIR = $(CURDIR)
+
+%%MODULE_DEFINITIONS%%
+
+config.env.%:
+ dh_testdir
+ mkdir -p $(BUILDDIR_$*)
+ cp -Pa $(CURDIR)/auto $(BUILDDIR_$*)/
+ cp -Pa $(CURDIR)/configure $(BUILDDIR_$*)/
+ cp -Pa $(CURDIR)/src $(BUILDDIR_$*)/
+ cp -Pa $(CURDIR)/test $(BUILDDIR_$*)/
+ touch $@
+
+configure.unit: config.env.unit
+ cd $(BUILDDIR_unit) && \
+ ./configure \
+ %%CONFIGURE_ARGS%% \
+ --modules=/usr/lib/unit/modules && \
+ ./configure %%MODULE_CONFARGS%%
+ touch $@
+
+configure.unit_debug: config.env.unit_debug
+ cd $(BUILDDIR_unit_debug) && \
+ ./configure \
+ %%CONFIGURE_ARGS%% \
+ --modules=/usr/lib/unit/debug-modules \
+ --debug && \
+ ./configure %%MODULE_CONFARGS%%
+ touch $@
+
+build-arch.%: configure.%
+ dh_testdir
+ $(MAKE) -C $(BUILDDIR_$*) %%MODULE_MAKEARGS%%
+ touch $@
+
+build-indep:
+ dh_testdir
+ touch $@
+
+build-arch: build-arch.unit build-arch.unit_debug
+ dh_testdir
+ touch $@
+
+build: build-arch build-indep
+ dh_testdir
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ dh_clean
+ find $(CURDIR) -maxdepth 1 -size 0 -delete
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_prep
+ dh_installdirs
+ dh_installinit
+ dh_installlogrotate
+%%MODULE_PREINSTALL%%
+ cd $(BUILDDIR_unit) && \
+ DESTDIR=$(INSTALLDIR) make %%MODULE_INSTARGS%%
+ cd $(BUILDDIR_unit_debug) && \
+ DESTDIR=$(INSTALLDIR) make %%MODULE_INSTARGS%%
+
+binary-indep: build install
+ dh_testdir
+ dh_testroot
+ dh_installdocs
+ dh_installchangelogs
+ dh_link
+ dh_strip --dbg-package=%%NAME%%-dbg
+ dh_shlibdeps
+ dh_compress
+ dh_fixperms
+ dh_installdeb
+ dh_perl
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary-arch: install
+
+binary: binary-indep binary-arch
+
+.PHONY: clean binary-indep binary-arch binary install build