summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Mollier <emollier@debian.org>2021-11-06 19:31:45 +0100
committerÉtienne Mollier <emollier@debian.org>2021-11-06 19:31:45 +0100
commitcbdf8676ed63cde36ac9488edd48a39737502ca8 (patch)
treee28118032399ff458023e3a3e3380710e6b8f8f1
parent92f4514af4d8bfb50daf300a2fe8825c5552702a (diff)
parenta07d4c3469efc55a6e287db115112574437376b1 (diff)
bamtools (2.5.1+dfsg-10) unstable; urgency=medium
* Team upload. * Add gcc11.patch (Closes: 983981) * Remove bamtools.lintian-overrides [dgit import unpatched bamtools 2.5.1+dfsg-10]
-rw-r--r--debian/README.test9
-rw-r--r--debian/bamtools.154
-rw-r--r--debian/bamtools.install1
-rw-r--r--debian/bamtools.manpages1
-rw-r--r--debian/changelog226
-rw-r--r--debian/clean5
-rw-r--r--debian/cmake/bamtools/bamtools-config.cmake40
-rw-r--r--debian/control111
-rw-r--r--debian/copyright37
-rwxr-xr-xdebian/createmanpages9
-rw-r--r--debian/docs4
-rw-r--r--debian/libbamtools-dev.install1
-rw-r--r--debian/libbamtools-doc.doc-base9
-rw-r--r--debian/libbamtools-doc.install1
-rw-r--r--debian/libbamtools.docs1
-rw-r--r--debian/patches/0001-ignore-thirdparty-and-fix-jsoncpp.patch42
-rw-r--r--debian/patches/0003-remove-custom-ExportHeader-function-use-install-inst.patch104
-rw-r--r--debian/patches/0006-Doxygen-reproducibility19
-rw-r--r--debian/patches/0008_Cmake_Test.patch27
-rw-r--r--debian/patches/doxygen-tweak37
-rw-r--r--debian/patches/gcc11.patch56
-rw-r--r--debian/patches/series9
-rw-r--r--debian/patches/shared_and_static.patch32
-rw-r--r--debian/patches/spelling15
-rw-r--r--debian/patches/tiddit.patch41
-rwxr-xr-xdebian/rules43
-rw-r--r--debian/salsa-ci.yml4
-rw-r--r--debian/sam_spec_example.bambin0 -> 375 bytes
-rw-r--r--debian/sam_spec_example.sam8
-rw-r--r--debian/source/format1
-rw-r--r--debian/source/include-binaries1
-rw-r--r--debian/tests/control3
-rw-r--r--debian/tests/filter_script17
-rw-r--r--debian/tests/run-unit-test49
-rw-r--r--debian/upstream/metadata31
-rw-r--r--debian/watch4
36 files changed, 1052 insertions, 0 deletions
diff --git a/debian/README.test b/debian/README.test
new file mode 100644
index 0000000..74ce729
--- /dev/null
+++ b/debian/README.test
@@ -0,0 +1,9 @@
+
+Notes on how this package can be tested.
+────────────────────────────────────────
+
+This package can be tested by executing
+
+ sh run-unit-test
+
+in order to confirm its integrity.
diff --git a/debian/bamtools.1 b/debian/bamtools.1
new file mode 100644
index 0000000..593d2b2
--- /dev/null
+++ b/debian/bamtools.1
@@ -0,0 +1,54 @@
+.TH BAMTOOLS "1" "April 2014" "bamtools 2.3.0+dfsg" "User Commands"
+.SH NAME
+bamtools \- toolkit for manipulating BAM (genome alignment) files
+.SH SYNOPSIS
+.B bamtools
+[\-\-help] COMMAND [ARGS]
+.SH DESCRIPTION
+BamTools facilitates research analysis and data management using BAM
+files. It copes with the enormous amount of data produced by current
+sequencing technologies that is typically stored in compressed, binary
+formats that are not easily handled by the text-based parsers commonly
+used in bioinformatics research.
+.SH OPTIONS
+.TP
+convert
+Converts between BAM and a number of other formats
+.TP
+count
+Prints number of alignments in BAM file(s)
+.TP
+coverage
+Prints coverage statistics from the input BAM file
+.TP
+filter
+Filters BAM file(s) by user\-specified criteria
+.TP
+header
+Prints BAM header information
+.TP
+index
+Generates index for BAM file
+.TP
+merge
+Merge multiple BAM files into single file
+.TP
+random
+Select random alignments from existing BAM file(s), intended more as a testing tool.
+.TP
+resolve
+Resolves paired\-end reads (marking the IsProperPair flag as needed)
+.TP
+revert
+Removes duplicate marks and restores original base qualities
+.TP
+sort
+Sorts the BAM file according to some criteria
+.TP
+split
+Splits a BAM file on user\-specified property, creating a new BAM output file for each value found
+.TP
+stats
+Prints some basic statistics from input BAM file(s)
+.PP
+See 'bamtools help COMMAND' for more information on a specific command.
diff --git a/debian/bamtools.install b/debian/bamtools.install
new file mode 100644
index 0000000..1df36c6
--- /dev/null
+++ b/debian/bamtools.install
@@ -0,0 +1 @@
+usr/bin/*
diff --git a/debian/bamtools.manpages b/debian/bamtools.manpages
new file mode 100644
index 0000000..e618c88
--- /dev/null
+++ b/debian/bamtools.manpages
@@ -0,0 +1 @@
+debian/bamtools.1
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..249595c
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,226 @@
+bamtools (2.5.1+dfsg-10) unstable; urgency=medium
+
+ * Team upload.
+ * Add gcc11.patch (Closes: 983981)
+ * Remove bamtools.lintian-overrides
+
+ -- Étienne Mollier <emollier@debian.org> Sat, 06 Nov 2021 19:31:45 +0100
+
+bamtools (2.5.1+dfsg-9) unstable; urgency=medium
+
+ [ Steffen Möller ]
+ * Update metadata - indent and ref to guix
+
+ [ Andreas Tille ]
+ * Extend means to prevent timeouts from amd64 also to armhf and s390x
+ Closes: #987023
+
+ -- Andreas Tille <tille@debian.org> Thu, 15 Apr 2021 21:28:36 +0200
+
+bamtools (2.5.1+dfsg-8) unstable; urgency=medium
+
+ * Exclude test that times out on arm64
+ Closes: #953939
+ * Standards-Version: 4.5.1 (routine-update)
+
+ -- Andreas Tille <tille@debian.org> Wed, 27 Jan 2021 08:26:37 +0100
+
+bamtools (2.5.1+dfsg-7) unstable; urgency=medium
+
+ * Override dh_auto_install-indep
+ Closes: #961777
+
+ -- Andreas Tille <tille@debian.org> Fri, 29 May 2020 13:00:25 +0200
+
+bamtools (2.5.1+dfsg-6) unstable; urgency=medium
+
+ * Add IsSupplementaryAlignment() patch from bamtools code copy shipped
+ with tiddit
+ * Standards-Version: 4.5.0 (routine-update)
+ * debhelper-compat 13 (routine-update)
+ * Add salsa-ci file (routine-update)
+ * Rules-Requires-Root: no (routine-update)
+ * Set upstream metadata fields: Bug-Submit.
+ * Use d-shlibs
+ * Build additional static lib
+
+ -- Andreas Tille <tille@debian.org> Wed, 27 May 2020 12:14:50 +0200
+
+bamtools (2.5.1+dfsg-5) unstable; urgency=medium
+
+ * Ignore one test that is known to fail on ppc64el architecture
+ Closes: #933505
+ * Set upstream metadata fields: Bug-Database, Repository, Repository-
+ Browse.
+
+ -- Andreas Tille <tille@debian.org> Tue, 10 Dec 2019 12:00:36 +0100
+
+bamtools (2.5.1+dfsg-4) unstable; urgency=medium
+
+ [ Jelmer Vernooij ]
+ * Trim trailing whitespace.
+
+ [ Andreas Tille ]
+ * debhelper-compat 12
+ * Standards-Version: 4.4.1
+ * Drop useless get-orig-source target
+ * Respect DEB_BUILD_OPTIONS in override_dh_auto_test target
+ * Trim trailing whitespace.
+ * Set upstream metadata fields: Repository.
+ * Remove obsolete fields Name from debian/upstream/metadata.
+
+ -- Andreas Tille <tille@debian.org> Thu, 10 Oct 2019 12:59:38 +0200
+
+bamtools (2.5.1+dfsg-3) unstable; urgency=medium
+
+ * Point Vcs fields to salsa.debian.org
+ * Use Breaks+Replaces: libbamtools2.4.0 (<< 2.5.1+dfsg-2~) since the
+ includes were formerly in lib package
+ Closes: #894886
+
+ -- Andreas Tille <tille@debian.org> Thu, 05 Apr 2018 11:54:57 +0200
+
+bamtools (2.5.1+dfsg-2) unstable; urgency=medium
+
+ * Move /usr/includes to -dev from libbamtools2.4.0
+ * debian/control: add Multi-Arch hints and remove unneeded ${devlibs:Depends}
+ * Build the shared library.
+ * drop 0002-support-out-of-source-build patch, as this was fixed differently
+ upstream
+ * Match upstream's soname change
+
+ -- Michael R. Crusoe <michael.crusoe@gmail.com> Tue, 03 Apr 2018 04:18:02 -0700
+
+bamtools (2.5.1+dfsg-1) unstable; urgency=medium
+
+ [ Andreas Tille ]
+ * New upstream version
+ * cme fix dpkg-control
+ * debhelper 11
+
+ [ Michael R. Crusoe ]
+ * Make release ready with cme fix dpkg
+ * fix built in tests
+ * debian/rules: remove unused variables; drop custom library install; add
+ hardening
+
+ -- Michael R. Crusoe <michael.crusoe@gmail.com> Mon, 02 Apr 2018 09:47:32 -0700
+
+bamtools (2.4.1+dfsg-2) unstable; urgency=medium
+
+ * Team upload.
+
+ [ Nadiya Sitdykova ]
+ * add autopkgtest test-suite
+
+ [ Afif Elghraoui ]
+ * remove unused lintian overrides
+
+ [ Steffen Moeller ]
+ * debian/upstream/metadata: Added refs to bio.tools and OMICtools
+ * debian/copyright: Corrected case of upstream name
+ * debian/control: Updated policy compliance to 4.0.1
+
+ -- Nadiya Sitdykova <rovenskasa@gmail.com> Mon, 07 Aug 2017 17:01:19 -0400
+
+bamtools (2.4.1+dfsg-1) unstable; urgency=medium
+
+ * New upstream version
+ * debhelper 10
+ * cme fix dpkg-control
+ * d/watch: version=4
+ * Priority: optional
+ * soversion stays at 2.4.0 (FIXME: in future versions this should
+ be rather 2.5 without micro number)
+
+ -- Andreas Tille <tille@debian.org> Fri, 13 Jan 2017 10:47:00 +0100
+
+bamtools (2.4.0+dfsg-6) unstable; urgency=medium
+
+ * Whoops, forgot the '+dfsg' in my fix for the movement of the development
+ docs into their own -doc package. Thanks go to Andreas Beckmann
+ <anbe@debian.org> for his patience and help. (Closes: 817188)
+
+ -- Michael R. Crusoe <crusoe@ucdavis.edu> Thu, 10 Mar 2016 01:38:21 -0800
+
+bamtools (2.4.0+dfsg-5) unstable; urgency=medium
+
+ * Fix the movement of the development docs into their own -doc package
+ (Closes: 817188)
+ * Fix another typo in upstream
+
+ -- Michael R. Crusoe <crusoe@ucdavis.edu> Wed, 09 Mar 2016 00:58:33 -0800
+
+bamtools (2.4.0+dfsg-4) unstable; urgency=medium
+
+ * Lower priority to 'extra' due to dependency on libjsoncpp1
+ * Split out -doc package for library documentation & enable standalone -arch
+ and -indep building
+ * Fix spelling error from upstream
+ * Update Standards-Version
+ * Update my email address
+ * Fix Vcs-Git URL
+ * Quiet some Doxygen warnings
+ * Add gcc-6 compat
+ * Include ${devlibs} for -dev package
+ * Forwarded many patches upstream
+ * Remove the html docs directory during d/rules clean
+
+ -- Michael R. Crusoe <crusoe@ucdavis.edu> Sat, 05 Mar 2016 09:07:48 -0800
+
+bamtools (2.4.0+dfsg-3) unstable; urgency=medium
+
+ * allows one to read bam files on big endian systems (Closes: #807979)
+ * added sam_spec_example.sam and sam_spec_example.bam files
+ * activated cmake testing framework abd added simple tests
+
+ -- Dominique Belhachemi <domibel@debian.org> Sun, 20 Dec 2015 15:41:42 -0500
+
+bamtools (2.4.0+dfsg-2) unstable; urgency=medium
+
+ [ Kevin Murray ]
+ * Fix re-upload confusion
+ * Fix build of doxygen docs, add docs-base
+ * Use uscan file renaming to name upstream tarball bamtools-Vxxx.tar.gz
+ * Refresh patch queue
+
+ [ Andreas Tille]
+ * Fix linitan overides for bamtools
+
+ -- Kevin Murray <spam@kdmurray.id.au> Thu, 24 Sep 2015 17:27:16 +1000
+
+bamtools (2.4.0+dfsg-1) unstable; urgency=medium
+
+ * New upstream version
+ * Fix d/watch + get-orig-source target
+ * Adapt library package name to version number
+
+ -- Andreas Tille <tille@debian.org> Sun, 05 Jul 2015 15:41:35 +0200
+
+bamtools (2.3.0+dfsg-3) unstable; urgency=medium
+
+ [ Michael R. Crusoe ]
+ * Make Doxygen documentation generation reproducible by eliminating
+ timestamps.
+
+ [ Andreas Tille ]
+ * Install cmake file
+ * Fix some issues in formatting of long descriptions (thanks for the patch
+ to Daniele Forsi <dforsi@gmail.com>)
+ Closes: #780437
+ * cme fix dpkg-control
+
+ -- Andreas Tille <tille@debian.org> Mon, 18 May 2015 11:53:14 +0200
+
+bamtools (2.3.0+dfsg-2) unstable; urgency=medium
+
+ * Drop d-shlibs patch and add versioned Build-Depends for d-shlibs
+ Closes: #753210
+
+ -- Andreas Tille <tille@debian.org> Mon, 30 Jun 2014 09:50:50 +0200
+
+bamtools (2.3.0+dfsg-1) unstable; urgency=low
+
+ * Initial release (Closes: #692498)
+
+ -- Andreas Tille <tille@debian.org> Wed, 02 Apr 2014 13:11:47 +0200
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 0000000..991c2c6
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1,5 @@
+bin/*
+lib/*
+include/*
+src/toolkit/bamtools_version.h
+html/
diff --git a/debian/cmake/bamtools/bamtools-config.cmake b/debian/cmake/bamtools/bamtools-config.cmake
new file mode 100644
index 0000000..eb0173f
--- /dev/null
+++ b/debian/cmake/bamtools/bamtools-config.cmake
@@ -0,0 +1,40 @@
+# - Config file for the BamTools package
+#################################################
+# Found at
+# https://bitbucket.org/lunacab/ccdeep/raw/229ad7adb3700eec272a6cce36966b458bdaaa7a/bamtools-config.cmake
+# Installed to /usr/share/cmake/bamtools
+# according to the advise given in #761516 which links to the doc
+# http://www.cmake.org/cmake/help/v2.8.12/cmake.html#command%3afind_package
+# Andreas Tille <tille@debian.org>
+#################################################
+# It defines the following variables
+# bamtools_FOUND - System has bamtols
+# bamtools_INCLUDE_DIRS - include directories for BamTools
+# bamtools_LIBRARIES - libraries to link against
+# bamtools_EXECUTABLE - the bar executable
+
+
+include(FindPackageHandleStandardArgs)
+find_path(bamtools_INCLUDE_DIR api/BamReader.h
+ HINTS ENV BAMTOOLS_INC
+ PATH_SUFFIXES bamtools
+ )
+
+find_library(bamtools_LIBRARY NAMES bamtools
+ HINTS ${CMAKE_SYSTEM_LIB_PATH}
+ PATH_SUFFIXES bamtools
+ )
+
+get_filename_component(bamtools_LIB_DIR ${bamtools_LIBRARY}
+ PATH)
+
+set(bamtools_LIBRARIES ${bamtools_LIB_DIR})
+set(bamtools_INCLUDE_DIRS ${bamtools_INCLUDE_DIR})
+get_filename_component(bamtools_REAL_LIBRARY ${bamtools_LIBRARY} REALPATH)
+get_filename_component(bamtools_LIB_FILE ${bamtools_REAL_LIBRARY} NAME)
+
+find_package_handle_standard_args(bamtools DEFAULT_MSG
+ bamtools_LIBRARY bamtools_INCLUDE_DIR)
+
+mark_as_advanced(bamtools_LIBRARY bamtools_INCLUDE_DIR )
+
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..48da485
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,111 @@
+Source: bamtools
+Maintainer: Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
+Uploaders: Michael R. Crusoe <michael.crusoe@gmail.com>,
+ Andreas Tille <tille@debian.org>,
+ Kevin Murray <spam@kdmurray.id.au>,
+ Dominique Belhachemi <domibel@debian.org>
+Section: science
+Priority: optional
+Build-Depends: debhelper-compat (= 13),
+ d-shlibs,
+ cmake,
+ zlib1g-dev,
+ libjsoncpp-dev,
+ help2man,
+ doxygen
+Standards-Version: 4.5.1
+Vcs-Browser: https://salsa.debian.org/med-team/bamtools
+Vcs-Git: https://salsa.debian.org/med-team/bamtools.git
+Homepage: https://github.com/pezmaster31/bamtools/wiki
+Rules-Requires-Root: no
+
+Package: bamtools
+Architecture: any
+Depends: ${shlibs:Depends},
+ ${misc:Depends}
+Description: toolkit for manipulating BAM (genome alignment) files
+ BamTools facilitates research analysis and data management using BAM
+ files. It copes with the enormous amount of data produced by current
+ sequencing technologies that is typically stored in compressed, binary
+ formats that are not easily handled by the text-based parsers commonly
+ used in bioinformatics research.
+ .
+ BamTools provides both a C++ API for BAM file support as well as a
+ command-line toolkit.
+ .
+ This is the bamtools command-line toolkit.
+ .
+ Available bamtools commands:
+ convert Converts between BAM and a number of other formats
+ count Prints number of alignments in BAM file(s)
+ coverage Prints coverage statistics from the input BAM file
+ filter Filters BAM file(s) by user-specified criteria
+ header Prints BAM header information
+ index Generates index for BAM file
+ merge Merge multiple BAM files into single file
+ random Select random alignments from existing BAM file(s), intended more
+ as a testing tool.
+ resolve Resolves paired-end reads (marking the IsProperPair flag as needed)
+ revert Removes duplicate marks and restores original base qualities
+ sort Sorts the BAM file according to some criteria
+ split Splits a BAM file on user-specified property, creating a new BAM
+ output file for each value found
+ stats Prints some basic statistics from input BAM file(s)
+
+Package: libbamtools-dev
+Architecture: any
+Multi-Arch: same
+Section: libdevel
+Depends: libbamtools2.5.1 (= ${binary:Version}),
+ ${misc:Depends}
+Suggests: libbamtools-doc (= ${binary:Version})
+Breaks: libbamtools2.4.0 (<< 2.5.1+dfsg-2~)
+Replaces: libbamtools2.4.0 (<< 2.5.1+dfsg-2~)
+Description: C++ API for manipulating BAM (genome alignment) files
+ BamTools facilitates research analysis and data management using BAM
+ files. It copes with the enormous amount of data produced by current
+ sequencing technologies that is typically stored in compressed, binary
+ formats that are not easily handled by the text-based parsers commonly
+ used in bioinformatics research.
+ .
+ BamTools provides both a C++ API for BAM file support as well as a
+ command-line toolkit.
+ .
+ This is the developers API package.
+
+Package: libbamtools2.5.1
+Architecture: any
+Multi-Arch: same
+Section: libs
+Depends: ${shlibs:Depends},
+ ${misc:Depends}
+Description: dynamic library for manipulating BAM (genome alignment) files
+ BamTools facilitates research analysis and data management using BAM
+ files. It copes with the enormous amount of data produced by current
+ sequencing technologies that is typically stored in compressed, binary
+ formats that are not easily handled by the text-based parsers commonly
+ used in bioinformatics research.
+ .
+ BamTools provides both a C++ API for BAM file support as well as a
+ command-line toolkit.
+ .
+ This is the runtime library.
+
+Package: libbamtools-doc
+Architecture: all
+Multi-Arch: foreign
+Section: doc
+Depends: ${misc:Depends}
+Breaks: libbamtools-dev (<< 2.4.0+dsfg-6)
+Replaces: libbamtools-dev (<< 2.4.0+dfsg-6)
+Description: docs for dynamic library for manipulating BAM (genome alignment) files
+ BamTools facilitates research analysis and data management using BAM
+ files. It copes with the enormous amount of data produced by current
+ sequencing technologies that is typically stored in compressed, binary
+ formats that are not easily handled by the text-based parsers commonly
+ used in bioinformatics research.
+ .
+ BamTools provides both a C++ API for BAM file support as well as a
+ command-line toolkit.
+ .
+ This is the documentation for the library.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..27c306b
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,37 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: BamTools
+Source: https://github.com/pezmaster31/bamtools
+Files-Excluded: src/third_party
+
+Files: *
+Copyright: 2009-2012 Derek Barnett <derekwbarnett@gmail.com>
+ 2009-2010 Erik Garrison
+ 2009-2010 Gabor Marth
+ 2009-2010 Michael Stromberg
+License: Expat
+
+Files: debian/*
+Copyright: 2012 Michael R. Crusoe <michael.crusoe@gmail.com>
+ 2014 Andreas Tille <tille@debian.org>
+ 2015 Kevin Murray <spam@kdmurray.id.au>
+ 2012,2015 Dominique Belhachemi <domibel@debian.org>
+License: Expat
+
+License: Expat
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
diff --git a/debian/createmanpages b/debian/createmanpages
new file mode 100755
index 0000000..8991d38
--- /dev/null
+++ b/debian/createmanpages
@@ -0,0 +1,9 @@
+#!/bin/sh
+MANDIR=debian
+mkdir -p $MANDIR
+
+VERSION=`dpkg-parsechangelog | awk '/^Version:/ {print $2}' | sed -e 's/^[0-9]*://' -e 's/-.*//'`
+
+help2man --no-info --no-discard-stderr --help-option=" " \
+ --name='<optional description of the program>' \
+ --version-string="$VERSION" bamtools > $MANDIR/bamtools.1
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..6b01fc1
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,4 @@
+debian/README.test
+debian/tests/run-unit-test
+debian/tests/filter_script
+debian/sam_spec_example.bam
diff --git a/debian/libbamtools-dev.install b/debian/libbamtools-dev.install
new file mode 100644
index 0000000..7687141
--- /dev/null
+++ b/debian/libbamtools-dev.install
@@ -0,0 +1 @@
+debian/cmake usr/share
diff --git a/debian/libbamtools-doc.doc-base b/debian/libbamtools-doc.doc-base
new file mode 100644
index 0000000..8c76853
--- /dev/null
+++ b/debian/libbamtools-doc.doc-base
@@ -0,0 +1,9 @@
+Document: libbamtools-dev
+Title: Bamtools C++ API Documentation
+Author: Derek Barnett <derekwbarnett@gmail.com>
+Abstract: The Doxygen-generated API documentation for the bamtools C++ library
+Section: Debian
+
+Format: HTML
+Index: /usr/share/doc/libbamtools-dev/html/index.html
+Files: /usr/share/doc/libbamtools-dev/html/*.html
diff --git a/debian/libbamtools-doc.install b/debian/libbamtools-doc.install
new file mode 100644
index 0000000..c49fe91
--- /dev/null
+++ b/debian/libbamtools-doc.install
@@ -0,0 +1 @@
+html usr/share/doc/libbamtools-dev
diff --git a/debian/libbamtools.docs b/debian/libbamtools.docs
new file mode 100644
index 0000000..e845566
--- /dev/null
+++ b/debian/libbamtools.docs
@@ -0,0 +1 @@
+README
diff --git a/debian/patches/0001-ignore-thirdparty-and-fix-jsoncpp.patch b/debian/patches/0001-ignore-thirdparty-and-fix-jsoncpp.patch
new file mode 100644
index 0000000..65b0d77
--- /dev/null
+++ b/debian/patches/0001-ignore-thirdparty-and-fix-jsoncpp.patch
@@ -0,0 +1,42 @@
+From: Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
+Date: Wed, 7 Nov 2012 18:44:06 -0700
+Subject: ignore-thirdparty-and-fix-jsoncpp
+
+---
+ src/CMakeLists.txt | 2 +-
+ src/toolkit/CMakeLists.txt | 1 -
+ src/toolkit/bamtools_filter.cpp | 2 +-
+ 3 files changed, 2 insertions(+), 3 deletions(-)
+
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -6,7 +6,7 @@
+ # ==========================
+
+ add_subdirectory( api )
+-add_subdirectory( third_party )
++#add_subdirectory( third_party )
+ add_subdirectory( toolkit )
+ add_subdirectory( utils )
+
+--- a/src/toolkit/CMakeLists.txt
++++ b/src/toolkit/CMakeLists.txt
+@@ -8,7 +8,6 @@
+ # set include path
+ include_directories( ${BamTools_SOURCE_DIR}/src/api
+ ${BamTools_SOURCE_DIR}/src/utils
+- ${BamTools_SOURCE_DIR}/src/third_party
+ )
+
+ # compile main bamtools application
+--- a/src/toolkit/bamtools_filter.cpp
++++ b/src/toolkit/bamtools_filter.cpp
+@@ -16,7 +16,7 @@
+ #include <utils/bamtools_utilities.h>
+ using namespace BamTools;
+
+-#include <json/json.h>
++#include <jsoncpp/json/json.h>
+ using namespace Json;
+
+ #include <cstdio>
diff --git a/debian/patches/0003-remove-custom-ExportHeader-function-use-install-inst.patch b/debian/patches/0003-remove-custom-ExportHeader-function-use-install-inst.patch
new file mode 100644
index 0000000..684ea0f
--- /dev/null
+++ b/debian/patches/0003-remove-custom-ExportHeader-function-use-install-inst.patch
@@ -0,0 +1,104 @@
+From: Dominique Belhachemi <domibel@debian.org>
+Date: Fri, 19 Oct 2012 11:35:52 -0400
+Subject: remove custom ExportHeader function, use install instead
+
+---
+ src/CMakeLists.txt | 5 +----
+ src/ExportHeader.cmake | 27 ---------------------------
+ src/api/CMakeLists.txt | 42 +++++++++++++++++++-----------------------
+ src/toolkit/CMakeLists.txt | 3 +++
+ 4 files changed, 23 insertions(+), 54 deletions(-)
+ delete mode 100644 src/ExportHeader.cmake
+
+--- a/src/api/CMakeLists.txt
++++ b/src/api/CMakeLists.txt
+@@ -51,27 +51,23 @@ install( TARGETS BamTools
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" )
+
+-# export API headers
+-include(../ExportHeader.cmake)
+-set(ApiIncludeDir "api")
+-ExportHeader(APIHeaders api_global.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders BamAlgorithms.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders BamAlignment.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders BamAux.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders BamConstants.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders BamIndex.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders BamMultiReader.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders BamReader.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders BamWriter.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders IBamIODevice.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders SamConstants.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders SamHeader.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders SamProgram.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders SamProgramChain.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders SamReadGroup.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders SamReadGroupDictionary.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders SamSequence.h ${ApiIncludeDir})
+-ExportHeader(APIHeaders SamSequenceDictionary.h ${ApiIncludeDir})
++install( FILES api_global.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES BamAlgorithms.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES BamAlignment.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES BamAux.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES BamConstants.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES BamIndex.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES BamMultiReader.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES BamReader.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES BamWriter.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES IBamIODevice.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES SamConstants.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES SamHeader.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES SamProgram.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES SamProgramChain.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES SamReadGroup.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES SamReadGroupDictionary.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES SamSequence.h DESTINATION "include/bamtools/api" COMPONENT Development )
++install( FILES SamSequenceDictionary.h DESTINATION "include/bamtools/api" COMPONENT Development )
+
+-set( AlgorithmsIncludeDir "api/algorithms" )
+-ExportHeader( AlgorithmsHeaders algorithms/Sort.h ${AlgorithmsIncludeDir} )
++install( FILES algorithms/Sort.h DESTINATION "include/bamtools/api/algorithms" COMPONENT Development )
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -11,9 +11,7 @@ add_subdirectory( toolkit )
+ add_subdirectory( utils )
+
+ # export shared headers
+-include( ExportHeader.cmake )
+-set( SharedIncludeDir "shared" )
+-ExportHeader( SharedHeaders shared/bamtools_global.h ${SharedIncludeDir} )
++install( FILES shared/bamtools_global.h DESTINATION "include/bamtools/shared" COMPONENT Development )
+
+ # configure and install pkg-config file
+ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/bamtools.pc.in ${CMAKE_CURRENT_BINARY_DIR}/bamtools-1.pc @ONLY )
+--- a/src/ExportHeader.cmake
++++ b/src/ExportHeader.cmake
+@@ -1,27 +0,0 @@
+-#
+-# ExportHeader
+-#
+-
+-function( ExportHeader MODULE FILE DEST )
+-
+- # if haven't defined our custom 'build target'
+- # not exactly a build target, but lets this command get
+- # checked any time build step happens
+- if( NOT TARGET ${MODULE} )
+- add_custom_target( ${MODULE} ALL COMMENT "Exporting ${MODULE}" )
+- endif( NOT TARGET ${MODULE} )
+-
+- # get the filename (without path)
+- get_filename_component( FILENAME "${FILE}" NAME )
+-
+- # copy header to destination
+- add_custom_command( TARGET ${MODULE} COMMAND
+- ${CMAKE_COMMAND} -E copy_if_different
+- "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}"
+- "${CMAKE_CURRENT_BINARY_DIR}/include/${DEST}/${FILENAME}" )
+-
+- # make sure files are properly 'installed'
+- install( FILES "${FILE}" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/bamtools/${DEST}" )
+-
+-endfunction( ExportHeader )
+-
diff --git a/debian/patches/0006-Doxygen-reproducibility b/debian/patches/0006-Doxygen-reproducibility
new file mode 100644
index 0000000..9122f19
--- /dev/null
+++ b/debian/patches/0006-Doxygen-reproducibility
@@ -0,0 +1,19 @@
+From: Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
+Date: Thu, 24 Sep 2015 17:25:24 +1000
+Subject: Doxygen-reproducibility
+
+---
+ docs/Doxyfile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/docs/Doxyfile
++++ b/docs/Doxyfile
+@@ -853,7 +853,7 @@ HTML_STYLESHEET =
+ # page will contain the date and time when the page was generated. Setting
+ # this to NO can help when comparing the output of multiple runs.
+
+-HTML_TIMESTAMP = YES
++HTML_TIMESTAMP = NO
+
+ # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+ # files or namespaces will be aligned in HTML using tables. If set to
diff --git a/debian/patches/0008_Cmake_Test.patch b/debian/patches/0008_Cmake_Test.patch
new file mode 100644
index 0000000..77620df
--- /dev/null
+++ b/debian/patches/0008_Cmake_Test.patch
@@ -0,0 +1,27 @@
+Description: run simple test after compilation
+ The test suite can be extended once we add some small and simple bam files.
+Author: Dominique Belhachemi <domibel@debian.org>
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -15,6 +15,8 @@ cmake_policy( SET CMP0048 NEW )
+ # set project name and version
+ project( BamTools LANGUAGES CXX VERSION 2.5.1 )
+
++enable_testing()
++
+ # on macOS, MACOSX_RPATH is enabled by default on more recent versions
+ # of CMake. Disable this behaviour, and let user enable it if need be.
+ cmake_policy( SET CMP0042 OLD )
+@@ -97,3 +99,11 @@ include_directories( src )
+
+ # list subdirectories to build in
+ add_subdirectory( src )
++
++add_test(NAME bamtools_help
++ COMMAND bin/bamtools --help
++)
++
++add_test(NAME bamtools_stats
++ COMMAND bin/bamtools stats -in ${CMAKE_BINARY_DIR}/../debian/sam_spec_example.bam
++)
diff --git a/debian/patches/doxygen-tweak b/debian/patches/doxygen-tweak
new file mode 100644
index 0000000..b02f152
--- /dev/null
+++ b/debian/patches/doxygen-tweak
@@ -0,0 +1,37 @@
+From: Michael R. Crusoe <crusoe@ucdavis.edu>
+Subject: fixes a couple Doxygen warnings
+Forwarded: https://github.com/pezmaster31/bamtools/pull/120
+
+--- a/src/api/BamAlignment.h
++++ b/src/api/BamAlignment.h
+@@ -149,12 +149,13 @@ private:
+ bool IsValidSize(const std::string& tag, const std::string& type) const;
+ void SetErrorString(const std::string& where, const std::string& what) const;
+ bool SkipToNextTag(const char storageType, char*& pTagData, unsigned int& numBytesParsed) const;
+-
++ //! \internal
+ // internal data
+ private:
+ struct BamAlignmentSupportData
+ {
+
++ //! \internal
+ // data members
+ std::string AllCharData;
+ uint32_t BlockLength;
+@@ -163,6 +164,7 @@ private:
+ uint32_t QuerySequenceLength;
+ bool HasCoreOnly;
+
++ //! \internal
+ // constructor
+ BamAlignmentSupportData()
+ : BlockLength(0)
+@@ -177,7 +179,6 @@ private:
+ friend class Internal::BamWriterPrivate;
+
+ mutable std::string ErrorString; // mutable to allow updates even in logically const methods
+- //! \endinternal
+ };
+
+ // ---------------------------------------------------------
diff --git a/debian/patches/gcc11.patch b/debian/patches/gcc11.patch
new file mode 100644
index 0000000..2ea9d13
--- /dev/null
+++ b/debian/patches/gcc11.patch
@@ -0,0 +1,56 @@
+Description: force comparison operator() const, fixing ftbfs with gcc-11
+Author: Étienne Mollier <emollier@debian.org>
+Bug-Debian: https://bugs.debian.org/983981
+Forwarded: not-needed
+Last-Update: 2021-11-06
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- bamtools.orig/src/api/internal/bam/BamMultiMerger_p.h
++++ bamtools/src/api/internal/bam/BamMultiMerger_p.h
+@@ -62,7 +62,7 @@
+ : m_comp(comp)
+ {}
+
+- bool operator()(const MergeItem& lhs, const MergeItem& rhs)
++ bool operator()(const MergeItem& lhs, const MergeItem& rhs) const
+ {
+ const BamAlignment& l = *lhs.Alignment;
+ const BamAlignment& r = *rhs.Alignment;
+--- bamtools.orig/src/api/algorithms/Sort.h
++++ bamtools/src/api/algorithms/Sort.h
+@@ -89,7 +89,7 @@
+ {}
+
+ // comparison function
+- bool operator()(const BamTools::BamAlignment& lhs, const BamTools::BamAlignment& rhs)
++ bool operator()(const BamTools::BamAlignment& lhs, const BamTools::BamAlignment& rhs) const
+ {
+ return sort_helper(m_order, lhs.Name, rhs.Name);
+ }
+@@ -130,7 +130,7 @@
+ {}
+
+ // comparison function
+- bool operator()(const BamTools::BamAlignment& lhs, const BamTools::BamAlignment& rhs)
++ bool operator()(const BamTools::BamAlignment& lhs, const BamTools::BamAlignment& rhs) const
+ {
+
+ // force unmapped aligmnents to end
+@@ -182,7 +182,7 @@
+ {}
+
+ // comparison function
+- bool operator()(const BamTools::BamAlignment& lhs, const BamTools::BamAlignment& rhs)
++ bool operator()(const BamTools::BamAlignment& lhs, const BamTools::BamAlignment& rhs) const
+ {
+
+ // force alignments without tag to end
+@@ -222,7 +222,7 @@
+ {
+
+ // comparison function
+- inline bool operator()(const BamTools::BamAlignment&, const BamTools::BamAlignment&)
++ inline bool operator()(const BamTools::BamAlignment&, const BamTools::BamAlignment&) const
+ {
+ return false; // returning false tends to retain insertion order
+ }
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..88c96ba
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,9 @@
+doxygen-tweak
+0001-ignore-thirdparty-and-fix-jsoncpp.patch
+0003-remove-custom-ExportHeader-function-use-install-inst.patch
+0006-Doxygen-reproducibility
+0008_Cmake_Test.patch
+spelling
+tiddit.patch
+shared_and_static.patch
+gcc11.patch
diff --git a/debian/patches/shared_and_static.patch b/debian/patches/shared_and_static.patch
new file mode 100644
index 0000000..9bf01ac
--- /dev/null
+++ b/debian/patches/shared_and_static.patch
@@ -0,0 +1,32 @@
+Description: Build additional static lib
+Author: Andreas Tille <tille@debian.org>
+Last-Update: Wed, 27 May 2020 09:59:29 +0200
+
+--- a/src/api/CMakeLists.txt
++++ b/src/api/CMakeLists.txt
+@@ -38,18 +38,24 @@ if( WIN32 )
+ endif()
+
+ # create main BamTools API library
+-add_library( BamTools ${BamToolsAPISources} )
++add_library( BamTools SHARED ${BamToolsAPISources} )
++add_library( BamTools_static STATIC ${BamToolsAPISources} )
+ # The SONAME is bumped on every version increment
+ # as Bamtools does not yet guarantee a stable ABI
+ set_target_properties( BamTools PROPERTIES
+ SOVERSION "${BamTools_VERSION}"
+ OUTPUT_NAME "bamtools" )
++set_target_properties( BamTools_static PROPERTIES
++ OUTPUT_NAME "bamtools" )
+ target_include_directories( BamTools PRIVATE "${ZLIB_INCLUDE_DIRS}" )
+ target_link_libraries( BamTools PRIVATE "${ZLIB_LIBRARIES}" "${WIN32_LIBRARIES}" )
+ install( TARGETS BamTools
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" )
++install( TARGETS BamTools_static
++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" )
+
+ install( FILES api_global.h DESTINATION "include/bamtools/api" COMPONENT Development )
+ install( FILES BamAlgorithms.h DESTINATION "include/bamtools/api" COMPONENT Development )
diff --git a/debian/patches/spelling b/debian/patches/spelling
new file mode 100644
index 0000000..8fc861c
--- /dev/null
+++ b/debian/patches/spelling
@@ -0,0 +1,15 @@
+From: Michael R. Crusoe <crusoe@ucdavis.edu>
+Subject: Fix typo
+Forwarded: https://github.com/pezmaster31/bamtools/pull/122
+
+--- a/src/toolkit/bamtools_resolve.cpp
++++ b/src/toolkit/bamtools_resolve.cpp
+@@ -928,7 +928,7 @@ bool ResolveTool::ResolveToolPrivate::Ch
+ // make sure required stats file supplied
+ if (!m_settings->HasStatsFile)
+ errors.push_back(
+- "Ouptut stats filename required for -makeStats mode. Please specify one using "
++ "Output stats filename required for -makeStats mode. Please specify one using "
+ "-stats option.");
+
+ // check for UseStats options
diff --git a/debian/patches/tiddit.patch b/debian/patches/tiddit.patch
new file mode 100644
index 0000000..ca694e6
--- /dev/null
+++ b/debian/patches/tiddit.patch
@@ -0,0 +1,41 @@
+Description: Add IsSupplementaryAlignment() patch from bamtools code copy
+ shipped with tiddit
+Author: Andreas Tille <tille@debian.org>
+Last-Update: Wed, 27 May 2020 09:59:29 +0200
+
+--- a/src/api/BamAlignment.h
++++ b/src/api/BamAlignment.h
+@@ -53,6 +53,7 @@ public:
+ const; // returns true if alignment is part of read that satisfied paired-end resolution
+ bool IsReverseStrand() const; // returns true if alignment mapped to reverse strand
+ bool IsSecondMate() const; // returns true if alignment is second mate on read
++ bool IsSupplementaryAlignment(void) const; // Additional patch by tiddit package
+
+ // manipulate alignment flags
+ public:
+--- a/src/api/BamConstants.h
++++ b/src/api/BamConstants.h
+@@ -43,6 +43,7 @@ const int BAM_ALIGNMENT_READ_2 = 0x0080;
+ const int BAM_ALIGNMENT_SECONDARY = 0x0100;
+ const int BAM_ALIGNMENT_QC_FAILED = 0x0200;
+ const int BAM_ALIGNMENT_DUPLICATE = 0x0400;
++const int SUPPLEMENTARY = 0x0800; // Additional patch by tiddit package
+
+ // CIGAR constants
+ const char* const BAM_CIGAR_LOOKUP = "MIDNSHP=X";
+--- a/src/api/BamAlignment.cpp
++++ b/src/api/BamAlignment.cpp
+@@ -822,6 +822,13 @@ bool BamAlignment::IsSecondMate() const
+ return ((AlignmentFlag & Constants::BAM_ALIGNMENT_READ_2) != 0);
+ }
+
++/*! \fn bool BamAlignment::IsSupplementaryAlignment() const
++ \return \c true if ailgnment is supplementary (This is an additional patch by tiddit package)
++ */
++bool BamAlignment::IsSupplementaryAlignment(void) const {
++ return ( (AlignmentFlag & Constants::SUPPLEMENTARY) != 0 );
++}
++
+ /*! \fn bool BamAlignment::IsValidSize(const std::string& tag, const std::string& type) const
+ \internal
+
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..c1ceeba
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,43 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow
+
+%:
+ dh $@
+
+override_dh_auto_test-indep:
+
+override_dh_auto_test-arch:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+ cd obj-* && ln -s src/toolkit/ bin
+ dh_auto_test --arch
+endif
+
+override_dh_auto_build-indep:
+ doxygen -u docs/Doxyfile
+ doxygen docs/Doxyfile
+ mv docs/Doxyfile.bak docs/Doxyfile
+
+override_dh_auto_install-indep:
+
+override_dh_install-arch:
+ dh_install --arch
+ d-shlibmove --commit \
+ --multiarch \
+ --devunversioned \
+ --exclude-la \
+ --movedev debian/tmp/usr/include/* usr/include \
+ --movedev "debian/tmp/usr/lib/*/pkgconfig/*.pc" usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \
+ debian/tmp/usr/lib/*/*.so
+
+override_dh_install-indep:
+ dh_install --indep
+ rm -f debian/libbamtools-doc/usr/share/doc/libbamtools-dev/html/jquery.js
+ ln -s /usr/share/javascript/jquery/jquery.js debian/libbamtools-doc/usr/share/doc/libbamtools-dev/html/jquery.js
+
+describe-current-version:
+ git describe --tags upstream | sed 's,^release-,,;s,-,+,;s,-,~,;'
diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml
new file mode 100644
index 0000000..33c3a64
--- /dev/null
+++ b/debian/salsa-ci.yml
@@ -0,0 +1,4 @@
+---
+include:
+ - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
+ - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
diff --git a/debian/sam_spec_example.bam b/debian/sam_spec_example.bam
new file mode 100644
index 0000000..7e460a1
--- /dev/null
+++ b/debian/sam_spec_example.bam
Binary files differ
diff --git a/debian/sam_spec_example.sam b/debian/sam_spec_example.sam
new file mode 100644
index 0000000..01490f5
--- /dev/null
+++ b/debian/sam_spec_example.sam
@@ -0,0 +1,8 @@
+@HD VN:1.5 SO:coordinate
+@SQ SN:ref LN:45
+r001 99 ref 7 30 8M2I4M1D3M = 37 39 TTAGATAAAGGATACTG *
+r002 0 ref 9 30 3S6M1P1I4M * 0 0 AAAAGATAAGGATA *
+r003 0 ref 9 30 5S6M * 0 0 GCCTAAGCTAA * SA:Z:ref,29,-,6H5M,17,0;
+r004 0 ref 16 30 6M14N5M * 0 0 ATAGCTTCAGC *
+r003 2064 ref 29 17 6H5M * 0 0 TAGGC * SA:Z:ref,9,+,5S6M,30,1;
+r001 147 ref 37 30 9M = 7 -39 CAGCGGCAT * NM:i:1
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/source/include-binaries b/debian/source/include-binaries
new file mode 100644
index 0000000..130b83c
--- /dev/null
+++ b/debian/source/include-binaries
@@ -0,0 +1 @@
+debian/sam_spec_example.bam
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..d2aa55a
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: run-unit-test
+Depends: @
+Restrictions: allow-stderr
diff --git a/debian/tests/filter_script b/debian/tests/filter_script
new file mode 100644
index 0000000..e30f78c
--- /dev/null
+++ b/debian/tests/filter_script
@@ -0,0 +1,17 @@
+{
+ "filters" :
+ [
+ { "id" : "inAnyErrorReadGroup",
+ "tag" : "RG:ERR*"
+ },
+ { "id" : "highMapQuality",
+ "mapQuality" : ">=75"
+ },
+ { "id" : "bothMatesMapped",
+ "isMapped" : "true",
+ "isMateMapped" : "true"
+ }
+ ],
+ "rule" : "!inAnyErrorReadGroup & (highMapQuality | bothMatesMapped)"
+}
+
diff --git a/debian/tests/run-unit-test b/debian/tests/run-unit-test
new file mode 100644
index 0000000..ba0c242
--- /dev/null
+++ b/debian/tests/run-unit-test
@@ -0,0 +1,49 @@
+#!/bin/sh -e
+
+pkg=bamtools
+
+if [ "$AUTOPKGTEST_TMP" = "" ] ; then
+ AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+ trap "rm -rf $AUTOPKGTEST_TMP" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cd $AUTOPKGTEST_TMP
+
+cp -a /usr/share/doc/${pkg}/sam_spec_example.bam .
+cp -a /usr/share/doc/${pkg}/filter_script .
+gunzip -r *
+
+bamtools convert -format fastq -in sam_spec_example.bam -out test.fastq
+
+bamtools convert -format json -in sam_spec_example.bam -out test.json
+
+bamtools count -in sam_spec_example.bam
+
+bamtools coverage -in sam_spec_example.bam -out out
+
+# This test fails on ppc64el for whatever reason and is for the moment (see bug #933505)
+ARCH=$(dpkg --print-architecture)
+if [ "$ARCH" != "ppc64el" -a "$ARCH" != "arm64" -a "$ARCH" != "armhf" -a "$ARCH" != "s390x" ] ; then
+ bamtools filter -script filter_script -in sam_spec_example.bam -out out.bam
+else
+ if [ "$ARCH" = "ppc64el" ] ; then
+ echo "The following test is known to fail on ppc64el architecture (see bug #933505)"
+ else
+ echo "The following test is known to time out on $ARCH architecture (see bug #953939)"
+ fi
+ echo "bamtools filter -script filter_script -in sam_spec_example.bam -out out.bam"
+fi
+
+bamtools header -in sam_spec_example.bam
+
+bamtools index -in sam_spec_example.bam
+
+bamtools random -n 100 -in sam_spec_example.bam -out out.bam
+
+bamtools revert -in sam_spec_example.bam -out out.bam
+
+bamtools sort -in sam_spec_example.bam -out out.bam
+
+bamtools split -mapped -in sam_spec_example.bam
+
+bamtools stats -in sam_spec_example.bam
diff --git a/debian/upstream/metadata b/debian/upstream/metadata
new file mode 100644
index 0000000..d9e0894
--- /dev/null
+++ b/debian/upstream/metadata
@@ -0,0 +1,31 @@
+Bug-Submit: https://github.com/pezmaster31/bamtools/issues/new
+Reference:
+ - Author: >
+ Derek W. Barnett and Erik K. Garrison and Aaron R. Quinlan and
+ Michael P. Stromberg and Gabor T. Marth
+ Title: >
+ BamTools: a C++ API and toolkit for analyzing and managing BAM files
+ Journal: Bioinformatics
+ Year: 2011
+ Volume: 27
+ Number: 12
+ Pages: 1691-2
+ DOI: 10.1093/bioinformatics/btr174
+ PMID: 21493652
+ URL: http://bioinformatics.oxfordjournals.org/content/27/12/1691
+ eprint: >
+ http://bioinformatics.oxfordjournals.org/content/27/12/1691.full.pdf+html
+Registry:
+ - Name: OMICtools
+ Entry: OMICS_11315
+ - Name: SciCrunch
+ Entry: SCR_015987
+ - Name: bio.tools
+ Entry: BamTools
+ - Name: conda:bioconda
+ Entry: bamtools
+ - Name: guix
+ Entry: bamtools
+Repository: https://github.com/pezmaster31/bamtools.git
+Bug-Database: https://github.com/pezmaster31/bamtools/issues
+Repository-Browse: https://github.com/pezmaster31/bamtools
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..4ba1cf9
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,4 @@
+version=4
+
+opts="repacksuffix=+dfsg,dversionmangle=s/\+dfsg.*//,filenamemangle=s/(?:.*?)?v?(\d[\d.]*)\.tar\.gz/bamtools-$1.tar.gz/" \
+https://github.com/pezmaster31/bamtools/tags .*/v?(\d[\d\.]+)\.tar\.gz