File: rules

package info (click to toggle)
ponyprog 3.1.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 4,420 kB
  • sloc: cpp: 35,325; python: 981; sh: 565; makefile: 41; ansic: 38
file content (68 lines) | stat: -rwxr-xr-x 2,436 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
# -*- makefile -*-

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

export DEB_HOST_ARCH_OS   ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CFLAGS+=$(CPPFLAGS)
CXXFLAGS+=$(CPPFLAGS)

ICON_SIZES=128x128 64x64 48x48 32x32 24x24 16x16

# detect the encoding of the file ponyprog.html
HTML_FILE_ENCODING = $(shell file -b --mime-encoding distribution/innosetup/ponyprog.html)
# out of tree build folder for application
DEB_BUILD_DIR=debian/build
# default install folder
INSTDIR=$(CURDIR)/debian/tmp

DEB_PONYPROG_CMAKE_OPTS := \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_SHARED_LINKER_FLAGS_RELEASE="$(LDFLAGS)" \
	-DUSE_DEBUGGER=ON \
	-DUSE_QT5=ON \
	$(NULL)

%:
	dh $@

override_dh_auto_clean:
	dh_clean
	rm -f SrcPony/version.h
	rm -rf debian/build

override_dh_auto_configure:
	mkdir -p $(DEB_BUILD_DIR)
	####################################
	# configuring PonyProg application #
	####################################
	dh_auto_configure --sourcedirectory=$(CURDIR) --builddirectory=$(DEB_BUILD_DIR) -- $(DEB_PONYPROG_CMAKE_OPTS)
	# convert ponyprog.html to utf-8 if needed
	if [ "$(HTML_FILE_ENCODING)" != "utf-8" ]; then \
		mv ./distribution/innosetup/ponyprog.html ./distribution/innosetup/ponyprog.html.in ;\
		iconv -f $(HTML_FILE_ENCODING) -t utf8 ./distribution/innosetup/ponyprog.html.in > ./distribution/innosetup/ponyprog.html ;\
	fi

override_dh_auto_build:
	dh_auto_build --sourcedirectory=$(CURDIR) --builddirectory=$(DEB_BUILD_DIR)

override_dh_auto_install:
	###################################
	# installing PonyProg application #
	###################################
	dh_auto_install --destdir=$(INSTDIR) --sourcedirectory=$(CURDIR) --builddirectory=$(DEB_BUILD_DIR)
	# remove the shipped icon and create the needed graphic by ourself
	rm -f $(INSTDIR)/usr/share/icons/ponyprog.png
	for size in ${ICON_SIZES}; do \
		mkdir -p $(INSTDIR)/usr/share/icons/hicolor/"$${size}"; \
		convert +antialias -background transparent -resize "$${size}!" $(CURDIR)/icons/ponyprog.svg $(INSTDIR)/usr/share/icons/hicolor/"$${size}"/ponyprog.png; \
	done