File: rules

package info (click to toggle)
gnucash-docs 5.10-0.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 164,316 kB
  • sloc: xml: 101,090; ruby: 229; makefile: 58; sh: 8
file content (82 lines) | stat: -rwxr-xr-x 3,636 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

## "--nonet": Disable build-time network access #831019:
export XSLTPROCFLAGS=--nonet

## https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=584472
export JAVA_CLASSPATH=/usr/share/java/fontbox2.jar

BDIR=build

%:
	dh $@ --buildsystem=cmake --builddirectory=$(BDIR)

## TODO: use "fonts-horai-umefont".
fonts/gothic.xml:
	fop-ttfreader /usr/share/fonts/truetype/horai-umefont/ume-tgo4.ttf $@

fonts/mincho.xml:
	fop-ttfreader /usr/share/fonts/truetype/horai-umefont/ume-tmo3.ttf $@

override_dh_clean:
	dh_clean
	$(RM) -rfv fonts/opentype/freefont
	$(RM) -fv  fonts/truetype/ume*.ttf

override_dh_auto_configure:
	dh_auto_configure -- -Wdev \
               -DCMAKE_VERBOSE_MAKEFILE=ON  \
               -DCMAKE_BUILD_TYPE=Release   \
               -DWITH_PDF=ON                \
               -DWITH_XDGHELP=ON            \
        ;

override_dh_auto_build:
	mkdir -pv fonts/truetype
	ln -sfv /usr/share/fonts/truetype/horai-umefont/ume-tgo4.ttf    fonts/truetype/    # fonts-horai-umefont
	ln -sfv /usr/share/fonts/truetype/horai-umefont/ume-tmo3.ttf    fonts/truetype/    # fonts-horai-umefont
	mkdir -pv fonts/opentype
	ln -sv  /usr/share/fonts/opentype/freefont                      fonts/opentype/    # fonts-freefont-otf
	ln -sfv /usr/share/fonts/truetype/arphic/ukai.ttc               fonts/truetype/Arphic/ukai.ttc    # fonts-arphic-ukai
#	dh_auto_build
	$(MAKE) -C $(BDIR) pdf html xdghelp

override_dh_auto_clean:
	dh_auto_clean
	for lg in C it de pt; do \
		rm -rf help/$${lg}/gnucash-help guide/$${lg}/gnucash-guide; \
	done

override_dh_auto_install:
	dh_auto_install --destdir=$(CURDIR)/debian/tmp

override_dh_installdocs:
	dh_installdocs
	set -e; \
	for suffix in "/" ".pdf"; do \
		for type in manual; do \
			cp -a $(BDIR)/share/doc/C/gnucash-$${type}$${suffix} debian/gnucash-docs/usr/share/doc/gnucash-docs/gnucash-$${type}-en$${suffix}; \
			cp -a $(BDIR)/share/doc/it/gnucash-$${type}$${suffix} debian/gnucash-docs/usr/share/doc/gnucash-docs/gnucash-$${type}-it$${suffix}; \
			cp -a $(BDIR)/share/doc/de/gnucash-$${type}$${suffix} debian/gnucash-docs/usr/share/doc/gnucash-docs/gnucash-$${type}-de$${suffix}; \
			cp -a $(BDIR)/share/doc/pt/gnucash-$${type}$${suffix} debian/gnucash-docs/usr/share/doc/gnucash-docs/gnucash-$${type}-pt$${suffix}; \
		done; \
		for type in guide; do \
			 cp -a $(BDIR)/share/doc/C/gnucash-$${type}$${suffix} debian/gnucash-docs/usr/share/doc/gnucash-docs/gnucash-$${type}-en$${suffix}; \
			 cp -a $(BDIR)/share/doc/ja/gnucash-$${type}$${suffix} debian/gnucash-docs/usr/share/doc/gnucash-docs/gnucash-$${type}-ja$${suffix}; \
			 cp -a $(BDIR)/share/doc/it/gnucash-$${type}$${suffix} debian/gnucash-docs/usr/share/doc/gnucash-docs/gnucash-$${type}-it$${suffix}; \
			 cp -a $(BDIR)/share/doc/de/gnucash-$${type}$${suffix} debian/gnucash-docs/usr/share/doc/gnucash-docs/gnucash-$${type}-de$${suffix}; \
			 cp -a $(BDIR)/share/doc/pt/gnucash-$${type}$${suffix} debian/gnucash-docs/usr/share/doc/gnucash-docs/gnucash-$${type}-pt$${suffix}; \
		done; \
	done
	# Replace duplicate files with symlinks, to save space.
	# And make sure that files from /usr/share/doc are not taken as original copy.
	rdfind -outputname /dev/null -makesymlinks true debian/gnucash-docs/usr/share/gnome/ \
		debian/gnucash-docs/usr/share/doc/
	# Fix those symlinks to make them relative
	symlinks -r -s -c debian/gnucash-docs/

override_dh_gencontrol:
	dh_gencontrol -- -Vmy:Built-Using="$(foreach pkg,fonts-horai-umefont fonts-freefont-otf,$(shell dpkg-query --show -f '$${source:Package} (=$${Version})' $(pkg)),)"