File: rules

package info (click to toggle)
puredata 0.55.2%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 20,508 kB
  • sloc: ansic: 118,824; tcl: 10,221; cpp: 9,327; makefile: 1,632; sh: 1,476; python: 152; xml: 98; awk: 13
file content (115 lines) | stat: -rwxr-xr-x 3,598 bytes parent folder | download | duplicates (3)
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/usr/bin/make -f
# -*- makefile -*-
DH_VERBOSE=1

## use hardening some flags
DPKG_EXPORT_BUILDFLAGS = 1
# if you change values below, you might also need to fix d/salsa-ci.yml
DEB_BUILD_MAINT_OPTIONS=hardening=+format,-fortify,+stackprotector,+relro
export DEB_BUILD_MAINT_OPTIONS

include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/pkg-info.mk

FLAVORS=pd32 pd64
builddir=debian/build/flavor-

deken_cpu = $(shell debian/dekencpu ${DEB_HOST_ARCH})

export DEB_CPPFLAGS_MAINT_APPEND=

CONFIG :=
CONFIG_pd32 :=
CONFIG_pd64 :=

ifeq ($(DEB_HOST_ARCH_OS),linux)
  CONFIG += --enable-alsa
else
  CONFIG += --disable-alsa
endif
CONFIG += --enable-jack
CONFIG += --without-local-portaudio --without-local-portmidi
CONFIG += --libdir=/usr/lib/

CONFIG_pd32 += --program-transform-name='s/pd$$/puredata/'
CONFIG_pd32 += --enable-libpd --enable-libpd-utils
CONFIG_pd64 += --program-transform-name='s/pd$$/puredata64/' --with-floatsize=64 --with-deken-cpu=$(deken_cpu) --with-external-extension=linux-$(deken_cpu)-64.so

ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
  DEB_CPPFLAGS_MAINT_APPEND+=-D__BSD_VISIBLE
endif

## set timestamp for reproducible builds
DATE_FMT = %Y/%m/%d at %H:%M:%S UTC
ifdef SOURCE_DATE_EPOCH
    BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u "+$(DATE_FMT)")
else
    BUILD_DATE ?= $(shell date "+$(DATE_FMT)")
endif
export BUILD_DATE
export DEB_VERSION

%:
	dh $@

execute_before_dh_clean:
	test ! -d po.bak || rm -rf po
	test ! -d po.bak || mv po.bak po

execute_before_dh_autoreconf:
	mkdir -p m4/generated
	cp -r po po.bak

override_dh_auto_configure: $(patsubst %,configure_%,$(FLAVORS))
configure_%:
	dh_auto_configure --builddir $(builddir)$* -- $(strip $(CONFIG) $(CONFIG_$*))

override_dh_auto_build-arch: $(patsubst %,build_%,$(FLAVORS))
build_%:
	dh_auto_build -a --builddir $(builddir)$*

execute_after_dh_auto_build-indep: debian/gui-plugins/pd-gui-plugin.1

override_dh_auto_install: $(patsubst %,install_%,$(FLAVORS))
install_%:
	dh_auto_install --builddir $(builddir)$*

override_dh_install:
	find debian/tmp -type f -name "pd.pc" -exec \
		sed -e 's|^Libs: .*|Libs:|' -e 's| -fPIC||' -i {} +
	dh_install -X "*.la" -X "LICENSE.txt" -X "Makefile.am"
	rm -rf debian/puredata-doc/usr/share/puredata/doc/1.manual/1.introduction.txt
	rm -rf debian/puredata-doc/usr/share/puredata/doc/5.reference
	rm -rf debian/puredata-doc/usr/share/puredata/doc/7.stuff

override_dh_installchangelogs:
	dh_installchangelogs src/CHANGELOG.txt

execute_after_dh_fixperms:
ifneq (,$(findstring puredata-extra, $(shell dh_listpackages)))
	find debian/puredata*extra/ -type f -name "*.pd_linux" -exec \
		chmod 0644 {} +
endif
ifneq (,$(findstring puredata-gui, $(shell dh_listpackages)))
	find debian/puredata-gui/ -type f -name "pkg_mkIndex.tcl" -exec \
		chmod 0755 {} +
endif

override_dh_compress:
	dh_compress -X.pd -X.wav -X.aiff -X.txt

debian/gui-plugins/pd-gui-plugin.1: debian/gui-plugins/pd-gui-plugin
	-help2man -N -n "enable or disable a Pd GUI plugin" -o $@ $<

DEB_COPYRIGHT_CHECK_IGNORE_REGEX = \
        debian/.*|.*\.wav|.*\.aiff|.*\.png|.*\.jpg|.*\.ico|.*\.icns|.*\.gif|.*\.ttf|.*\.strings|.*\.zip|.*\.tgz
# licensecheck v1
.PHONY: licensecheck
licensecheck:
	LANG=C.UTF-8 licensecheck \
		-i "^($(DEB_COPYRIGHT_CHECK_IGNORE_REGEX))$$" \
		--check '.*' --recursive --deb-machine --lines 0 * \
		> debian/copyright_newhints
	cmp debian/copyright_hints debian/copyright_newhints \
		&& rm debian/copyright_newhints