File: rules

package info (click to toggle)
kbibtex 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 18,832 kB
  • sloc: cpp: 33,301; xml: 316; sh: 147; makefile: 39
file content (58 lines) | stat: -rwxr-xr-x 2,083 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
#!/usr/bin/make -f

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

export QT_SELECT:=5

export STATIC_DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_HOST_GNU_TYPE  ?= $(STATIC_DEB_HOST_GNU_TYPE)
export STATIC_DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export DEB_HOST_MULTIARCH ?= $(STATIC_DEB_HOST_MULTIARCH)
export STATIC_DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(STATIC_DEB_BUILD_GNU_TYPE)

DPKG_EXPORT_BUILDFLAGS=1
include /usr/share/dpkg/buildflags.mk
export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed

# icons
ICONSSIZE ?= 8x8 16x16 22x22 24x24 32x32 36x36 42x42 48x48 64x64 72x72 96x96 128x128 192x192 256x256
CONVERT_FLAGS ?= -background none -define filter:blur=0.75 -filter Gaussian
CONVERT ?= convert

# one ring to rule them all ...
%:
	dh $@

# pass as-needed and security flags
override_dh_auto_configure:
	dh_auto_configure -- -DCMAKE_C_FLAGS="$(CFLAGS)" -DCMAKE_CXX_FLAGS="$(CFLAGS)" \
		-DCMAKE_SHARED_LINKER_FLAGS="$(LDFLAGS)" \
		-DCMAKE_MODULE_LINKER_FLAGS="$(LDFLAGS)" \
		-DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS)"

override_dh_auto_install:
	dh_auto_install
	# remove .so symlink to private lib
	rm -f $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.so
	# rebuild icons
	rm -rf debian/tmp/usr/share/icons
	# build icons cache (build for each arch in order to get more testing)
	set -e; for SIZE in $(ICONSSIZE); do \
		mkdir -p debian/tmp/usr/share/icons/hicolor/$$SIZE/apps/ ;\
		echo "Make icons for size $$SIZE..."; \
		$(CONVERT) icons/kbibtex.svg \
			   $(CONVERT_FLAGS) -resize $$SIZE \
			   -gravity center -extent $$SIZE  \
			   +set date:create +set date:modify -define png:exclude-chunk=time  \
			   debian/tmp/usr/share/icons/hicolor/$$SIZE/apps/kbibtex.png; \
		echo "Done"; \
	done
	# do not forget svgz
	mkdir -p debian/tmp/usr/share/icons/hicolor/scalable/apps/
	gzip -c -n -9 icons/kbibtex.svg \
		> debian/tmp/usr/share/icons/hicolor/scalable/apps/kbibtex.svgz

# not yet due to fail
override_dh_auto_test: