~kees/vte/alt-screen-scrolling-fix_bug-106995

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
161
#!/usr/bin/make -f

libvteN := $(shell sed -rn 's/Package:[[:space:]]*(libvte[0-9]+)[[:space:]]*$$/\1/p' debian/control | head -n 1)
udeb := $(libvteN)-udeb

buildbasedir := $(CURDIR)/debian/build
DEB_BUILDDIR := $(buildbasedir)/main
DEB_BUILDDIR_$(udeb) := $(buildbasedir)/udeb

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/simple-patchsys.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

PY_VERSIONS = $(shell pyversions --requested debian/control)

DEB_CONFIGURE_LIBEXECDIR := \$${prefix}/lib/$(libvteN)
DEB_FIXPERMS_EXCLUDE := gnome-pty-helper
DEB_DBG_PACKAGE_python-vte = python-vte-dbg
.PRECIOUS: configure-stamp-% dbg-configure-stamp-%
DEB_DH_MAKESHLIBS_ARGS_ALL = -V '$(libvteN) (>= 1:0.16.9)' --add-udeb=$(udeb)

udeb_configure_flags := --disable-python \
			--disable-gnome-pty-helper \
			--disable-gtk-doc \
			--without-x \
			--without-xft2 \
			--with-pangox \
			--without-glX

DEB_DESTDIR := $(CURDIR)/debian/tmp/main
DEB_DESTDIR_$(udeb) := $(CURDIR)/debian/tmp/udeb

DEB_DH_INSTALL_ARGS = --sourcedir=$(if $(findstring $(udeb),$(cdbs_curpkg)),$(DEB_DESTDIR_$(udeb)),$(DEB_DESTDIR))

######
# udeb rules
configure/$(udeb):: $(DEB_BUILDDIR_$(udeb))/config.status
$(DEB_BUILDDIR_$(udeb))/config.status:
	# paint me ugly: Gtk 2.8 mixes the pkg-config files from both builds
	# (x11/shared and directfb), so the gtk+2.0.pc from the directfb can't
	# be used; we cheat and create a fake one higher in the PKG_CONFIG_PATH
	# which is a symlink to the gtk+-directfb-2.0.pc
	mkdir -p $(DEB_BUILDDIR_$(udeb))/pkg-config
	cd $(DEB_BUILDDIR_$(udeb))/pkg-config && \
		ln -sf /usr/lib/pkgconfig/gtk+-directfb-2.0.pc gtk+-2.0.pc
	cd $(DEB_BUILDDIR_$(udeb)) && \
		PKG_CONFIG_PATH=pkg-config \
		$(DEB_CONFIGURE_SCRIPT_ENV) \
			$(DEB_CONFIGURE_SCRIPT) \
				$(DEB_CONFIGURE_NORMAL_ARGS) \
				$(cdbs_configure_flags) \
				$(DEB_CONFIGURE_EXTRA_FLAGS) \
				$(DEB_CONFIGURE_USER_FLAGS)

build/$(udeb)::
	make -C $(DEB_BUILDDIR_$(udeb))

install/$(udeb)::
	make -C $(DEB_BUILDDIR_$(udeb)) install DESTDIR=$(DEB_DESTDIR_$(udeb))


######
# Python rules
configure-stamp-%:
	mkdir $(buildbasedir)/$*
	cd $(buildbasedir)/$* && PYTHON=`which $*` $(DEB_CONFIGURE_SCRIPT_ENV) \
	    $(DEB_CONFIGURE_SCRIPT) \
		$(DEB_CONFIGURE_NORMAL_ARGS) \
		--disable-maintainer-mode \
		$(cdbs_configure_flags) \
		$(DEB_CONFIGURE_EXTRA_FLAGS) \
		$(DEB_CONFIGURE_USER_FLAGS)
	touch $@

dbg-configure-stamp-%:
	mkdir $(buildbasedir)/dbg-build-$*
	cd $(buildbasedir)/dbg-build-$* && PYTHON=`which $*-dbg` $(subst -O2,-O0,$(DEB_CONFIGURE_SCRIPT_ENV)) \
	    $(DEB_CONFIGURE_SCRIPT) \
		$(DEB_CONFIGURE_NORMAL_ARGS) \
		--disable-maintainer-mode \
		$(cdbs_configure_flags) \
		$(DEB_CONFIGURE_EXTRA_FLAGS) \
		$(DEB_CONFIGURE_USER_FLAGS)
	touch $@

configure/python-vte:: $(addprefix configure-stamp-, $(PY_VERSIONS))
configure/python-vte-dbg:: $(addprefix dbg-configure-stamp-, $(PY_VERSIONS))

build-stamp-%:
	make -C $(buildbasedir)/$*
	touch $@

dbg-build-stamp-%:
	make -C $(buildbasedir)/dbg-build-$*
	touch $@

build/python-vte:: $(addprefix build-stamp-, $(PY_VERSIONS))
build/python-vte-dbg:: $(addprefix dbg-build-stamp-, $(PY_VERSIONS))

install-stamp-%:
	make -C $(buildbasedir)/$* install DESTDIR=$(DEB_DESTDIR)
	# stop shipping *.a and *.la files for the Python module;
	# python-support moves them anyway (#412477)
	find $(DEB_DESTDIR)/usr/lib/$* -name \*.a -exec rm -f '{}' \;
	find $(DEB_DESTDIR)/usr/lib/$* -name \*.la -exec rm -f '{}' \;
	touch $@

dbg-install-stamp-%:
	make -C $(buildbasedir)/dbg-build-$* install DESTDIR=$(CURDIR)/debian/python-vte-dbg

install/python-vte:: $(addprefix install-stamp-, $(PY_VERSIONS))

binary-install/python-vte::
	dh_pysupport -d
	find debian/python-vte -name '*.la' -exec rm {} \;
	find debian/python-vte -name '*.a' -exec rm {} \;

install/python-vte-dbg:: $(addprefix dbg-install-stamp-, $(PY_VERSIONS))
	for i in $$(find debian/python-*-dbg/usr/lib/py* -name '*.so'); do \
	  b=$$(basename $$i .so); \
	  mv $$i $$(dirname $$i)/$${b}_d.so; \
	done
	find debian/python-*-dbg ! -type d ! -name '*_d.so' | xargs rm -f
	find debian/python-*-dbg -depth -empty -exec rmdir {} \;
	rm -rf 

binary-predeb/python-vte-dbg::
	rm -rf debian/python-vte-dbg/usr/share/doc/python-vte-dbg
	ln -s python-vte debian/python-vte-dbg/usr/share/doc/python-vte-dbg


######
# common cleanup
clean::
	-rm -rf $(buildbasedir)
	-rm -rf $(addprefix configure-stamp-, $(PY_VERSIONS))
	-rm -rf $(addprefix build-stamp-, $(PY_VERSIONS))
	-rm -rf $(addprefix install-stamp-, $(PY_VERSIONS))
	-rm -rf dbg-build* dbg-*-stamp-*


common-binary-fixup-arch::
	t=libvte-common; \
	for p in $$(dh_listpackages -a -N$$t); do \
	  rm -rf debian/$$p/usr/share/doc/$$p; \
	  ln -s $$t debian/$$p/usr/share/doc/$$p; \
	  if [ -f debian/$$p.docs ]; then \
	    mkdir -p debian/$$p/usr/share/doc/$$t; \
	    cp -a $$(eval echo $$(cat debian/$$p.docs)) debian/$$p/usr/share/doc/$$t/; \
	    dh_compress -p$$p; \
	  fi; \
	  ( \
	    echo "# doc dir is now a symlink to $$p"; \
	    echo 'if [ "$$1" = upgrade ] && [ ! -L /usr/share/doc/'$$p' ]; then'; \
	    echo "    rm -rf /usr/share/doc/$$p"; \
	    echo "fi"; \
	  ) >> debian/$$p.preinst.debhelper; \
	done