~dobey/ardour/packaging-dailies

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
#!/usr/bin/make -f
#
# ignore oddly packaged bzip2 archive to not upset dpkg
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^\./waf|\./debian/(changelog|copyright(|_hints|_newhints))$

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

# This is needed for shlibdeps to work properly
LD_LIBRARY_PATH += :$(DEB_DESTDIR)/usr/lib/${DEB_HOST_MULTIARCH}/ardour5

WAF = ./waf

DEB_WAF_EXTRA_ARGS = -v --destdir=$(CURDIR)/debian/tmp

# Waf defaults to -j4, but we may have more available
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	DEB_WAF_EXTRA_ARGS += -j $(NUMJOBS)
endif

%:
	dh $@ --parallel

# Put the upstream version into the revision.cc
ARDOUR_VERSION=`head -1 debian/changelog | awk -F'[()]' '{print $$2}'|cut -d~ -f1|cut -d: -f2`
generate_revision_cc: debian/revision.cc
	sed -e "s#\@ARDOUR_VERSION\@#${ARDOUR_VERSION}#g" < $< > libs/ardour/revision.cc

override_dh_auto_configure: generate_revision_cc
	${WAF} configure \
	--prefix=/usr/ \
	--libdir=/usr/lib/${DEB_HOST_MULTIARCH} \
	--with-backends=jack,alsa,dummy \
	--lv2 \
	--lxvst \
	--freedesktop \
	--configdir=/etc/ \
	--noconfirm \
	--no-phone-home \
	--test \
	--use-external-libs 

override_dh_auto_build: generate_revision_cc
	${WAF} build i18n_mo ${DEB_WAF_EXTRA_ARGS}

override_dh_auto_install: generate_revision_cc
	${WAF} install ${DEB_WAF_EXTRA_ARGS}
	for isize in 16x16 22x22 32x32 48x48 256x256 512x512; do \
		mkdir -p debian/tmp/usr/share/icons/hicolor/$$isize/apps; \
	done
	cp debian/tmp/usr/share/ardour?/resources/Ardour-icon_16px.png debian/tmp/usr/share/icons/hicolor/16x16/apps/ardour.png
	cp debian/tmp/usr/share/ardour?/resources/Ardour-icon_22px.png debian/tmp/usr/share/icons/hicolor/22x22/apps/ardour.png
	cp debian/tmp/usr/share/ardour?/resources/Ardour-icon_32px.png debian/tmp/usr/share/icons/hicolor/32x32/apps/ardour.png
	cp debian/tmp/usr/share/ardour?/resources/Ardour-icon_48px.png debian/tmp/usr/share/icons/hicolor/48x48/apps/ardour.png
	cp debian/tmp/usr/share/ardour?/resources/Ardour-icon_256px.png debian/tmp/usr/share/icons/hicolor/256x256/apps/ardour.png
	cp debian/tmp/usr/share/ardour?/resources/Ardour-icon_512px.png debian/tmp/usr/share/icons/hicolor/512x512/apps/ardour.png
	dh_auto_install

override_dh_auto_test:
	${WAF} test ${DEB_WAF_EXTRA_ARGS} || true