File: rules

package info (click to toggle)
libdbusmenu 18.10.20180917~bzr492%2Brepack1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 15,288 kB
  • sloc: ansic: 11,181; makefile: 955; xml: 464; python: 202; sh: 20
file content (133 lines) | stat: -rwxr-xr-x 5,696 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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

FLAVORS = gtk2 gtk3

CONFIGURE_FLAGS_gtk2 = --with-gtk=2
CONFIGURE_FLAGS_gtk3 = --with-gtk=3

CONFIGURE_COMMON_FLAGS += --disable-scrollkeeper --enable-gtk-doc --enable-introspection  --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)

INSTALL_COMMON_FLAGS =
MISSING_COMMON_FLAGS = --fail-missing

LDFLAGS += -Wl,-z,defs -Wl,--as-needed

%:
	dh $@ --with autoreconf,gir

override_dh_autoreconf:
	NOCONFIGURE=1 dh_autoreconf ./autogen.sh

override_dh_auto_configure: $(FLAVORS:%=doconfigure-%)

doconfigure-%:
	DH_VERBOSE=1 dh_auto_configure --builddirectory=builddir/$* -- $(CONFIGURE_FLAGS_$*) $(CONFIGURE_COMMON_FLAGS)

override_dh_auto_build: $(FLAVORS:%=dobuild-%)

dobuild-%:
	dh_auto_build --builddirectory=builddir/$*

override_dh_auto_install: $(FLAVORS:%=doinstall-%)

doinstall-%:
	dh_auto_install --no-parallel --builddirectory=builddir/$* --destdir=debian/tmp/$*

override_dh_auto_test: $(FLAVORS:%=dotest-%)

override_dh_auto_clean:
	dh_auto_clean
	rm -Rvf builddir/

dotest-%:
ifeq ($(DEB_HOST_ARCH),ppc64el)
	: # ignore the test results on $(DEB_HOST_ARCH)
	-VERBOSE=1 xvfb-run -a dh_auto_test --builddirectory=builddir/$*
else
	VERBOSE=1 xvfb-run -a dh_auto_test --builddirectory=builddir/$*
endif

override_dh_missing:
	dh_missing $(MISSING_COMMON_FLAGS) -plibdbusmenu-gtk4 --sourcedir=debian/tmp/gtk2
	dh_missing $(MISSING_COMMON_FLAGS) -plibdbusmenu-gtk-dev --sourcedir=debian/tmp/gtk2
	dh_missing $(MISSING_COMMON_FLAGS) -plibdbusmenu-gtk-doc --sourcedir=debian/tmp/gtk2
	dh_missing $(MISSING_COMMON_FLAGS) -pgir1.2-dbusmenu-gtk-0.4 --sourcedir=debian/tmp/gtk2
	dh_missing $(MISSING_COMMON_FLAGS) -pgir1.2-dbusmenu-glib-0.4 --sourcedir=debian/tmp/gtk3
	dh_missing $(MISSING_COMMON_FLAGS) -pgir1.2-dbusmenu-gtk3-0.4 --sourcedir=debian/tmp/gtk3
	dh_missing $(MISSING_COMMON_FLAGS) -plibdbusmenu-glib4 --sourcedir=debian/tmp/gtk3
	dh_missing $(MISSING_COMMON_FLAGS) -plibdbusmenu-glib-dev --sourcedir=debian/tmp/gtk3
	dh_missing $(MISSING_COMMON_FLAGS) -plibdbusmenu-glib-doc --sourcedir=debian/tmp/gtk3
	dh_missing $(MISSING_COMMON_FLAGS) -plibdbusmenu-gtk3-4 --sourcedir=debian/tmp/gtk3
	dh_missing $(MISSING_COMMON_FLAGS) -plibdbusmenu-gtk3-dev --sourcedir=debian/tmp/gtk3
	dh_missing $(MISSING_COMMON_FLAGS) -plibdbusmenu-jsonloader4 --sourcedir=debian/tmp/gtk3
	dh_missing $(MISSING_COMMON_FLAGS) -plibdbusmenu-jsonloader-dev --sourcedir=debian/tmp/gtk3
	dh_missing $(MISSING_COMMON_FLAGS) -plibdbusmenu-tools --sourcedir=debian/tmp/gtk3

override_dh_install:
	find debian/tmp -name \*.la -delete
	# Remove gtk2 copies of dbusmenu-tools (we use the gtk3 build)
	rm -f debian/tmp/gtk2/usr/lib/x86_64-linux-gnu/dbusmenu-testapp
	rm -f debian/tmp/gtk2/usr/lib/x86_64-linux-gnu/dbusmenu-dumper
	rm -f debian/tmp/gtk2/usr/lib/x86_64-linux-gnu/dbusmenu-bench
	dh_install $(INSTALL_COMMON_FLAGS) -plibdbusmenu-gtk4 --sourcedir=debian/tmp/gtk2
	dh_install $(INSTALL_COMMON_FLAGS) -plibdbusmenu-gtk-dev --sourcedir=debian/tmp/gtk2
	dh_install $(INSTALL_COMMON_FLAGS) -plibdbusmenu-gtk-doc --sourcedir=debian/tmp/gtk2
	dh_install $(INSTALL_COMMON_FLAGS) -pgir1.2-dbusmenu-gtk-0.4 --sourcedir=debian/tmp/gtk2
	dh_install $(INSTALL_COMMON_FLAGS) -pgir1.2-dbusmenu-glib-0.4 --sourcedir=debian/tmp/gtk3
	dh_install $(INSTALL_COMMON_FLAGS) -pgir1.2-dbusmenu-gtk3-0.4 --sourcedir=debian/tmp/gtk3
	dh_install $(INSTALL_COMMON_FLAGS) -plibdbusmenu-glib4 --sourcedir=debian/tmp/gtk3
	dh_install $(INSTALL_COMMON_FLAGS) -plibdbusmenu-glib-dev --sourcedir=debian/tmp/gtk3
	dh_install $(INSTALL_COMMON_FLAGS) -plibdbusmenu-glib-doc --sourcedir=debian/tmp/gtk3
	dh_install $(INSTALL_COMMON_FLAGS) -plibdbusmenu-gtk3-4 --sourcedir=debian/tmp/gtk3
	dh_install $(INSTALL_COMMON_FLAGS) -plibdbusmenu-gtk3-dev --sourcedir=debian/tmp/gtk3
	dh_install $(INSTALL_COMMON_FLAGS) -plibdbusmenu-jsonloader4 --sourcedir=debian/tmp/gtk3
	dh_install $(INSTALL_COMMON_FLAGS) -plibdbusmenu-jsonloader-dev --sourcedir=debian/tmp/gtk3
	dh_install $(INSTALL_COMMON_FLAGS) -plibdbusmenu-tools --sourcedir=debian/tmp/gtk3

override_dh_shlibdeps:
	dh_shlibdeps -plibdbusmenu-gtk4 -- -xlibgtk2.0-0
	dh_shlibdeps -plibdbusmenu-gtk3-4 -- -xlibgtk-3-0
	dh_shlibdeps -plibdbusmenu-glib4
	dh_shlibdeps -plibdbusmenu-jsonloader4
	dh_shlibdeps -plibdbusmenu-tools

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

NULL  =
PKD   = $(word 2, abspath $(dir $(MAKEFILE_LIST)))
PKG   = $(DEB_SOURCE)
UVER  = $(shell echo $(DEB_VERSION) | cut -d "-" -f1)
DTYPE = +repack1
VER  ?= $(subst $(DTYPE),,$(UVER))
REV   = $(shell echo $(VER) | perl -ne 'print "$$1" if m/(?:git|svn|hg|bzr)(\d+)/;')

#get-orig-source:
#	uscan --noconf --force-download --rename --download-current-version --destdir=..

## http://wiki.debian.org/onlyjob/get-orig-source
.PHONY: get-orig-source
get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz $(info I: $(PKG)_$(VER)$(DTYPE))
	@

## checkout from bzr (add "bzr (>= 2.6.0~bzr6520)" to Build-Depends, see #666496)
UURL = lp:libdbusmenu
$(PKG)_$(VER)$(DTYPE).orig.tar.xz:
	$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
	bzr checkout --hardlink --lightweight --revision=$(REV) $(UURL) $(PKG)-$(VER) \
	    || $(RM) -r $(PKG)-$(VER)
	@echo "# Creating ChangeLog..."
	cd $(PKG)-$(VER) && bzr log --log-format=line > ChangeLog.bzr
	@echo "# Modifying..."
	cd $(PKG)-$(VER) && rm -Rfv \
	    .bzr-builddeb \
	    .bzr \
	    debian/ \
	    $(NULL)
	@echo "# Packing..."
	find -L "$(PKG)-$(VER)" -xdev -type f -print | sort \
	    | XZ_OPT="-6v" tar -caf "../$(PKG)_$(VER)$(DTYPE).orig.tar.xz" -T- --owner=root --group=root --mode=a+rX \
	    && $(RM) -r "$(PKG)-$(VER)"