File: rules

package info (click to toggle)
relion 1.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,004 kB
  • ctags: 4,402
  • sloc: cpp: 41,339; sh: 10,403; makefile: 261; ansic: 50; csh: 2
file content (95 lines) | stat: -rwxr-xr-x 3,400 bytes parent folder | download
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
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

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 $@ --parallel --with autoreconf

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:
	dh_install
	# 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