File: rules

package info (click to toggle)
libxml-parser-perl 2.46-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,216 kB
  • sloc: xml: 3,937; perl: 1,955; makefile: 36; ansic: 27
file content (54 lines) | stat: -rwxr-xr-x 1,739 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

PKG:=$(shell dh_listpackages)
TMP:=$(CURDIR)/debian/$(PKG)
EG:=$(TMP)/usr/share/doc/$(PKG)/examples
XE_FILES:=$(wildcard /usr/share/libxml-encoding-perl/*.xml)
ENC_FILES:=$(wildcard debian/encodings/*.enc)

ARCHLIB := $(shell perl -MConfig -e 'print $$Config{vendorarch}')

ENC_DOC_FILES:=$(wildcard debian/$(PKG)/$(ARCHLIB)/XML/Parser/Encodings/*.msg) \
								debian/$(PKG)/$(ARCHLIB)/XML/Parser/Encodings/README

%:
	dh $@

# we want to use the system version of included modules, so
# we move the inc away and move it back afterwards
override_dh_auto_clean:
	dh_auto_clean
	[ ! -d $(CURDIR)/inc.save ] || mv $(CURDIR)/inc.save $(CURDIR)/inc

override_dh_auto_configure:
	[ ! -d $(CURDIR)/inc ] || mv $(CURDIR)/inc $(CURDIR)/inc.save
	dh_auto_configure

override_dh_installexamples:
	dh_installexamples
	sed -i -e'1s|/usr/local/bin/perl|/usr/bin/perl|' $(EG)/canonical $(EG)/xmlcomments $(EG)/xmlstats $(EG)/xmlfilter

# install Encodings/README and Encodings/*.msg as documentation
override_dh_install:
	dh_install
	mkdir -p debian/$(PKG)/usr/share/doc/$(PKG)/Encodings
	$(foreach f,$(ENC_DOC_FILES),mv $(f) debian/$(PKG)/usr/share/doc/$(PKG)/Encodings/;)


override_dh_compress:
	dh_compress -Xxmlfiltera

override_dh_auto_build:
	dh_auto_build
	$(foreach f,$(ENC_FILES),rm -f blib/lib/XML/Parser/Encodings/$(basename $(notdir $(f))).enc;)
	$(foreach f,$(ENC_FILES),cp $f blib/lib/XML/Parser/Encodings/;)

make_encodings: /usr/share/libxml-encoding-perl
	rm -rf debian/encodings/*
	$(foreach f,$(XE_FILES),compile_encoding -o debian/encodings/$(basename $(notdir $(f))).enc $f;)

/usr/share/libxml-encoding-perl:
	@echo Please install libxml-encoding-perl
	exit 1