xref: /unit/pkg/deb/debian.module/rules-noarch.in (revision 2103:6e61a013417e)
1980Sdefan@nginx.com#!/usr/bin/make -f
2980Sdefan@nginx.com
3980Sdefan@nginx.com# Uncomment this to turn on verbose mode.
4980Sdefan@nginx.com#export DH_VERBOSE=1
5980Sdefan@nginx.com
6980Sdefan@nginx.comexport DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie
7980Sdefan@nginx.comexport DEB_CFLAGS_MAINT_APPEND=-Wp,-D_FORTIFY_SOURCE=2 -fPIC
8980Sdefan@nginx.comDPKG_EXPORT_BUILDFLAGS = 1
9980Sdefan@nginx.cominclude /usr/share/dpkg/buildflags.mk
10980Sdefan@nginx.com
11980Sdefan@nginx.comBUILDDIR_unit = $(CURDIR)/debian/build-unit
12980Sdefan@nginx.comBUILDDIR_unit_debug = $(CURDIR)/debian/build-unit-debug
13980Sdefan@nginx.comINSTALLDIR = $(CURDIR)/debian/%%NAME%%
14980Sdefan@nginx.comBASEDIR = $(CURDIR)
15980Sdefan@nginx.com
16980Sdefan@nginx.com%%MODULE_DEFINITIONS%%
17980Sdefan@nginx.com
18980Sdefan@nginx.comconfig.env.%:
19980Sdefan@nginx.com	dh_testdir
20980Sdefan@nginx.com	mkdir -p $(BUILDDIR_$*)
21980Sdefan@nginx.com	cp -Pa $(CURDIR)/auto $(BUILDDIR_$*)/
22980Sdefan@nginx.com	cp -Pa $(CURDIR)/configure $(BUILDDIR_$*)/
23980Sdefan@nginx.com	cp -Pa $(CURDIR)/src $(BUILDDIR_$*)/
24980Sdefan@nginx.com	cp -Pa $(CURDIR)/test $(BUILDDIR_$*)/
25980Sdefan@nginx.com	cp -Pa $(CURDIR)/version $(BUILDDIR_$*)/
26980Sdefan@nginx.com	cp -Pa $(CURDIR)/CHANGES $(BUILDDIR_$*)/
27980Sdefan@nginx.com	cp -Pa $(CURDIR)/LICENSE $(BUILDDIR_$*)/
28980Sdefan@nginx.com	cp -Pa $(CURDIR)/NOTICE $(BUILDDIR_$*)/
29*2103Sthresh@nginx.com	cp -Pa $(CURDIR)/README.md $(BUILDDIR_$*)/
30*2103Sthresh@nginx.com	cp -Pa $(CURDIR)/CONTRIBUTING.md $(BUILDDIR_$*)/
311316Smax.romanov@nginx.com	cp -Pa $(CURDIR)/go $(BUILDDIR_$*)/
32980Sdefan@nginx.com	touch $@
33980Sdefan@nginx.com
34980Sdefan@nginx.comconfigure.unit: config.env.unit
35980Sdefan@nginx.com	cd $(BUILDDIR_unit) && \
36980Sdefan@nginx.com	CFLAGS= ./configure \
37980Sdefan@nginx.com		%%CONFIGURE_ARGS%% \
38980Sdefan@nginx.com		--modules=/usr/lib/unit/modules \
39980Sdefan@nginx.com		--cc-opt="$(CFLAGS)" && \
40980Sdefan@nginx.com	./configure %%MODULE_CONFARGS%%
41980Sdefan@nginx.com	touch $@
42980Sdefan@nginx.com
43980Sdefan@nginx.comconfigure.unit_debug: config.env.unit_debug
44980Sdefan@nginx.com	cd $(BUILDDIR_unit_debug) && \
45980Sdefan@nginx.com	CFLAGS= ./configure \
46980Sdefan@nginx.com		%%CONFIGURE_ARGS%% \
47980Sdefan@nginx.com		--modules=/usr/lib/unit/debug-modules \
48980Sdefan@nginx.com		--cc-opt="$(CFLAGS)" \
49980Sdefan@nginx.com		--debug && \
50980Sdefan@nginx.com	./configure %%MODULE_CONFARGS%%
51980Sdefan@nginx.com	touch $@
52980Sdefan@nginx.com
53980Sdefan@nginx.combuild-arch.%: configure.%
54980Sdefan@nginx.com	dh_testdir
55980Sdefan@nginx.com	$(MAKE) -C $(BUILDDIR_$*) %%MODULE_MAKEARGS%%
56980Sdefan@nginx.com	touch $@
57980Sdefan@nginx.com
58980Sdefan@nginx.combuild-indep:
59980Sdefan@nginx.com	dh_testdir
60980Sdefan@nginx.com	touch $@
61980Sdefan@nginx.com
62980Sdefan@nginx.combuild-arch: build-arch.unit build-arch.unit_debug
63980Sdefan@nginx.com	dh_testdir
64980Sdefan@nginx.com	touch $@
65980Sdefan@nginx.com
66980Sdefan@nginx.combuild: build-arch build-indep
67980Sdefan@nginx.com	dh_testdir
68980Sdefan@nginx.com	touch $@
69980Sdefan@nginx.com
70980Sdefan@nginx.comclean:
71980Sdefan@nginx.com	dh_testdir
72980Sdefan@nginx.com	dh_testroot
73980Sdefan@nginx.com	dh_clean
74980Sdefan@nginx.com	find $(CURDIR) -maxdepth 1 -size 0 -delete
75980Sdefan@nginx.com	rm -rf $(BUILDDIR_unit) $(BUILDDIR_unit_debug)
76980Sdefan@nginx.com
77980Sdefan@nginx.cominstall: build
78980Sdefan@nginx.com	dh_testdir
79980Sdefan@nginx.com	dh_testroot
80980Sdefan@nginx.com	dh_prep
81980Sdefan@nginx.com	dh_installdirs
82980Sdefan@nginx.com	dh_installinit
83980Sdefan@nginx.com	dh_installlogrotate
84980Sdefan@nginx.com%%MODULE_PREINSTALL%%
85980Sdefan@nginx.com	cd $(BUILDDIR_unit) && \
86980Sdefan@nginx.com	DESTDIR=$(INSTALLDIR) make %%MODULE_INSTARGS%%
87980Sdefan@nginx.com	cd $(BUILDDIR_unit_debug) && \
88980Sdefan@nginx.com	DESTDIR=$(INSTALLDIR) make %%MODULE_INSTARGS%%
89980Sdefan@nginx.com%%MODULE_POSTINSTALL%%
90980Sdefan@nginx.com
91980Sdefan@nginx.combinary-indep: build install
92980Sdefan@nginx.com	dh_testdir
93980Sdefan@nginx.com	dh_testroot
94980Sdefan@nginx.com	dh_installdocs
95980Sdefan@nginx.com	dh_installchangelogs
96980Sdefan@nginx.com	dh_link
97980Sdefan@nginx.com	dh_compress
98980Sdefan@nginx.com	dh_fixperms
99980Sdefan@nginx.com	dh_installdeb
100980Sdefan@nginx.com	dh_perl
101980Sdefan@nginx.com	dh_gencontrol
102980Sdefan@nginx.com	dh_md5sums
103980Sdefan@nginx.com	dh_builddeb
104980Sdefan@nginx.com
105980Sdefan@nginx.combinary-arch: install
106980Sdefan@nginx.com
107980Sdefan@nginx.combinary: binary-indep binary-arch
108980Sdefan@nginx.com
109980Sdefan@nginx.com.PHONY: clean binary-indep binary-arch binary install build
110