#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow DEBVENDOR := $(shell dpkg-vendor --query Vendor) ifeq ($(DEBVENDOR), Qlustar) # Qlustar specific stuff include /usr/share/ql-deb-utils/Makefile MPICXX := mpicxx.openmpi-gcc else NUMJOBS := $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) MAKE_-J := $(addprefix -j, $(NUMJOBS)) MPICXX := mpicxx.openmpi endif # include defs of all DEB_HOST_*/DEB_BUILD_* vars include /usr/share/dpkg/architecture.mk RELION_API_VERSION := $(shell \ grep 'AC_SUBST.*RELION_API_VERSION' $(CURDIR)/configure.ac \ | sed 's/.*(.*\[\(.*\)\])$$/\1/g') $(info Relion API Version = $(RELION_API_VERSION)) RELION_SO_CUR_INTERFACE := $(shell \ grep 'AC_SUBST.*RELION_SO_VERSION' $(CURDIR)/configure.ac \ | sed 's/.*(.*\[\([0-9]*\):[0-9]*:[0-9]*\])$$/\1/g') $(info Relion most recent (current) lib interface = $(RELION_SO_CUR_INTERFACE)) CONFIGURE_COMMON := dh_auto_configure -- \ --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) %: dh $@ override_dh_auto_configure: override_dh_auto_build: # We need to build 4 different versions for the 4 different binary # packages. This is necessary because unfortunately the binaries work # only with the exact same librelion they were built with. # First no MPI, no GUI (for relion-bin) ... $(CONFIGURE_COMMON) --disable-gui make $(MAKE_-J); make install prefix=$(CURDIR)/debian/tmp/simple/usr make clean # ... then add MPI (for relion-bin+mpi) ... MPICXX=$(MPICXX) $(CONFIGURE_COMMON) --enable-mpi --disable-gui make $(MAKE_-J); make install prefix=$(CURDIR)/debian/tmp/mpi/usr make clean # ... then add GUI (for relion-bin+gui) ... $(CONFIGURE_COMMON) --enable-gui \ CPPFLAGS="$$(fltk-config --cxxflags)" \ LDFLAGS="$$(fltk-config --ldflags)" make $(MAKE_-J); make install prefix=$(CURDIR)/debian/tmp/gui/usr make clean # ... finally add MPI + GUI (for librelion-bin+mpi+gui) MPICXX=$(MPICXX) $(CONFIGURE_COMMON) --enable-mpi --enable-gui \ CPPFLAGS="$$(fltk-config --cxxflags)" \ LDFLAGS="$$(fltk-config --ldflags)" make $(MAKE_-J); make install prefix=$(CURDIR)/debian/tmp/mpi+gui/usr make clean # clear dependency_libs field in *.la files # see lintian non-empty-dependency_libs-in-la-file for reference sed -i "/dependency_libs/ s/'.*'/''/" $$(find debian/tmp/ -name '*.la') override_dh_prep: # We don't want debian/tmp to be removed again ... dh_prep -X debian/tmp override_dh_auto_install: override_dh_install-arch: dh_install -a # relion_qsub.csh should just go to GUI d/examples find debian/relion-bi*/usr/bin -name relion_qsub.csh -delete override_dh_shlibdeps: pkgs=relion-bin relion-bin+mpi relion-bin+gui \ relion-bin+mpi+gui override_dh_shlibdeps: # First for all packages apart from relion-bin* dh_shlibdeps -- $(patsubst %,-x%,$(pkgs)) # Now for the relion-bin* packages for pkg in $(pkgs); do \ echo -e "\n-- Info: Run dpkg-shlibdeps for $$pkg --\n"; \ dpkg-shlibdeps -e debian/$${pkg}/usr/bin/relion_* \ -Sdebian/librelion$${pkg#relion-bin}-$(RELION_API_VERSION)-$(RELION_SO_CUR_INTERFACE) \ -Tdebian/$${pkg}.substvars; \ done describe-current-version: git describe --tags upstream | sed 's,^release-,,;s,-,+,;s,-,~,;' get-orig-source: uscan --download-current-version --force-download --rename --repack-compression xz