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
|
#!/usr/bin/make -f
include /usr/share/dpkg/default.mk
AUTHOR := Florent Angly <florent.angly@gmail.com>
SECTION := 1
MANDIR := debian/man
NAME1 = $(DEB_SOURCE)
SCRIPT1 = bin/$(NAME1)
DESC1 = 'Versatile omics shotgun and amplicon sequencing read simulator'
MAN1 = $(MANDIR)/$(NAME1).$(SECTION)
NAME2 = average_genome_size
SCRIPT2 = utils/$(NAME2)
DESC2 = 'Calculate the average genome size in Grinder libraries'
MAN2 = $(MANDIR)/$(NAME2).$(SECTION)
NAME3 = change_paired_read_orientation
SCRIPT3 = utils/$(NAME3)
DESC3 = 'Reverses the orientation of each paired\-end FASTA sequence'
MAN3 = $(MANDIR)/$(NAME3).$(SECTION)
define MORE
[see also]
.BR grinder (7),
.BR $(NAME1) ($(SECTION)),
.BR $(NAME2) ($(SECTION))
and
.BR $(NAME3) ($(SECTION)).
endef
export MORE
MOREFILE = $(MANDIR)/more.$(SECTION)
%:
dh $@
override_dh_auto_configure:
# MYMETA.yml will be changed and not reverted in clean target - use the chance to conserve it here
mkdir _disposal
cp -a MYMETA.yml _disposal
dh_auto_configure
# Because of Grinder's random output, some tests are brittle and may fail...
# Only test that the program loads successfully
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
$(MAKE) testdb TEST_FILE=t/00-load.t TESTDB_SW=''
endif
# Generate manpages on the fly
override_dh_auto_build:
mkdir -p $(MANDIR)
echo "$$MORE" > $(MOREFILE)
PERL5LIB=lib help2man --no-discard-stderr --name $(DESC1) --section $(SECTION) --version-string $(DEB_VERSION_UPSTREAM) --no-info --include $(MOREFILE) --output $(MAN1) $(SCRIPT1)
help2man --no-discard-stderr --name $(DESC2) --section $(SECTION) --version-string $(DEB_VERSION_UPSTREAM) --no-info --include $(MOREFILE) --output $(MAN2) $(SCRIPT2)
help2man --no-discard-stderr --name $(DESC3) --section $(SECTION) --version-string $(DEB_VERSION_UPSTREAM) --no-info --include $(MOREFILE) --output $(MAN3) $(SCRIPT3)
rm $(MOREFILE)
dh_auto_build
override_dh_auto_clean:
dh_auto_clean
rm -rf $(MANDIR)
if [ -d _disposal ] ; then \
if [ -e _disposal/MYMETA.yml ] ; then mv _disposal/MYMETA.yml . ; fi ; \
for pm in `cd _disposal ; find Bio -type f ; cd ..` ; do \
mv _disposal/$${pm} lib/$${pm} ; \
done ; \
fi
rm -rf _disposal
override_dh_install:
dh_install
for pl in `grep -Rl '#!/usr/bin/env[[:space:]]\+perl' debian/*/usr/*` ; do \
sed -i '1s?^#!/usr/bin/env[[:space:]]\+perl?#!/usr/bin/perl?' $${pl} ; \
done
|