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
|
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
CFLAGS += -Wall
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
LDFLAGS += -Wl,--as-needed
DESTDIR=$(CURDIR)/debian/tmp
export PYTHON=$(shell which `pyversions -d`)
export PYTHON_CONFIG="$(PYTHON)-config"
export WAF=$(PYTHON) ./buildtools/bin/waf -v
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
%:
dh $* --with python2
override_dh_auto_configure:
PYTHON="$(PYTHON)" PYTHON_CONFIG="$(PYTHON_CONFIG)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
$(WAF) configure --prefix=/usr --disable-rpath-install \
--builtin-libraries=ccan,replace,tdb_compat \
--bundled-libraries=NONE,pytevent \
--minimum-library-version="$(shell ./debian/autodeps.py --minimum-library-version)" \
--libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
--with-modulesdir=/usr/lib/$(DEB_HOST_MULTIARCH)/ldb/modules
get-packaged-orig-source:
./debian/build-orig.sh
override_dh_auto_clean:
-$(WAF) clean
# Waf should be doing this; see
# https://bugzilla.samba.org/show_bug.cgi?id=8854
rm -f .lock-wscript
# Waf should be doing this; see
# https://bugzilla.samba.org/show_bug.cgi?id=8855
rm -f buildtools/wafsamba/*.pyc \
third_party/waf/wafadmin/*.pyc \
third_party/waf/wafadmin/Tools/*.pyc
override_dh_auto_build:
$(WAF) build
override_dh_auto_test:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
$(WAF) test
endif
override_dh_python2:
dh_python2 --no-guessing-versions
override_dh_auto_install:
DESTDIR=$(DESTDIR) $(WAF) install
rm $(DESTDIR)/usr/lib/python*/dist-packages/_tevent.so
rm $(DESTDIR)/usr/lib/python*/dist-packages/tevent.py
ar cr libldb.a bin/default/common/*.o
mv libldb.a $(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)
override_dh_missing:
dh_missing --fail-missing
override_dh_makeshlibs:
dh_makeshlibs -Xldb.so -ppython-ldb -- -c4
dh_makeshlibs -X/usr/lib/$(DEB_HOST_MULTIARCH)/ldb -plibldb1 -- -c4
|