File: rules

package info (click to toggle)
pbalign 0.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 920 kB
  • sloc: python: 3,477; makefile: 212; sh: 120; xml: 45
file content (67 lines) | stat: -rwxr-xr-x 2,411 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
#!/usr/bin/make -f

#DH_VERBOSE = 1
export LC_ALL=C.UTF-8
include /usr/share/dpkg/default.mk

export PYBUILD_NAME = pbalign

BUILDDIR = $(CURDIR)/debian/python-pbalign
BINDIR=$(BUILDDIR)/usr/bin
HELP2MAN = help2man --no-info --version-string $(DEB_VERSION_UPSTREAM)
MANDIR = $(CURDIR)/debian/$(DEB_SOURCE)/usr/share/man/man1

%:
	dh $@ --with=python2 --buildsystem=pybuild

override_dh_auto_build:
	dh_auto_build
	$(MAKE) doc

# The tests cannot be run, mostly because the referenced data files
# (which are large) are not provided in the source distribution
#override_dh_auto_test:
#	export PYTHONPATH=$(CURDIR);	\
#	cd tests/unit && python -m unittest discover

override_dh_install:
	dh_install
	# Remove .py suffix from scripts (we'll make symlinks to replace them)
	for script in extractUnmappedSubreads			\
	              loadChemistry				\
	              createChemistryHeader			\
	              maskAlignedReads;				\
	do							\
	    mv $(BINDIR)/$$script.py $(BINDIR)/$$script;	\
#	    mv $(MANDIR)/$$script.py.1 $(MANDIR)/$$script.1;	\
	done
	# Place executables in the pbalign package
	mkdir -p $(CURDIR)/debian/$(DEB_SOURCE)/usr/bin
	mv $(BINDIR)/* $(CURDIR)/debian/$(DEB_SOURCE)/usr/bin

no_override_dh_installmanpages: SHELL=bash
no_override_dh_installmanpages: 
	# Create manpages - this is deactivated in favour of debian/createmanpages script which is executed before creating the package
	mkdir -p $(MANDIR)
	declare -A description;						       \
	description=(							       \
	  [pbalign]="Mapping PacBio sequences to references"		       \
	  [maskAlignedReads.py]="Mask aligned reads in regions file"	       \
	  [createChemistryHeader.py]="Create a SAM header with PacBio sequencing chemistry information" \
	  [loadChemistry.py]="Load PacBio sequencing chemistry information"    \
	  [extractUnmappedSubreads.py]="Extract unmapped subreads from a fasta file" \
	);								       \
	set -x \
	export PYTHONPATH=$(BUILDDIR)/usr/lib/python2.7/dist-packages;	       \
	for executable in $(BUILDDIR)/usr/bin/*;			       \
	do								       \
	    $(HELP2MAN) --name="$${description[`basename $$executable`]}"      \
	      $$executable > $(MANDIR)/`basename $$executable.1`;	       \
	done

override_dh_auto_clean:
	dh_auto_clean
	rm -rf doc/_build/
	rm -f doc/pbalign.alignservice.rst doc/pbalign.rst doc/pbalign.tasks.rst doc/pbalign.tools.rst doc/pbalign.utils.rst
	rm -rf pbalign.egg-info