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
|
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This has to be exported to make some magic below work.
export DH_OPTIONS
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
CPPFLAGS :=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS :=$(shell dpkg-buildflags --get CFLAGS)
CXXFLAGS :=$(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS :=$(shell dpkg-buildflags --get LDFLAGS)
export DEB_HOST_MULTIARCH CPPFLAGS CFLAGS CXXFLAGS LDFLAGS
ifeq (,$(filter $(DEB_BUILD_ARCH),kfreebsd-amd64 kfreebsd-i386 hurd-i386))
DISABLE_PTHREADS=OFF
else
DISABLE_PTHREADS=ON
endif
override_dh_auto_configure:
dh_testdir
mkdir build-static; cd build-static; \
cmake .. -DCMAKE_INSTALL_PREFIX=/usr \
-DLIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
-DYAML_CPP_BUILD_TOOLS=ON \
-Dgtest_disable_pthreads=$(DISABLE_PTHREADS)
mkdir build-shared; cd build-shared; \
cmake .. -DCMAKE_INSTALL_PREFIX=/usr \
-DLIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
-DBUILD_SHARED_LIBS=ON \
-DYAML_CPP_BUILD_TOOLS=ON \
-Dgtest_disable_pthreads=$(DISABLE_PTHREADS)
override_dh_auto_build:
dh_testdir
$(MAKE) -C build-static VERBOSE=1
$(MAKE) -C build-shared VERBOSE=1
# It might make sense to also provide the utils in a separate package
# $(MAKE) -C build-shared util
override_dh_auto_install:
dh_testdir
dh_prep
$(MAKE) -C build-static install DESTDIR=$(CURDIR)/debian/tmp
$(MAKE) -C build-shared install DESTDIR=$(CURDIR)/debian/tmp
override_dh_auto_test:
$(MAKE) -C build-static test
$(MAKE) -C build-shared test
debian/weak-symbols: override_dh_auto_build
# All the weak symbols are either template instantiations of the STL
# or are optional symbols for inline functions.
nm --dynamic --defined-only build-shared/libyaml-cpp.so | awk '$$2 ~ /W/ { print " " $$3 "@Base 0.6.2" } ' > $@
override_dh_makeshlibs: debian/weak-symbols
dh_makeshlibs -VNone
clean:
dh_testdir
dh_auto_clean
dh_clean
rm -rf build-static build-shared
%:
dh $@
.PHONY: clean
|