File: rules

package info (click to toggle)
pbalign 0.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 824 kB
  • ctags: 454
  • sloc: python: 3,476; makefile: 204; xml: 45; sh: 26
file content (57 lines) | stat: -rwxr-xr-x 2,041 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
#!/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: SHELL=bash
override_dh_install:
	dh_install
	# Create manpages
	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" \
	);								       \
	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
	# 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