File: rules

package info (click to toggle)
libdbi-perl 1.643-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,928 kB
  • sloc: perl: 18,244; ansic: 608; makefile: 30; cpp: 4
file content (44 lines) | stat: -rwxr-xr-x 1,518 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
#!/usr/bin/make -f

# this number comes from DBISTATE_VERSION in DBIXS.h
# it is used for the Provides: perl-dbdabi-XX relationship
# it needs to be updated manually because of the implications on the archive
#  (rebuilds of all libdbd-*-perl packages), see #577209

DBDABI_VERSION = 94
DBDABI_DETECTED_VERSION = $(shell cpp `perl -MExtUtils::Embed -e ccopts` debian/get-dbdabi-version.cpp | sh)

PACKAGE = $(shell dh_listpackages)
TMP     = $(CURDIR)/debian/$(PACKAGE)

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --no-parallel

override_dh_auto_configure:
ifeq ($(DBDABI_VERSION),$(DBDABI_DETECTED_VERSION))
	dh_auto_configure
else
	echo Aborting due to DBD ABI version mismatch - configured $(DBDABI_VERSION), detected $(DBDABI_DETECTED_VERSION)
	exit 1
endif

override_dh_auto_build:
	dh_auto_build
	printf "%s\n%s\n%s\n" \
	  "# this variable is the preferred interface for generating a perl-dbdabi-* dependency." \
	  "# See #577209." \
	  "PERL_DBDABI_DEPENDS=perl-dbdabi-$(DBDABI_VERSION)" \
	 > debian/perl-dbdabi.make
	sed "s,@DBDABI_VERSION@,$(DBDABI_VERSION)," debian/dh_perl_dbi.in >debian/dh_perl_dbi
	chmod +x debian/dh_perl_dbi
	pod2man debian/dh_perl_dbi debian/dh_perl_dbi.1

override_dh_gencontrol:
	dh_gencontrol -- -Vperl-dbdabi-version=$(DBDABI_VERSION)

override_dh_installexamples:
	dh_installexamples
	sed -i '1s|^#!perl|#!/usr/bin/perl|' $(TMP)/usr/share/doc/$(PACKAGE)/examples/*
	sed -i '1s|^#!/usr/local/bin/perl|#!/usr/bin/perl|' $(TMP)/usr/share/doc/$(PACKAGE)/examples/*