Skip to content

Commit

Permalink
VDB-2899: added "make deb"
Browse files Browse the repository at this point in the history
  • Loading branch information
klymenko committed Mar 2, 2016
1 parent ec11101 commit 4338540
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,22 @@ rpm: std
@ $(MAKE) rpm -s TOP=$(CURDIR) -f build/Makefile.rpm
endif

#-------------------------------------------------------------------------------
# DEB
#
ifeq (mac,$(OS))
#deb: std
deb:
@ $(MAKE) deb -s TOP=$(CURDIR) -f build/Makefile.deb
else
deb:
ifeq (Ubuntu,$(OS_DISTRIBUTOR))
@ $(MAKE) deb -s TOP=$(CURDIR) -f build/Makefile.deb
else
@ echo "Not making Deb on $(OS_DISTRIBUTOR) $(OS)"
endif
endif

#-------------------------------------------------------------------------------
# pass-through targets
#
Expand Down
93 changes: 93 additions & 0 deletions build/Makefile.deb
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# ===========================================================================
#
# PUBLIC DOMAIN NOTICE
# National Center for Biotechnology Information
#
# This software/database is a "United States Government Work" under the
# terms of the United States Copyright Act. It was written as part of
# the author's official duties as a United States Government employee and
# thus cannot be copyrighted. This software/database is freely available
# to the public for use. The National Library of Medicine and the U.S.
# Government have not placed any restriction on its use or reproduction.
#
# Although all reasonable efforts have been taken to ensure the accuracy
# and reliability of the software and data, the NLM and the U.S.
# Government do not and cannot warrant the performance or results that
# may be obtained by using this software or data. The NLM and the U.S.
# Government disclaim all warranties, express or implied, including
# warranties of performance, merchantability or fitness for any particular
# purpose.
#
# Please cite the author in any work or product based on this material.
#
# ===========================================================================

#VERBOSE=-v

# determine shell environment ($CONFIG_FILE)
include $(TOP)/build/Makefile.shell

# load build configuration ($TARGDIR) ($VERSION)
include $(CONFIG_FILE)

# $TOOLS_TO_INSTALL
include $(TOP)/build/Makefile.tools
ifeq (1,$(HAVE_HDF5))
TOOLS_TO_INSTALL += pacbio-load
endif
TOOLS_TO_INSTALL += remote-fuser sra-kar

PKGDIR=$(TARGDIR)/debbuild
DST=$(PKGDIR)/sra-toolkit-$(VERSION)
DEB=$(DST).deb

deb: $(DEB)

$(DEB): $(DST)/etc/ncbi $(DST)/usr/bin $(DST)/DEBIAN/control
ifeq (mac,$(OS))
dpkg-deb --build $(DST)
else
fakeroot dpkg-deb --build $(DST)
endif

$(DST):
mkdir $(VERBOSE) -p $@/DEBIAN
mkdir $(VERBOSE) -p $@/etc/ncbi

$(DST)/etc/ncbi: $(DST) $(DST)/usr/share/ncbi/schema \
$(DST)/etc/ncbi/default.kfg $(DST)/etc/ncbi/schema.kfg \
$(DST)/etc/ncbi/vdb-copy.kfg

$(DST)/etc/ncbi/default.kfg:
rsync $(VERBOSE) -l --chmod=g-w $(VDB_LIBDIR)/ncbi/default.kfg $@

$(DST)/etc/ncbi/schema.kfg:
echo '/vdb/schema/paths = "/usr/share/ncbi/schema"' > $@

$(DST)/etc/ncbi/vdb-copy.kfg:
rsync $(VERBOSE) -l --chmod=g-w $(BINDIR)/ncbi/vdb-copy.kfg $@

$(DST)/usr/bin:
mkdir $(VERBOSE) -p $@
$(MAKE) -s --no-print-directory -f $(TOP)/build/Makefile.deb \
$(TOOLS_TO_INSTALL)

$(DST)/usr/share/ncbi/schema: $(DST)
mkdir $(VERBOSE) -p $@
rsync $(VERBOSE) -rmloptD --include '*.vschema' --include='*/' \
--exclude '*' $(VDB_INCDIR)/* $@

$(DST)/DEBIAN/control:
printf \
"Package: sra-toolkit\n"\
"Version: $(VERSION)\n"\
"Architecture: all\n"\
"Maintainer: SRA Toolkit Development Team <[email protected]>\n"\
"Description: SRA Toolkit package\n"\
" The SRA Toolkit and SDK from NCBI is a collection of tools and libraries\n"\
" for using data in the INSDC Sequence Read Archives.\n" > $@

$(TOOLS_TO_INSTALL):
- ( test -f $(BINDIR)/$@ || ( echo "$@ not found" && false ) ) && \
rsync $(VERBOSE) -l $(BINDIR)/$@ $(BINDIR)/$@$(VERSION_EXEX) \
$(BINDIR)/$@$(MAJVERS_EXEX) $(DST)/usr/bin
1 change: 1 addition & 0 deletions build/Makefile.shell
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ ifeq (Darwin, $(UNAME))
endif
ifeq (Linux, $(UNAME))
HOST_OS = linux
OS_DISTRIBUTOR = $(shell lsb_release -si)
endif
ifeq (SunOS, $(UNAME))
HOST_OS = sun
Expand Down

0 comments on commit 4338540

Please sign in to comment.