File: rules

package info (click to toggle)
postgresql-common 165
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 1,060 kB
  • sloc: perl: 2,815; sh: 1,083; makefile: 62
file content (50 lines) | stat: -rwxr-xr-x 1,932 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

VERSION := $(shell dpkg-parsechangelog | awk '/^Version:/ { print $$2 }')
ifneq ($(findstring bpo,$(VERSION)),)
	FLAVOR := debian-backports
else ifneq ($(findstring pgdg,$(VERSION)),)
	FLAVOR := pgdg
else
	FLAVOR := default
endif
SUPPORTED_VERSIONS := $(shell PG_SUPPORTED_VERSIONS="$(FLAVOR)" debian/supported-versions)
DEFAULT_VER := $(lastword $(SUPPORTED_VERSIONS))

# use dh_systemd_* only on recent dists that have dh-systemd (>= 1.19)
ifneq ($(wildcard /usr/bin/dh_systemd_start),)
WITH_SYSTEMD=--with systemd
endif

%:
	dh $@ $(WITH_SYSTEMD)

override_dh_auto_configure:
	@echo "### Building postgresql-common flavor $(FLAVOR)"
	@echo "### Supported PostgreSQL versions: $(SUPPORTED_VERSIONS) (default version: $(DEFAULT_VER))"

override_dh_install:
	dh_install
	$(MAKE) -C systemd install DESTDIR=$(CURDIR)/debian/postgresql-common
	install -m 644 -D debian/postgresql-common.sysctl debian/postgresql-common/etc/sysctl.d/30-postgresql-shm.conf
ifneq ($(FLAVOR),default)
	/bin/echo -e "# See /usr/share/postgresql-common/supported-versions for documentation of this file\n$(FLAVOR)" > debian/postgresql-client-common/etc/postgresql-common/supported_versions
endif

override_dh_installinit:
	dh_installinit --name=postgresql -u'defaults 19 21' -r

override_dh_gencontrol:
	dh_gencontrol -ppostgresql-server-dev-all -- -Vserver-dev-all-depends="$(foreach v,$(SUPPORTED_VERSIONS),postgresql-server-dev-$v,)"

	# the versionless metapackages need to have version numbers which match
	# the server version, not the p-common version
	dh_gencontrol -ppostgresql -ppostgresql-client -ppostgresql-doc -ppostgresql-contrib  -- \
		-Vdefault-version="$(DEFAULT_VER)" -v'$(DEFAULT_VER)+$${source:Version}'

ifeq ($(FLAVOR),pgdg)
	# for apt.postgresql.org builds, pull in the repository key package
	dh_gencontrol -ppostgresql-client-common -- -Vpgdg:Depends="pgdg-keyring"
endif

	dh_gencontrol --remaining-packages