File: rules

package info (click to toggle)
therion 5.5.7ds1-2
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 14,304 kB
  • sloc: ansic: 115,206; cpp: 83,354; tcl: 19,464; perl: 1,993; makefile: 1,224; python: 220; asm: 219; sh: 39
file content (45 lines) | stat: -rwxr-xr-x 1,689 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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow future=+lfs
export DH_VERBOSE=1

POLFILE = "/etc/$(shell convert -version|sed -n '/^Version: /s@Version: ImageMagick \([[:digit:]]\+\)\..*@ImageMagick-\1@p')/policy.xml"

%:
	dh $@

override_dh_auto_build-indep:
	# just build the -doc package
ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
	# We need therion itself to build the samples
	$(MAKE) therion
	# create HTML documentation for samples
	mkdir -p debian/tmp/ImageMagick
	sed -e '/<policy domain="coder" rights="none" pattern="PDF" .>/s@"none"@"read|write"@' "$(POLFILE)" > debian/tmp/ImageMagick/policy.xml
	faketime "$(dpkg-parsechangelog -S Date)" $(MAKE) XDG_CONFIG_HOME="$(shell pwd)/debian/tmp" samples
	rm -Rf debian/tmp/ImageMagick
endif
	$(MAKE) thbook

override_dh_compress:
	dh_compress -X.pdf -X.th -X.th2 -Xthconfig

override_dh_auto_build-arch:
	# Compile the binaries
	$(MAKE) therion xtherion/xtherion loch/loch
	ln -sf loch.1 man/therion-viewer.7

override_dh_auto_install-indep:
	dh_auto_install -- PREFIX=/usr SYSCONFDIR=/etc

override_dh_auto_install-arch:
	# we need to clear out large generated files from samples before putting just source files in main package
	# .3d files in samples have timestamps - keep them reproducible
	$(MAKE) -C samples clean
	dh_auto_install -- PREFIX=/usr SYSCONFDIR=/etc
	rm debian/tmp/etc/*.new
	# upstream has cz locale when it should be cs
	(cd loch/locale && for lang in * ; do \
	  install -D -m 644 "$$lang/loch.mo" "$(CURDIR)/debian/therion-viewer/usr/share/locale/$$lang/LC_MESSAGES/loch.mo" ; \
	done)
	dh_installexamples -ptherion --exclude=.tcl --exclude=Makefile --exclude=thTMPDIR samples therion.ini