~ubuntu-branches/ubuntu/utopic/libxml2/utopic

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Package Import Robot
  • Author(s): Aron Xu, Christian Svensson, Daniel Schepler, Helmut Grohne, Adam Conrad, Matthias Klose, Aron Xu
  • Date: 2014-07-09 05:40:15 UTC
  • mto: This revision was merged to the branch mainline in revision 75.
  • Revision ID: package-import@ubuntu.com-20140709054015-rdnfjxrf3zvmw6l7
[ Christian Svensson ]
* Do not build-depend on readline (Closes: #742350)

[ Daniel Schepler ]
* Patch to bootstrap without python (Closes: #738080)

[ Helmut Grohne ]
* Drop unneeded B-D on perl and binutils (Closes: #753005)

[ Adam Conrad ]
* Actually run dh_autoreconf, which the old/new mixed rules file misses.

[ Matthias Klose ]
* Add patch to fix python multiarch issue
* Allow the package to cross-build by tweaking B-Ds on python
* Set PYTHON_LIBS for cross builds

[ Aron Xu ]
* Use correct $CC
* Configure udeb without python
* New round of cherry-picking upstream fixes
  - Includes fixes for CVE-2014-0191 (Closes: #747309).
* Call prename with -vf
* Require python-all-dev (>= 2.7.5-5~)
* Bump std-ver: 3.9.4 -> 3.9.5, no change

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
PYVER=$(shell pyversions -d)
8
8
 
9
9
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
 
10
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
10
11
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
11
12
 
 
13
CC = $(DEB_HOST_GNU_TYPE)-gcc
12
14
CFLAGS = `dpkg-buildflags --get CFLAGS` -Wall
13
15
LDFLAGS = `dpkg-buildflags --get LDFLAGS` -Wl,--as-needed
14
16
CPPFLAGS = `dpkg-buildflags --get CPPFLAGS`
25
27
export DH_OPTIONS = -Nlibxml2-udeb
26
28
endif
27
29
 
 
30
ifeq ($(DEB_BUILD_PROFILE),stage1)
 
31
DH_OPTIONS += -Npython-libxml2 -Npython-libxml2-dbg
 
32
export DH_OPTIONS
 
33
endif
 
34
 
28
35
CONFIGURE_FLAGS := --disable-silent-rules --with-history CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" --cache-file="$(CURDIR)/builddir/config.cache"
29
36
 
30
37
override_dh_auto_configure: $(TARGETS:%=doconfigure-%)
31
38
 
32
 
doconfigure-%:
 
39
debian/autoreconf.after:
 
40
        dh_autoreconf
 
41
 
 
42
doconfigure-%: debian/autoreconf.after
33
43
        dh_auto_configure --builddirectory=builddir/$* -- $(CONFIGURE_FLAGS)
34
44
 
35
45
doconfigure-main: CONFIGURE_FLAGS += --without-python
36
46
doconfigure-python%: CONFIGURE_FLAGS += --with-python=/usr/bin/$*
37
47
#doconfigure-udeb: CONFIGURE_FLAGS += --without-history --with-minimum --with-tree --with-output
38
 
doconfigure-udeb: CONFIGURE_FLAGS += --without-history --with-tree --with-output
 
48
doconfigure-udeb: CONFIGURE_FLAGS += --without-history --with-tree --with-output --without-python
39
49
 
40
50
override_dh_auto_build: $(TARGETS:%=dobuild-%)
41
51
 
45
55
        dh_auto_build --builddirectory=$(BUILD_DIR) -- $(BUILD_FLAGS)
46
56
 
47
57
dobuild-python%: BUILD_DIR=builddir/main/$*
48
 
dobuild-python%: BUILD_FLAGS = libxml2mod_la_LIBADD='$$(mylibs)'
49
 
dobuild-python%-dbg: BUILD_FLAGS += PYTHON_INCLUDES=/usr/include/$(*:-dbg=_d) \
 
58
dobuild-python%: BUILD_FLAGS = libxml2mod_la_LIBADD='$$(mylibs)' \
 
59
    PYTHON_INCLUDES="$(shell $(DEB_HOST_GNU_TYPE)-python-config --includes)" \
 
60
    PYTHON_LIBS="$(shell $(DEB_HOST_GNU_TYPE)-python-config --ldflags)"
 
61
dobuild-python%-dbg: BUILD_FLAGS += PYTHON_INCLUDES="$(shell $(DEB_HOST_GNU_TYPE)-python-dbg-config --includes)" \
 
62
    PYTHON_LIBS="$(shell $(DEB_HOST_GNU_TYPE)-python-dbg-config --ldflags)" \
50
63
    CFLAGS="$(CFLAGS) -Wall -g -O0" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS) \
51
64
    -L$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)"
52
65
build-arch: $(TARGETS:%=dobuild-%)
82
95
 
83
96
doinstall-python%-dbg:
84
97
        $(MAKE) -C builddir/main/python$*-dbg DESTDIR=$(CURDIR)/debian/tmp-dbg install-pythonLTLIBRARIES
85
 
        prename 's/(?<!_d)\.so$$/_d.so/' debian/tmp-dbg/usr/lib/python$*/*-packages/*.so
 
98
        prename -vf 's/(?<!_d)\.so$$/_d.so/' debian/tmp-dbg/usr/lib/python$*/*-packages/*.so
86
99
 
87
100
doinstall-python%:
88
101
        dh_auto_install --builddirectory=builddir/main/python$*
103
116
 
104
117
override_dh_install:
105
118
        dh_install -Npython-libxml2-dbg -Nlibxml2-udeb
 
119
ifneq ($(DEB_BUILD_PROFILE),stage1)
106
120
        dh_install -ppython-libxml2-dbg --sourcedir=debian/tmp-dbg
 
121
endif
107
122
        dh_install -plibxml2-udeb --sourcedir=debian/tmp-udeb
108
123
        sed -i -e 's,/lib/$(DEB_HOST_MULTIARCH),/lib,' debian/libxml2-dev/usr/bin/xml2-config
109
124
 
110
125
override_dh_strip:
111
126
        dh_strip -a --dbg-package=libxml2-dbg -Nlibxml2-udeb -Nlibxml2-utils -Nlibxml2-utils-dbg -Npython-libxml2 -Npython-libxml2-dbg
112
127
        dh_strip -plibxml2-utils --dbg-package=libxml2-utils-dbg
 
128
ifneq ($(DEB_BUILD_PROFILE),stage1)
113
129
        dh_strip -ppython-libxml2 --dbg-package=python-libxml2-dbg
 
130
endif
114
131
        $(foreach python, $(filter-out $(PYVER), $(PYVERS)),\
115
132
                cd $(CURDIR)/debian/python-libxml2/usr/lib/pyshared; \
116
133
                if diff $(python)/libxml2mod.so $(PYVER)/libxml2mod.so > /dev/null 2>&1; then \
123
140
        dh_makeshlibs -a $(if $(WITH_UDEB),--add-udeb=libxml2-udeb )-V 'libxml2 (>= 2.7.4)' -- -c4
124
141
 
125
142
%:
 
143
ifeq ($(DEB_BUILD_PROFILE),stage1)
 
144
        dh $@ --with autoreconf
 
145
else
126
146
        dh $@ --with autoreconf,python2
 
147
endif
127
148
 
128
149