File: rules

package info (click to toggle)
glib2.0 2.50.3-2%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 87,412 kB
  • sloc: ansic: 437,992; xml: 16,239; sh: 5,797; python: 5,361; makefile: 3,748; perl: 1,425; cpp: 9
file content (160 lines) | stat: -rwxr-xr-x 5,182 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/usr/bin/make -f

DEB_BUILDDIR = debian/build
DEB_MAKE_FLAVORS = deb udeb
DISABLE_UPDATE_UPLOADERS := 1

include /usr/share/cdbs/1/rules/autoreconf.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/class/gnome.mk
include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

GNOME_MODULE := glib

# Enable parallel build support
DEB_BUILD_PARALLEL = 1

# Ensure the build aborts when there are still references to undefined symbols
LDFLAGS += -Wl,-z,defs

# NB: do NOT use -Wl,--as-needed to build glib; for instance the link to
# pthread is carefully crafted to allow dlopen()ing pthread-using libs; see
# http://mid.gmane.org/1257999019.21780.15.camel@marzipan
LDFLAGS += -Wl,--no-as-needed

# Make the linker work a bit harder so dynamic loading can be done faster
LDFLAGS += -Wl,-O1

APIVER := 2.0
SONAME := 0

# package names
SHARED_PKG := libglib$(APIVER)-$(SONAME)
DATA_PKG := libglib$(APIVER)-data
TEST_PKG := libglib$(APIVER)-tests
DEV_PKG := libglib$(APIVER)-dev
BIN_PKG := libglib$(APIVER)-bin
UDEB_PKG := libglib$(APIVER)-udeb
DOC_PKG := libglib$(APIVER)-doc
DEBUG_PKG := $(SHARED_PKG)-dbg

DEB_MAKE_DESTDIRSKEL = $(CURDIR)/debian/install/@FLAVOR@

DEB_CLEAN_EXCLUDE = org.gtk.test.gschema.xml.orig

DEB_DH_INSTALL_ARGS += --sourcedir=debian/install/deb
DEB_DH_INSTALL_ARGS_$(TEST_PKG) += --sourcedir=debian/install/deb -X.la
DEB_DH_INSTALL_ARGS_$(UDEB_PKG) += --sourcedir=debian/install/udeb

DEB_DH_MAKESHLIBS_ARGS_$(SHARED_PKG) += -V --add-udeb=$(UDEB_PKG) -- -c4
# Don't put the symbols in the -dbg package
DEB_DH_STRIP_ARGS_$(UDEB_PKG) =

# Don't strip translations from the installed tests; makes them environment dependent.
DEB_DH_TRANSLATIONS_ARGS = -Xinstalled-tests

# Do not clutter $HOME with ~/.dbus-keyrings and avoid failure on the buildds
# where creating /home/buildd/.dbus-keyrings fails
export HOME=$(CURDIR)/debian/build

# Put these back to their defaults if we are not running with a clean
# environment, so that they are based on the temporary $HOME above.
# Otherwise, some tests would try to write to the user's real XDG_DATA_HOME,
# causing unwanted side-effects or FTBFS depending whether the user's
# real HOME is available in the build chroot (if used)
unexport XDG_CACHE_HOME
unexport XDG_CONFIG_DIRS
unexport XDG_CONFIG_HOME
unexport XDG_DATA_HOME
unexport XDG_DATA_DIRS

# Make sure that everything that uses D-Bus is creating its own temporary
# session rather than polluting the developer's (or failing, on buildds)
export DBUS_SESSION_BUS_ADDRESS=this-should-not-be-used-and-will-fail:

ifeq ($(DEB_HOST_ARCH_OS), linux)
  DEB_MAKE_CHECK_TARGET = $(if $(filter deb, $(cdbs_make_curflavor)), -k check -j1)
else
  DEB_MAKE_CHECK_TARGET = $(if $(filter deb, $(cdbs_make_curflavor)), -k check -j1 || true)
endif

# The tests assume this directory exists and is writable
export XDG_RUNTIME_DIR=$(CURDIR)/debian/tmp-xdg-runtime-dir
# Let's get failing tests' stdout and stderr so we have some information when
# a build fails
export VERBOSE=1

# configure flags
DEB_CONFIGURE_EXTRA_FLAGS := \
			--with-html-dir=\$${prefix}/share/doc/$(DOC_PKG) \
			--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
			--with-python=/usr/bin/python3 \
			--with-pcre=system

ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
  DEB_CONFIGURE_EXTRA_FLAGS += \
			--disable-modular-tests \
			--disable-gtk-doc
endif

DEB_CONFIGURE_FLAGS_deb := \
			--enable-gtk-doc \
			--enable-static \
			--enable-installed-tests \
			--enable-always-build-tests \
			--enable-debug=minimum

# libmount is available on linux only
ifeq ($(DEB_HOST_ARCH_OS), linux)
  DEB_CONFIGURE_FLAGS_deb += \
			--enable-libmount
else
  DEB_CONFIGURE_FLAGS_deb += \
			--disable-libmount
endif


DEB_CONFIGURE_FLAGS_udeb := \
			--disable-selinux \
			--disable-libmount

pre-build::
	mkdir -p debian/stamp-makefile-check \
		 debian/tmp-xdg-runtime-dir

binary-install/libglib2.0-0::
	set -e; for script in postinst postrm triggers; do \
		sed -e"s/#MULTIARCH#/$(DEB_HOST_MULTIARCH)/g" \
		    -e"s/#ARCH#/$(DEB_HOST_ARCH)/g" \
		    debian/$(cdbs_curpkg).$$script.in \
		    > debian/$(cdbs_curpkg).$$script ; \
	done

binary-install/libglib2.0-dev::
	dh_python3 -plibglib2.0-dev /usr/share/glib-2.0/codegen

clean::
	sed \
		-e "s#@SONAME@#$(SONAME)#g" \
		-e "s#@APIVER@#$(APIVER)#g" \
		-e "s#@VERSION@#$(DEB_UPSTREAM_VERSION)#g" \
		-e "s#@SHARED_PKG@#$(SHARED_PKG)#g" \
		-e "s#@BIN_PKG@#$(BIN_PKG)#g" \
		-e "s#@DATA_PKG@#$(DATA_PKG)#g" \
		-e "s#@DEV_PKG@#$(DEV_PKG)#g" \
		-e "s#@UDEB_PKG@#$(UDEB_PKG)#g" \
		-e "s#@DOC_PKG@#$(DOC_PKG)#g" \
		-e "s#@DEBUG_PKG@#$(DEBUG_PKG)#g" \
		-e "s#@GNOME_TEAM@#$(UPLOADERS)#g" \
		debian/control.in > debian/control
	rm -rf $(CURDIR)/debian/build \
	       $(CURDIR)/debian/install \
	       $(CURDIR)/debian/stamp-makefile-check \
	       $(CURDIR)/debian/tmp-xdg-runtime-dir

list-missing:
	# FIXME: remove this when CDBS' list-missing works with multiple flavors
	perl -w debian/dh_listmissing.pl $(foreach f,$(DEB_MAKE_FLAVORS),debian/install/$(f)) 2>&1 | \
	    egrep -v '(\.la|\.pyc|\.pyo) has been installed' >&2