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
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CFLAGS+=$(CPPFLAGS)
CXXFLAGS+=$(CPPFLAGS)
# out of tree build folder for vmime library
DEB_BUILD_DIR=debian/build
# default install folder
INSTDIR=$(CURDIR)/debian/tmp
DEB_LIBVMIME_CMAKE_OPTS := \
-DCMAKE_C_COMPILER="$(CC)" \
-DCMAKE_CXX_COMPILER="$(CXX)" \
-DCMAKE_CXX_FLAGS="$(CXXFLAGS)" \
-DCMAKE_SHARED_LINKER_FLAGS_RELEASE="$(LDFLAGS)" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_INSTALL_PREFIX=/usr \
-DVMIME_BUILD_SAMPLES=OFF \
-DVMIME_INSTALL_LIBDIR="/usr/lib/$(DEB_HOST_MULTIARCH)" \
-DVMIME_TLS_SUPPORT_LIB=gnutls \
-G "Unix Makefiles" \
$(CURDIR) \
$(NULL)
PREPROCESS_FILES := $(wildcard debian/*.in)
$(PREPROCESS_FILES:.in=): %: %.in
sed 's,/@DEB_HOST_MULTIARCH@,$(DEB_HOST_MULTIARCH:%=/%),g' $< > $@
%:
dh $@
override_dh_clean:
rm -rf $(DEB_BUILD_DIR)
dh_clean
override_dh_auto_configure:
@echo
@echo "######################"
@echo "# configure libvmime #"
@echo "######################"
@echo
# libvmime doesn't have preconfigured cmake options for using dh_auto_configure
# so we need to call the cmake setup manually.
mkdir -p $(DEB_BUILD_DIR); \
cd $(DEB_BUILD_DIR); \
cmake $(DEB_LIBVMIME_CMAKE_OPTS)
override_dh_auto_build-arch:
@echo
@echo "#####################"
@echo "# building libvmime #"
@echo "#####################"
@echo
dh_auto_build --sourcedirectory=$(CURDIR) --builddirectory=$(DEB_BUILD_DIR)
override_dh_auto_install-arch: $(PREPROCESS_FILES:.in=)
@echo
@echo "#######################"
@echo "# installing libvmime #"
@echo "#######################"
@echo
dh_auto_install --destdir=$(INSTDIR) --sourcedirectory=$(CURDIR) --builddirectory=$(DEB_BUILD_DIR)
dh_install
override_dh_auto_build-indep:
@echo
@echo "##########################"
@echo "# building documentation #"
@echo "##########################"
@echo
dh_auto_build --sourcedirectory=$(CURDIR) --builddirectory=$(DEB_BUILD_DIR) -- doc
# Removing *.md5 files generated by doxygen before dh_install will run
# as we don't want to ship because they are useless and upstream hasn't a
# usefull install target for the API documentation before.
cd $(DEB_BUILD_DIR)/doc/html; \
find -type f -name "*.md5" -exec rm {} \;
|