File: rules

package info (click to toggle)
freefilesync 13.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,044 kB
  • sloc: cpp: 66,712; ansic: 447; makefile: 216
file content (72 lines) | stat: -rwxr-xr-x 3,132 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
69
70
71
72
#!/usr/bin/make -f
# You must remove unused comment lines for the released package.
export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

include /usr/share/dpkg/architecture.mk

include /usr/share/dpkg/buildtools.mk

# Produce .debug_info (used by dh_dwz)
CXXFLAGS += -g

# Enable PIE
#CXXFLAGS += -fpie
#LDFLAGS += -pie

# define APP_NAME_SUFFIX
DPKG_VENDOR = $(shell dpkg-vendor --query vendor)
CPPFLAGS += -DAPP_NAME_SUFFIX='L" for ${DPKG_VENDOR}"'

# It is sometimes required to build with a specific version of g++ because
# upstream sometimes used features that are available only in recent versions.
# This is therefore also required to build backports
# CXX := $(CXX)-12

# Check if we need to link to libatomic
# Used to be required on mipsel, sh4, armhf/raspbian
# but also on Ubuntu 20.04 (focal)
IS_ATOMIC_LINKING_REQUIRED = $(shell $(CXX) -std=c++2b -o /dev/null debian/material/libatomic_check.cpp > /dev/null 2>&1 || echo "yes")
ifeq ($(IS_ATOMIC_LINKING_REQUIRED),yes)
$(warning linking to libatomic is required)
LDFLAGS += -latomic
endif

%:
	dh $@ --sourcedirectory=FreeFileSync/Source

execute_after_dh_auto_clean:
	# Now, auto_clean RealTimeSync
	dh_auto_clean --sourcedirectory=FreeFileSync/Source/RealTimeSync

override_dh_auto_build:
	dh_auto_build --sourcedirectory=FreeFileSync/Source -- CXX=$(CXX)

execute_after_dh_auto_build:
	# Now, auto_build RealTimeSync
	dh_auto_build --sourcedirectory=FreeFileSync/Source/RealTimeSync -- CXX=$(CXX)

override_dh_auto_install:
	# desktop files
	# handled by dh_install through debian/install

	# mimetypes
	# handled by dh_installmime through debian/sharedmimeinfo

	# icons
	unzip -u FreeFileSync/Build/Resources/Icons.zip cfg_batch.png database.png start_sync.png FreeFileSync.png RealTimeSync.png
	for size in 16 24 32 48 64 128 256; do \
	  mkdir -p debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/apps ; \
	  convert FreeFileSync.png -filter Lanczos -resize $${size}x$${size} debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/apps/FreeFileSync.png ; \
	  convert RealTimeSync.png -filter Lanczos -resize $${size}x$${size} debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/apps/RealTimeSync.png ; \
	  mkdir -p debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/mimetypes ; \
	  convert cfg_batch.png -filter Lanczos -resize $${size}x$${size} debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/mimetypes/application-x-freefilesync-batch.png ; \
	  convert database.png -filter Lanczos -resize $${size}x$${size} debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/mimetypes/application-x-freefilesync-db.png ; \
	  convert start_sync.png -filter Lanczos -resize $${size}x$${size} debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/mimetypes/application-x-freefilesync-gui.png ; \
	  convert RealTimeSync.png -filter Lanczos -resize $${size}x$${size} debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/mimetypes/application-x-freefilesync-real.png ; \
	done