|
1 | 1 | #!/usr/bin/make -f |
2 | 2 |
|
3 | | -DEB_BUILDDIR ?= $(CURDIR) |
4 | | -EXTENSION_NAME ?= "<%= self.package.extension_name %>" |
| 3 | +export DEB_BUILDDIR = $(CURDIR) |
| 4 | +export PGPM_BUILDROOT = $(CURDIR) |
| 5 | +export PG_CONFIG = $(shell /usr/bin/which pg_config) |
| 6 | +export PGPM_EXTENSION_NAME = "<%= self.package.extension_name %>" |
| 7 | +export PGPM_EXTENSION_VERSION = "<%= self.package.version %>" |
| 8 | +export PGPM_INSTALL_ROOT = "$(CURDIR)/debian/<%= deb_pkg_name(pkg_type) %>" |
5 | 9 |
|
6 | 10 | <% if pkg_type == :versioned %> |
7 | 11 | %: |
8 | | - dh $@ |
9 | | - |
10 | | -override_dh_install: |
11 | | - dh_install |
12 | | - chmod +x "$(DEB_BUILDDIR)/prepare_artifacts.sh" |
13 | | - find $(DEB_BUILDDIR) -type f | sort - | sed 's|^$(DEB_BUILDDIR)||' > .pgpm_before | sort |
14 | | - export PG_CONFIG="which pg_config"; \ |
15 | | - export PGPM_BUILDROOT="$(DEB_BUILDDIR)"; \ |
16 | | - export PGPM_EXTENSION_NAME=$(EXTENSION_NAME); \ |
17 | | - export PGPM_EXTENSION_VERSION="<%= self.package.version %>"; \ |
18 | | - export PGPM_INSTALL_ROOT="$(DEB_BUILDDIR)/debian/<%= deb_pkg_name(pkg_type) %>"; \ |
| 12 | + echo " --> % rules target" |
| 13 | + |
| 14 | +build: |
| 15 | + echo " --> build target" |
| 16 | + <%= self.package.build_steps.join("\n\t").gsub('$', '$$') %> |
| 17 | + |
| 18 | +install: build |
| 19 | + mkdir -p $$PGPM_INSTALL_ROOT |
| 20 | + echo " --> install target" |
| 21 | + <%= self.package.install_steps.join("\n\t").gsub('$', '$$') %> |
| 22 | + chmod +x "$$DEB_BUILDDIR/prepare_artifacts.sh" |
| 23 | + find $$PGPM_INSTALL_ROOT -type f | sort - | sed 's|^$$PGPM_INSTALL_ROOT||' > .pgpm_before | sort |
19 | 24 | ./prepare_artifacts.sh |
20 | 25 |
|
21 | | -<% if self.package.configure_steps.size > 0 %> |
22 | | -override_dh_auto_configure: |
23 | | - <%= self.package.configure_steps.join("\n\t") %> |
24 | | -<% end %> |
| 26 | +build-arch: |
| 27 | + echo " --> build-arch" |
25 | 28 |
|
26 | | -<% if self.package.build_steps.size > 0 %> |
27 | | -override_dh_build: |
28 | | - <%= self.package.build_steps.join("\n\t") %> |
29 | | -<% end %> |
| 29 | +build-indep: |
| 30 | + echo " --> build-indep" |
30 | 31 |
|
31 | | -<% if self.package.install_steps.size > 0 %> |
32 | | -override_dh_install: |
33 | | - <%= self.package.install_steps.join("\n\t") %> |
34 | | -<% end %> |
| 32 | +binary: install |
| 33 | + echo " --> binary" |
| 34 | + |
| 35 | +binary-arch: |
| 36 | + echo " --> binary-arch" |
| 37 | + |
| 38 | +binary-indep: |
| 39 | + echo " --> binary-indep" |
| 40 | + |
| 41 | +clean: |
| 42 | + echo " --> clean" |
35 | 43 |
|
36 | 44 | <% else %> |
37 | 45 | %: |
38 | 46 | dh $@ |
39 | 47 |
|
40 | 48 | install: |
41 | 49 | echo " --> INSTALL" |
42 | | - chmod +x "$(DEB_BUILDDIR)/install_default_control.sh" |
43 | | - export PG_CONFIG="which pg_config"; \ |
44 | | - export PGPM_BUILDROOT="$(DEB_BUILDDIR)"; \ |
45 | | - export PGPM_EXTENSION_NAME=$(EXTENSION_NAME); \ |
46 | | - export PGPM_EXTENSION_VERSION="<%= self.package.version %>"; \ |
47 | | - export PGPM_INSTALL_ROOT="$(DEB_BUILDDIR)/debian/<%= deb_pkg_name(pkg_type) %>"; \ |
| 50 | + chmod +x "$$DEB_BUILDDIR/install_default_control.sh" |
48 | 51 | ./install_default_control.sh |
49 | 52 | <% end %> |
0 commit comments