File: rules

package info (click to toggle)
libalien-wxwidgets-perl 0.69+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 1,220 kB
  • sloc: perl: 5,365; makefile: 19
file content (28 lines) | stat: -rwxr-xr-x 1,328 bytes parent folder | download
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
#!/usr/bin/make -f

# wxWidgets version
WXVER=3.0
# wxWidgets flavour (empty for default flavour)
WXFLAVOUR=-gtk3
export V=`dpkg -s libwxgtk$(WXVER)$(WXFLAVOUR)-dev | grep ^Version |cut -f2 -d' '`
VMAJOR:=$(shell echo $(V) |cut -f 1 -d .)
VMINOR:=$(shell echo $(V) |cut -f 2 -d .)
VPATCH:=$(shell echo $(V) |cut -f 3 -d .)
VPATCHU:=$(shell echo $(VPATCH) |cut -f 1 -d +)
VPATCHD:=$(shell echo $(VPATCH) |cut -f 2 -d +)
NEXTPATCH:=$(shell expr $(VPATCH) + 1 2>/dev/null || expr `echo $(VPATCH) | cut -f 1 -d - ` + 1 2>/dev/null || expr $(VPATCHU) + 1 2>/dev/null)

_DETECTION_CMD := PERL5LIB=$(CURDIR)/blib/lib:$(CURDIR)/blib/arch perl -MAlien::wxWidgets -e '$$key = Alien::wxWidgets->key; $$key =~ s/_/-/g; print "$$key";'

%:
	dh $@

get_perl_wx_version: blib
	: $(eval PERL_WX_VERSION := $(shell $(_DETECTION_CMD)))
	@echo PERL_WX_VERSION detected as $(PERL_WX_VERSION)

override_dh_gencontrol: get_perl_wx_version
	dh_gencontrol -- -V'samewx:Depends=libwxgtk$(WXVER)$(WXFLAVOUR)-dev (>= $(VMAJOR).$(VMINOR).$(VPATCH)), libwxgtk$(WXVER)$(WXFLAVOUR)-dev (<< $(VMAJOR).$(VMINOR).$(NEXTPATCH)~), libwxgtk-media$(WXVER)$(WXFLAVOUR)-dev (>= $(VMAJOR).$(VMINOR).$(VPATCH)), libwxgtk-media$(WXVER)$(WXFLAVOUR)-dev (<< $(VMAJOR).$(VMINOR).$(NEXTPATCH)~)' \
		-V'wxperl:Provides=wxperl-$(PERL_WX_VERSION)'

.PHONY: get_perl_wx_version