File: rules

package info (click to toggle)
vsearch 2.15.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 22,360 kB
  • sloc: cpp: 23,901; ansic: 475; makefile: 232; sh: 48
file content (71 lines) | stat: -rwxr-xr-x 1,861 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

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

include /usr/share/dpkg/default.mk

docdir := $(CURDIR)/debian/$(DEB_SOURCE)/usr/share/doc/$(DEB_SOURCE)

ifeq ($(DEB_HOST_GNU_CPU),x86_64)
    USEOPT:=yes
else
    ifeq  ($(DEB_HOST_GNU_CPU),i386)
	USEOPT:=yes
    else
        USEOPT:=no
    endif
endif

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -flto
DEB_CXXFLAGS_MAINT_APPEND  = -flto

ifneq ($(DEB_HOST_ARCH),ppc64el)
	DEB_CXXFLAGS_MAINT_APPEND += -std=c++11
endif

export DEB_CXXFLAGS_MAINT_APPEND

%:
	dh $@

override_dh_auto_build:
	dh_auto_build
	markdown README.md > README.html
	# Remove redundant travis-build URL
	sed -i 1d README.html

VDATADIR=/usr/share/vsearch/data
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	if [ -d $(VDATADIR) ] ; then \
	    mkdir -p ../vsearch-data && \
	    for datadir in `find $(VDATADIR) -type d | sed -e "s#$(VDATADIR)/*##" -e "/^$$/d"` ; do mkdir -p ../vsearch-data/$${datadir} ; done && \
	    for datafile in `find $(VDATADIR) -type f` ; do \
	        ln -s $${datafile} `echo $${datafile} | sed -e "s#$(VDATADIR)/#../vsearch-data/#"` ; \
	    done && \
	    zcat ../vsearch-data/BioMarKs.fsa.gz > ../vsearch-data/BioMarKs.fsa && \
	    cd test && \
	    for t in *.sh ; do \
	        bash $$t v ; \
	    done && \
	    cd .. && \
	    rm -rf ../vsearch-data ; \
	fi
endif

override_dh_clean:
	dh_clean
	rm -rf data/simm
	if [ -d test ] ; then find test -mindepth 1 -not -name '*.sh' -delete ; fi
	rm -f README.html data/README.html
	rm -f *.out

override_dh_install:
	dh_install
	if [ -d test ] ; then \
	    # tweak path tp vsearch binary in test scripts \
	    mkdir -p $(docdir)/test ; \
	    for tst in test/*.sh ; do sed 's?\.\./bin/vsearch?/usr/bin/vsearch?' $${tst} > $(docdir)/$${tst} ; done ; \
	fi