#!/usr/bin/make -f export DH_OPTIONS export DEB_BUILD_HARDENING=1 PKG_DIR=$(shell pwd) BUILD_DIR=$(CURDIR)/build-dir INSTALL_DIR=$(PKG_DIR)/debian/tmp 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) configure: configure-stamp configure-stamp: dh_testdir mkdir $(BUILD_DIR) find . -name '*.o' -delete cd $(BUILD_DIR) && cmake -DCMAKE_C_FLAGS="$(CFLAGS)" -DCMAKE_CXX_FLAGS="$(CXXFLAGS) $(CPPFLAGS)" -DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS)" -DCMAKE_SHARED_LINKER_FLAGS="$(LDFLAGS)" -DCMAKE_SKIP_RPATH=False -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr $(PKG_DIR) touch configure-stamp #Architecture build: build-arch build-indep build-arch: build-arch-stamp build-arch-stamp: configure-stamp cd $(BUILD_DIR) && $(MAKE) $(NJOBS) VERBOSE=1 touch $@ build-indep: build-indep-stamp build-indep-stamp: configure-stamp touch $@ clean: dh_testdir dh_testroot rm -f build-arch-stamp build-indep-stamp configure-stamp test -d $(BUILD_DIR) && cd $(BUILD_DIR) && $(MAKE) clean || true rm -rf $(BUILD_DIR) dh_clean install: install-indep install-arch install-indep: dh_testdir dh_testroot dh_prep -i dh_installdirs -i cd $(BUILD_DIR) && $(MAKE) CMAKE_INSTALL_ALWAYS=1 DESTDIR=$(INSTALL_DIR) install # Remove all license files find $(INSTALL_DIR) -name '[lL][iI][cC][eE][nN][sS][eE].txt' -delete # Remove all thumbnails files find $(INSTALL_DIR) -name Thumbs.db -delete dh_install -i install-arch: dh_testdir dh_testroot dh_prep -s dh_installdirs -s cd $(BUILD_DIR) && $(MAKE) CMAKE_INSTALL_ALWAYS=1 DESTDIR=$(INSTALL_DIR) install cp $(INSTALL_DIR)/usr/share/kadu/ChangeLog debian/kadu/usr/share/doc/kadu/about-changes-tab.txt # Rmove some cruft # Remove RPATH from all the plugins chrpath -d debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/kadu/plugins/*.so dh_install -s # Must not depend on anything. This is to be called by # binary-arch/binary-indep # in another 'make' thread. binary-common: dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installexamples dh_installmenu dh_installman dh_link dh_strip dh_compress -XAUTHORS.html -XAUTHORS -XTHANKS -XLICENSE -Xabout-changes-tab.txt dh_fixperms dh_makeshlibs dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb # Build architecture independant packages using the common target. binary-indep: build-indep install-indep $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common # Build architecture dependant packages using the common target. binary-arch: build-arch install-arch $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common binary: binary-arch binary-indep .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure