File: rules

package info (click to toggle)
gmap 2021-12-17%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 23,944 kB
  • sloc: ansic: 467,084; perl: 5,583; makefile: 1,003; sh: 80
file content (68 lines) | stat: -rwxr-xr-x 2,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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/default.mk
mandir  := $(CURDIR)/debian/$(DEB_SOURCE)/usr/share/man/man1
utildir := $(CURDIR)/util
bindir  := $(CURDIR)/src

include /usr/share/dpkg/architecture.mk

HELP2MAN = /usr/bin/help2man --no-info --version-string=${DEB_VERSION}

# FIXME: gmap seems to have all the cpuid control necessary to avoid baseline
# violation when compiled with high simd level (e.g. avx512bw) but running on
# low baseline CPU (e.g. sse4_2).  The problem is that the build fails when
# attempting to compile high baseline on a build system with low baseline.  It
# would be nice to be able to provide high simd level to high baseline CPU as
# well without build failure.  See #1020793 for more details.
ifeq (amd64,$(DEB_HOST_ARCH))
  SIMD = --enable-simd --with-simd-level=sse2
else
  SIMD = --disable-simd
endif

%:
	dh  $@

override_dh_auto_configure:
	dh_auto_configure -- --with-gmapdb=/var/cache/gmap \
	--bindir=/usr/lib/gmap $(SIMD)

override_dh_auto_install:
	mkdir -p $(mandir)
	$(HELP2MAN) --name='Genomic Mapping and Alignment Program' \
	$(bindir)/gmap |debian/filter.pl >$(mandir)/gmap.1
	$(HELP2MAN) --name='Genomic Short-read Nucleotide Alignment Program' \
	$(bindir)/gsnap |debian/filter.pl >$(mandir)/gsnap.1
	$(HELP2MAN) --name='Tool for genome database creation for GMAP or GSNAP' \
	$(utildir)/gmap_build |debian/filter.pl >$(mandir)/gmap_build.1
	dh_auto_install

override_dh_install:
	mkdir -p debian/$(DEB_SOURCE)/usr/bin
	dh_install
	for bin in `echo gmap gsnap gmap_build gmapl gsnapl; \
		cd $(CURDIR)/debian/$(DEB_SOURCE)/usr/lib/$(DEB_SOURCE)/; \
		ls -1 gmap*.* gsnap*.* `; do \
		ln -s /usr/lib/gmap/$$bin debian/$(DEB_SOURCE)/usr/bin/$$bin; \
	done

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test --no-parallel
endif

override_dh_installexamples:
	mkdir $(CURDIR)/debian/$(DEB_SOURCE)/usr/share/doc/$(DEB_SOURCE)/examples
	find tests/ -type f -print0 | xargs -0r sed -i \
		-e 's@$(CURDIR)@«buildpath»@g' \
		-e 's@\#! /bin/bash@\#! /bin/sh@g'
	tar --sort=name \
		--mtime="@${SOURCE_DATE_EPOCH}" \
		--owner=root --group=root --numeric-owner \
		--mode=go=rX,u+rw,a-s \
		--exclude='*/align.log' \
		--exclude='*/Makefile' \
		--exclude='*/Makefile.in' \
		-cJf $(CURDIR)/debian/$(DEB_SOURCE)/usr/share/doc/$(DEB_SOURCE)/examples/tests.tar.xz  tests