summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--debian/.gitignore6
-rw-r--r--debian/README.source4
-rw-r--r--debian/changelog117
-rw-r--r--debian/compat1
-rw-r--r--debian/control35
-rw-r--r--debian/copyright27
-rw-r--r--debian/docs1
-rwxr-xr-xdebian/efetch254
-rwxr-xr-xdebian/einfo243
-rw-r--r--debian/examples3
-rw-r--r--debian/install1
-rw-r--r--debian/man/amino-acid-composition.131
-rw-r--r--debian/man/between-two-genes.121
-rw-r--r--debian/man/eaddress.125
-rw-r--r--debian/man/ecitmatch.142
-rw-r--r--debian/man/econtact.130
-rw-r--r--debian/man/edirect.186
-rw-r--r--debian/man/edirutil.152
-rw-r--r--debian/man/efetch.1115
-rw-r--r--debian/man/efilter.1137
-rw-r--r--debian/man/einfo.154
-rw-r--r--debian/man/elink.185
-rw-r--r--debian/man/enotify.125
-rw-r--r--debian/man/entrez-phrase-search.147
-rw-r--r--debian/man/epost.141
-rw-r--r--debian/man/eproxy.126
-rw-r--r--debian/man/esearch.167
-rw-r--r--debian/man/espell.125
-rw-r--r--debian/man/esummary.11
-rw-r--r--debian/man/filter-stop-words.115
-rw-r--r--debian/man/ftp-cp.115
-rw-r--r--debian/man/ftp-ls.122
-rw-r--r--debian/man/gbf2xml.121
-rw-r--r--debian/man/join-into-groups-of.112
-rw-r--r--debian/man/nquire.140
-rw-r--r--debian/man/reorder-columns.118
-rw-r--r--debian/man/run-ncbi-converter.125
-rw-r--r--debian/man/sort-uniq-count-rank.11
-rw-r--r--debian/man/sort-uniq-count.148
-rw-r--r--debian/man/word-at-a-time.112
-rw-r--r--debian/man/xtract.1469
-rw-r--r--debian/man/xy-plot.119
-rw-r--r--debian/manpages1
-rw-r--r--debian/patches/debian-changes43
-rw-r--r--debian/patches/series1
-rwxr-xr-xdebian/postrm12
-rwxr-xr-xdebian/preinst19
-rwxr-xr-xdebian/rules62
-rw-r--r--debian/source/format1
-rw-r--r--debian/source/options1
-rw-r--r--debian/watch4
-rwxr-xr-xxtract.pl2
53 files changed, 2466 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9a3fd79
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+.pc
+bin
diff --git a/debian/.gitignore b/debian/.gitignore
new file mode 100644
index 0000000..f56bb4b
--- /dev/null
+++ b/debian/.gitignore
@@ -0,0 +1,6 @@
+debhelper-build-stamp
+files
+gopath
+ncbi-entrez-direct.debhelper.log
+ncbi-entrez-direct.substvars
+ncbi-entrez-direct/
diff --git a/debian/README.source b/debian/README.source
new file mode 100644
index 0000000..cd0c833
--- /dev/null
+++ b/debian/README.source
@@ -0,0 +1,4 @@
+Removed convenience copy of Mozilla::CA, which is free but not needed
+here and would complicate debian/copyright.
+
+ -- Aaron M. Ucko <ucko@debian.org>, Fri, 23 Dec 2016 16:16:03 -0500
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..97a4041
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,117 @@
+ncbi-entrez-direct (7.10.20170810+ds-1) UNRELEASED; urgency=medium
+
+ * New upstream release. (NOT YET RELEASED.)
+ * debian/man/{efilter,esearch}.1: Update accordingly.
+
+ -- Aaron M. Ucko <ucko@debian.org> Thu, 05 Oct 2017 20:48:36 -0400
+
+ncbi-entrez-direct (6.90.20170705+ds-2) unstable; urgency=medium
+
+ * debian/rules: Rework Go-related logic to accommodate builds on
+ (non-release) architectures on which I've had to conditionalize out
+ the relevant build dependencies.
+
+ -- Aaron M. Ucko <ucko@debian.org> Thu, 06 Jul 2017 22:25:05 -0400
+
+ncbi-entrez-direct (6.90.20170705+ds-1) unstable; urgency=medium
+
+ * New upstream release.
+ * debian/compat: Advance to debhelper 10.
+ * debian/control:
+ - Advance debhelper build dependency accordingly.
+ - Reinstate architecture qualifiers for Go build dependencies on the
+ basis of experimental build logs.
+ - Standards-Version: 4.0.0 (already compliant).
+ * debian/man/{ftp-cp,gbf2xml}.1: Correct syntax for optional filenames.
+ * debian/man/xtract.1: Update for new release.
+
+ -- Aaron M. Ucko <ucko@debian.org> Wed, 05 Jul 2017 22:12:35 -0400
+
+ncbi-entrez-direct (6.80.20170608+ds-1) experimental; urgency=medium
+
+ * New upstream release.
+ * debian/man/ftp-cp.1: Update accordingly.
+ * Install the new asp-ls script as an example (alongside asp-cp) and
+ the new gbf2xml script as an executable; give gbf2xml a man page.
+
+ -- Aaron M. Ucko <ucko@debian.org> Fri, 09 Jun 2017 18:01:55 -0400
+
+ncbi-entrez-direct (6.70.20170508+ds-1) experimental; urgency=medium
+
+ * New upstream release.
+ * debian/man/xtract.1: Update accordingly.
+ * debian/control:
+ - Tighten Go dependencies to require Go 1.8 for sort.Slice.
+ - Add a dependency on golang-golang-x-text-dev, also newly necessary.
+ - Remove architecture qualifiers for now. (This *is* for experimental.)
+ * debian/rules:
+ - Build with /usr/lib/go-1.8/bin/go if necessary (notably, for backports).
+ - Establish a local GOPATH with a symlink to .../golang.org/x/text.
+ - Run go build -v now that there are third-party libraries to incorporate.
+ * debian/.gitignore: Ignore debian/gopath.
+ * debian/examples: Install the new asp-cp script as an example, since it
+ requires non-free Aspera tools.
+
+ -- Aaron M. Ucko <ucko@debian.org> Mon, 29 May 2017 21:28:44 -0400
+
+ncbi-entrez-direct (6.10.20170123+ds-2) UNRELEASED; urgency=medium
+
+ * debian/e{fetch,info}: Correct help text to cite our man pages too.
+ (They didn't yet exist when I originally wrote these wrappers.)
+ * debian/man/xtract.1: Fix an old typo (esapes vs. escapes).
+
+ -- Aaron M. Ucko <ucko@debian.org> Mon, 29 May 2017 15:41:49 -0400
+
+ncbi-entrez-direct (6.10.20170123+ds-1) unstable; urgency=medium
+
+ * New upstream release.
+ * Resolve conflicts by diverting acedb-other's efetch and epub-utils'
+ einfo to efetch.acedb and einfo.epub respectively (and likewise for
+ their man pages) and deploying wrapper scripts that try to figure out
+ which implementation the user intended to run. (Proper usage differs
+ radically, so ambiguity is unlikely to be an issue in practice.)
+ * Add man pages for all commands.
+
+ -- Aaron M. Ucko <ucko@debian.org> Tue, 24 Jan 2017 21:56:00 -0500
+
+ncbi-entrez-direct (6.00.20170105+ds-1) unstable; urgency=medium
+
+ * New upstream release.
+ * debian/control: Canonicalize per cme.
+ * debian/copyright: Likewise; also, correct placement of Files-Excluded.
+
+ -- Aaron M. Ucko <ucko@debian.org> Thu, 05 Jan 2017 22:27:51 -0500
+
+ncbi-entrez-direct (5.90.20161221+ds-4) unstable; urgency=medium
+
+ * debian/control: Remove annotations from conflicts here. (Oops.)
+
+ -- Aaron M. Ucko <ucko@debian.org> Sat, 24 Dec 2016 23:48:49 -0500
+
+ncbi-entrez-direct (5.90.20161221+ds-3) unstable; urgency=medium
+
+ * debian/control:
+ - Build-Depends: Correct syntax for multiple exclusions.
+ - Conflicts: acedb-other (over efetch), epub-utils (over einfo).
+
+ -- Aaron M. Ucko <ucko@debian.org> Sat, 24 Dec 2016 23:25:29 -0500
+
+ncbi-entrez-direct (5.90.20161221+ds-2) unstable; urgency=medium
+
+ * .gitignore: Account for files created outside debian/ at build time.
+ * debian/control:
+ - Set debian-med as maintainer, and myself as uploader.
+ - Don't build depend on golang-any on architectures on
+ which it's currently uninstallable.
+ * debian/rules: If building xtract.go fails for any reason, fall back on
+ installing the original Perl implementation.
+ * debian/source/options: single-debian-patch.
+ * xtract.pl: Don't insist on -fallback.
+
+ -- Aaron M. Ucko <ucko@debian.org> Sat, 24 Dec 2016 22:43:40 -0500
+
+ncbi-entrez-direct (5.90.20161221+ds-1) unstable; urgency=low
+
+ * Initial release. (Closes: #810949.)
+
+ -- Aaron M. Ucko <ucko@debian.org> Fri, 23 Dec 2016 16:35:19 -0500
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..ac1115a
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,35 @@
+Source: ncbi-entrez-direct
+Maintainer: Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
+Uploaders: Aaron M. Ucko <ucko@debian.org>
+Section: science
+Priority: optional
+Build-Depends: debhelper (>= 10~),
+ golang-any (>= 2:1.8~2~) [!hppa !hurd-any !kfreebsd-any !m68k !sh4]
+ | golang-1.8-go [!hppa !hurd-any !kfreebsd-any !m68k !sh4],
+ golang-golang-x-text-dev [!hppa !hurd-any !kfreebsd-any !m68k !sh4]
+Standards-Version: 4.0.0
+Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/ncbi-entrez-direct.git
+Vcs-Git: https://anonscm.debian.org/git/debian-med/ncbi-entrez-direct.git
+Homepage: http://www.ncbi.nlm.nih.gov/books/NBK179288
+
+Package: ncbi-entrez-direct
+Architecture: any
+Multi-Arch: foreign
+Depends: libwww-perl,
+ ${misc:Depends},
+ ${perl:Depends},
+ ${shlibs:Depends}
+Description: NCBI Entrez utilities on the command line
+ Entrez Direct (EDirect) is an advanced method for accessing NCBI's set
+ of interconnected databases (publication, sequence, structure, gene,
+ variation, expression, etc.) from a terminal window or script.
+ Functions take search terms from command-line arguments. Individual
+ operations are combined to build multi-step queries. Record retrieval
+ and formatting normally complete the process.
+ .
+ EDirect also provides an argument-driven function that simplifies the
+ extraction of data from document summaries or other results that are
+ returned in structured XML format. This can eliminate the need for
+ writing custom software to answer ad hoc questions. Queries can move
+ seamlessly between EDirect commands and UNIX utilities or scripts to
+ perform actions that cannot be accomplished entirely within Entrez.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..82314bd
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,27 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: edirect
+Source: https://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/
+Files-Excluded: *.tar.gz
+
+Files: *
+Copyright: Jonathan Kans, NCBI
+License: PD
+ 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.
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..e845566
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1 @@
+README
diff --git a/debian/efetch b/debian/efetch
new file mode 100755
index 0000000..0585418
--- /dev/null
+++ b/debian/efetch
@@ -0,0 +1,254 @@
+#!/usr/bin/perl -w
+# Detect whether to run efetch.acedb or edirect -fetch.
+
+use strict;
+
+my $usage = <<EOF;
+USAGE: efetch [<AceDB efetch options>] [<database>:]<query>
+ -or- efetch [<NCBI Entrez Direct efetch options>]
+
+per, respectively,
+
+ efetch.acedb -h (or man efetch.acedb)
+ edirect -fetch -help (or man efetch)
+EOF
+
+if ( !@ARGV || ! -x '/usr/bin/efetch.acedb' ) {
+ ExecNCBI();
+} elsif (grep /--?help/, @ARGV) {
+ print $usage;
+ exit 0;
+}
+
+my $acedb_flags = 'afqHprmMbAxw';
+my $acedb_keys = 'seDdilBn';
+
+my %ncbi_supported = (
+ 'db' => 's',
+ 'id' => 's',
+ 'format' => 's',
+ 'mode' => 's',
+ 'seq_start' => 'i',
+ 'seq_stop' => 'i',
+ 'strand' => 's',
+ 'complexity' => 'i',
+ 'chr_start' => 'i',
+ 'extend' => 'i',
+ 'extrafeat' => 'i',
+ 'start' => 'i',
+ 'stop' => 'i',
+ 'nogi' => undef,
+ 'email' => 's',
+ 'tool' => 's',
+ 'pipe' => undef,
+ 'help' => undef,
+ 'silent' => undef,
+ 'verbose' => undef,
+ 'debug' => undef,
+ 'log' => undef,
+ 'http' => 's',
+ 'https' => 's',
+ 'alias' => 's',
+ 'base' => 's');
+
+my %ncbi_abbrev = ();
+{
+ my @names = sort keys %ncbi_supported;
+ unshift @names, '';
+ push @names, '';
+ my $i;
+ my $j;
+ for ($i = 1; $i + 1 < @names; ++$i) {
+ my $name = $names[$i];
+ my $prev_name = $names[$i - 1];
+ my $next_name = $names[$i + 1];
+ for ($j = 1; $j < length($name); ++$j) {
+ my $abbrev = substr($name, 0, $j);
+ if ($abbrev ne substr($prev_name, 0, $j)
+ && $abbrev ne substr($next_name, 0, $j)) {
+ $ncbi_abbrev{$abbrev} = $name;
+ }
+ }
+ }
+}
+
+my @acedb_red_flags;
+my @acedb_yellow_flags;
+my $acedb_value_expected;
+my $acedb_query;
+my @ncbi_red_flags;
+my @ncbi_yellow_flags;
+my $ncbi_value_expected;
+
+for (@ARGV) {
+ if (/^-\d+$/ || !/^-/) {
+ if ( !defined $acedb_value_expected ) {
+ if (defined $acedb_query) {
+ push @acedb_yellow_flags, "$acedb_query $_";
+ }
+ $acedb_query = $_;
+ }
+ if ( !defined $ncbi_value_expected ) {
+ push @ncbi_red_flags, $_;
+ }
+ undef $acedb_value_expected;
+ undef $ncbi_value_expected;
+ } else {
+ my $acedb_type;
+ if (defined $acedb_value_expected) {
+ push @acedb_red_flags, "$acedb_value_expected $_";
+ $acedb_type = 'nominal-value';
+ undef $acedb_value_expected;
+ } elsif (/^-[ho]$/ || /^-[$acedb_flags]*(?:[$acedb_keys].+)?$/) {
+ $acedb_type = 'flag';
+ } elsif (/^-[$acedb_flags]*([$acedb_keys])$/) {
+ $acedb_type = 'key';
+ $acedb_value_expected = "-$1";
+ } else {
+ $acedb_type = 'invalid';
+ push @acedb_red_flags, $_;
+ }
+
+ my $ncbi_type;
+ if (defined $ncbi_value_expected) {
+ push @ncbi_red_flags, "$ncbi_value_expected $_";
+ $ncbi_type = 'nominal-value';
+ undef $ncbi_value_expected;
+ } elsif (/^--?([^=]+)(=.*)?/) {
+ my $base = lc($1);
+ my $has_value = defined $2;
+ if (exists $ncbi_abbrev{$base}) {
+ $base = $ncbi_abbrev{$base};
+ push @ncbi_yellow_flags, $_;
+ }
+ if ( !exists $ncbi_supported{$base}
+ || ($has_value && !defined $ncbi_supported{$base})) {
+ $ncbi_type = 'invalid';
+ push @ncbi_red_flags, $_;
+ } else {
+ if (lc($1) eq $base && $1 =~ /[A-Z]/) {
+ # Worry about capitalization only if otherwise OK
+ push @ncbi_yellow_flags, $_;
+ }
+ if (defined $ncbi_supported{$base} && !$has_value) {
+ $ncbi_type = 'key';
+ $ncbi_value_expected = $_;
+ } else {
+ $ncbi_type = 'flag';
+ }
+ }
+ } else {
+ $ncbi_type = 'invalid';
+ push @ncbi_red_flags, $_;
+ }
+
+ if ($acedb_type =~ /^[fk]/ && $ncbi_type =~ /^[fk]/) {
+ # Could technically be valid for efetch.acedb, but far likelier
+ # to have been intended for edirect -fetch.
+ push @acedb_yellow_flags, $_;
+ }
+ }
+}
+
+if ( !defined $acedb_query ) {
+ push @acedb_red_flags, "no query";
+}
+if (defined $acedb_value_expected) {
+ push @acedb_red_flags, "$acedb_value_expected with no value";
+}
+if (defined $ncbi_value_expected) {
+ push @ncbi_red_flags, "$ncbi_value_expected with no value";
+}
+
+my $acedb_red = @acedb_red_flags;
+my $acedb_ylw = @acedb_yellow_flags;
+my $ncbi_red = @ncbi_red_flags;
+my $ncbi_ylw = @ncbi_yellow_flags;
+
+if ($acedb_red && !$ncbi_red) {
+ # clear-cut, even if there happen to be NCBI yellow flags
+ ExecNCBI();
+} elsif ($ncbi_red && !$acedb_red) {
+ ExecAceDB();
+}
+
+my $acedb_misgivings = "AceDB misgivings ($acedb_red major, $acedb_ylw minor):";
+my $ncbi_misgivings = "NCBI misgivings ($ncbi_red major, $ncbi_ylw minor):";
+
+for (@acedb_red_flags) {
+ $acedb_misgivings .= "\n $_ (major)";
+}
+for (@acedb_yellow_flags) {
+ $acedb_misgivings .= "\n $_ (minor)";
+}
+for (@ncbi_red_flags) {
+ $ncbi_misgivings .= "\n $_ (major)";
+}
+for (@ncbi_yellow_flags) {
+ $ncbi_misgivings .= "\n $_ (minor)";
+}
+
+if ($ncbi_red > $acedb_red
+ || ($ncbi_red == $acedb_red && $ncbi_ylw > $acedb_ylw)) {
+ if ($acedb_red || $acedb_ylw) {
+ warn <<EOF;
+Launching AceDB efetch rather than NCBI efetch despite misgivings,
+due to more severe misgivings about NCBI syntax compatibility. If you
+meant to run NCBI efetch, please explicitly run it via edirect -fetch.
+$ncbi_misgivings
+$acedb_misgivings
+EOF
+ }
+ ExecAceDB();
+}
+
+if ($acedb_red > $ncbi_red
+ || ($acedb_red == $ncbi_red && $acedb_ylw > $ncbi_ylw)) {
+ if ($ncbi_red || $ncbi_ylw) {
+ warn <<EOF;
+Launching NCBI efetch rather than AceDB efetch despite misgivings,
+due to more severe misgivings about AceDB syntax compatibility. If you
+meant to run AceDB efetch, please explicitly run it via efetch.acedb.
+$acedb_misgivings
+$ncbi_misgivings
+EOF
+ }
+ ExecNCBI();
+}
+
+if ($acedb_red) {
+ die <<EOF;
+Usage equally bad for both AceDB efetch and NCBI efetch. Please double
+check your usage or explicitly run efetch.acedb or edirect -fetch.
+$acedb_misgivings
+$ncbi_misgivings
+
+$usage
+EOF
+} elsif ($acedb_ylw) {
+ die <<EOF;
+Usage equally suspect (but still technically valid, at least to first
+approximation) for both AceDB efetch and NCBI efetch. Please double
+check your usage or explicitly run efetch.acedb or edirect -fetch.
+$acedb_misgivings
+$ncbi_misgivings
+
+$usage
+EOF
+} else {
+ die <<EOF;
+Usage apparently valid (at least to first approximation) for both
+AceDB efetch and NCBI efetch. Please disambiguate your usage or
+explicitly run efetch.acedb or edirect -fetch.
+EOF
+}
+
+sub ExecAceDB
+{
+ # exec {'/usr/bin/efetch.acedb'} ('/usr/bin/efetch', @ARGV);
+ exec('/usr/bin/efetch.acedb', @ARGV);
+}
+sub ExecNCBI
+{
+ exec('/usr/bin/edirect', '-fetch', @ARGV);
+}
diff --git a/debian/einfo b/debian/einfo
new file mode 100755
index 0000000..913c079
--- /dev/null
+++ b/debian/einfo
@@ -0,0 +1,243 @@
+#!/usr/bin/perl -w
+# Detect whether to run einfo.epub or edirect -info.
+
+use strict;
+
+my $usage = <<EOF;
+USAGE: einfo [<epub einfo options>] <filename>
+ -or- einfo [<NCBI Entrez Direct einfo options>]
+
+per, respectively,
+
+ einfo.epub -h (or man einfo.epub)
+ edirect -info -help (or man einfo)
+EOF
+
+if ( !@ARGV || ! -x '/usr/bin/einfo.epub' ) {
+ ExecNCBI();
+} elsif (grep /--?help/, @ARGV) {
+ print $usage;
+ exit 0;
+}
+
+my $epub_flags = 'qvdp';
+my $epub_keys = 't';
+
+my %ncbi_supported = (
+ 'db' => 's',
+ 'dbs' => undef,
+ 'fields' => undef,
+ 'links' => undef,
+ 'email' => 's',
+ 'tool' => 's',
+ 'help' => undef,
+ 'silent' => undef,
+ 'verbose' => undef,
+ 'debug' => undef,
+ 'log' => undef,
+ 'http' => 's',
+ 'https' => 's',
+ 'alias' => 's',
+ 'base' => 's');
+
+my %ncbi_abbrev = ();
+{
+ my @names = sort keys %ncbi_supported;
+ unshift @names, '';
+ push @names, '';
+ my $i;
+ my $j;
+ for ($i = 1; $i + 1 < @names; ++$i) {
+ my $name = $names[$i];
+ my $prev_name = $names[$i - 1];
+ my $next_name = $names[$i + 1];
+ for ($j = 1; $j < length($name); ++$j) {
+ my $abbrev = substr($name, 0, $j);
+ if ($abbrev ne substr($prev_name, 0, $j)
+ && $abbrev ne substr($next_name, 0, $j)) {
+ $ncbi_abbrev{$abbrev} = $name;
+ }
+ }
+ }
+}
+
+my @epub_red_flags;
+my @epub_yellow_flags;
+my $epub_value_expected;
+my $epub_query;
+my @ncbi_red_flags;
+my @ncbi_yellow_flags;
+my $ncbi_value_expected;
+
+for (@ARGV) {
+ if (/^-\d+$/ || !/^-/) {
+ if ( !defined $epub_value_expected ) {
+ if (defined $epub_query) {
+ push @epub_red_flags, "$epub_query $_";
+ }
+ $epub_query = $_;
+ }
+ if ( !defined $ncbi_value_expected ) {
+ push @ncbi_red_flags, $_;
+ }
+ undef $epub_value_expected;
+ undef $ncbi_value_expected;
+ } else {
+ my $epub_type;
+ if (defined $epub_value_expected) {
+ push @epub_red_flags, "$epub_value_expected $_";
+ $epub_type = 'nominal-value';
+ undef $epub_value_expected;
+ } elsif (/^-[ho]$/ || /^-[$epub_flags]*(?:[$epub_keys].+)?$/) {
+ $epub_type = 'flag';
+ } elsif (/^-[$epub_flags]*([$epub_keys])$/) {
+ $epub_type = 'key';
+ $epub_value_expected = "-$1";
+ } else {
+ $epub_type = 'invalid';
+ push @epub_red_flags, $_;
+ }
+
+ my $ncbi_type;
+ if (defined $ncbi_value_expected) {
+ push @ncbi_red_flags, "$ncbi_value_expected $_";
+ $ncbi_type = 'nominal-value';
+ undef $ncbi_value_expected;
+ } elsif (/^--?([^=]+)(=.*)?/) {
+ my $base = lc($1);
+ my $has_value = defined $2;
+ if (exists $ncbi_abbrev{$base}) {
+ $base = $ncbi_abbrev{$base};
+ push @ncbi_yellow_flags, $_;
+ }
+ if ( !exists $ncbi_supported{$base}
+ || ($has_value && !defined $ncbi_supported{$base})) {
+ $ncbi_type = 'invalid';
+ push @ncbi_red_flags, $_;
+ } else {
+ if (lc($1) eq $base && $1 =~ /[A-Z]/) {
+ # Worry about capitalization only if otherwise OK
+ push @ncbi_yellow_flags, $_;
+ }
+ if (defined $ncbi_supported{$base} && !$has_value) {
+ $ncbi_type = 'key';
+ $ncbi_value_expected = $_;
+ } else {
+ $ncbi_type = 'flag';
+ }
+ }
+ } else {
+ $ncbi_type = 'invalid';
+ push @ncbi_red_flags, $_;
+ }
+
+ if ($epub_type =~ /^[fk]/ && $ncbi_type =~ /^[fk]/) {
+ # Could technically be valid for einfo.epub, but far likelier
+ # to have been intended for edirect -info.
+ push @epub_yellow_flags, $_;
+ }
+ }
+}
+
+if ( !defined $epub_query ) {
+ push @epub_red_flags, "no filename";
+}
+if (defined $epub_value_expected) {
+ push @epub_red_flags, "$epub_value_expected with no value";
+}
+if (defined $ncbi_value_expected) {
+ push @ncbi_red_flags, "$ncbi_value_expected with no value";
+}
+
+my $epub_red = @epub_red_flags;
+my $epub_ylw = @epub_yellow_flags;
+my $ncbi_red = @ncbi_red_flags;
+my $ncbi_ylw = @ncbi_yellow_flags;
+
+if ($epub_red && !$ncbi_red) {
+ # clear-cut, even if there happen to be NCBI yellow flags
+ ExecNCBI();
+} elsif ($ncbi_red && !$epub_red) {
+ ExecEpub();
+}
+
+my $epub_misgivings = "EPUB misgivings ($epub_red major, $epub_ylw minor):";
+my $ncbi_misgivings = "NCBI misgivings ($ncbi_red major, $ncbi_ylw minor):";
+
+for (@epub_red_flags) {
+ $epub_misgivings .= "\n $_ (major)";
+}
+for (@epub_yellow_flags) {
+ $epub_misgivings .= "\n $_ (minor)";
+}
+for (@ncbi_red_flags) {
+ $ncbi_misgivings .= "\n $_ (major)";
+}
+for (@ncbi_yellow_flags) {
+ $ncbi_misgivings .= "\n $_ (minor)";
+}
+
+if ($ncbi_red > $epub_red
+ || ($ncbi_red == $epub_red && $ncbi_ylw > $epub_ylw)) {
+ if ($epub_red || $epub_ylw) {
+ warn <<EOF;
+Launching EPUB einfo rather than NCBI einfo despite misgivings,
+due to more severe misgivings about NCBI syntax compatibility. If you
+meant to run NCBI einfo, please explicitly run it via edirect -info.
+$ncbi_misgivings
+$epub_misgivings
+EOF
+ }
+ ExecEpub();
+}
+
+if ($epub_red > $ncbi_red
+ || ($epub_red == $ncbi_red && $epub_ylw > $ncbi_ylw)) {
+ if ($ncbi_red || $ncbi_ylw) {
+ warn <<EOF;
+Launching NCBI einfo rather than EPUB einfo despite misgivings,
+due to more severe misgivings about EPUB syntax compatibility. If you
+meant to run EPUB einfo, please explicitly run it via einfo.epub.
+$epub_misgivings
+$ncbi_misgivings
+EOF
+ }
+ ExecNCBI();
+}
+
+if ($epub_red) {
+ die <<EOF;
+Usage equally bad for both EPUB einfo and NCBI einfo. Please double
+check your usage or explicitly run einfo.epub or edirect -info.
+$epub_misgivings
+$ncbi_misgivings
+
+$usage
+EOF
+} elsif ($epub_ylw) {
+ die <<EOF;
+Usage equally suspect (but still technically valid, at least to first
+approximation) for both EPUB einfo and NCBI einfo. Please double
+check your usage or explicitly run einfo.epub or edirect -info.
+$epub_misgivings
+$ncbi_misgivings
+
+$usage
+EOF
+} else {
+ die <<EOF;
+Usage apparently valid (at least to first approximation) for both
+EPUB einfo and NCBI einfo. Please disambiguate your usage or
+explicitly run einfo.epub or edirect -info.
+EOF
+}
+
+sub ExecEpub
+{
+ # exec {'/usr/bin/einfo.epub'} ('/usr/bin/einfo', @ARGV);
+ exec('/usr/bin/einfo.epub', @ARGV);
+}
+sub ExecNCBI
+{
+ exec('/usr/bin/edirect', '-info', @ARGV);
+}
diff --git a/debian/examples b/debian/examples
new file mode 100644
index 0000000..2913960
--- /dev/null
+++ b/debian/examples
@@ -0,0 +1,3 @@
+asp-cp
+asp-ls
+
diff --git a/debian/install b/debian/install
new file mode 100644
index 0000000..324d22f
--- /dev/null
+++ b/debian/install
@@ -0,0 +1 @@
+bin/* usr/bin
diff --git a/debian/man/amino-acid-composition.1 b/debian/man/amino-acid-composition.1
new file mode 100644
index 0000000..31df6fd
--- /dev/null
+++ b/debian/man/amino-acid-composition.1
@@ -0,0 +1,31 @@
+.TH AMINO-ACID-COMPOSITION 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+amino\-acid\-composition \- report amino acid composition
+.SH SYNOPSIS
+.B amino\-acid\-composition
+.SH DESCRIPTION
+.B amino\-acid\-composition
+reports on the amino acid composition of protein sequences
+(one case\-insensitive letter per residue)
+it reads from standard input.
+For each line of input, it writes on standard output
+a 26\-line tab\-delimited report using three\-letter symbols,
+in the form
+.RS
+.PD 0
+.IP \fBAla\fP
+.I n
+.IP \fBArg\fP
+.I n
+.IP \fBAsp\fP
+.I n
+.IP ...
+\&...
+.IP \fBVal\fP
+.I n
+.IP \fBXle\fP
+.I n
+.IP \fBXxx\fP
+.I n
+.PD
+.RE
diff --git a/debian/man/between-two-genes.1 b/debian/man/between-two-genes.1
new file mode 100644
index 0000000..3efedde
--- /dev/null
+++ b/debian/man/between-two-genes.1
@@ -0,0 +1,21 @@
+.TH BETWEEN-TWO-GENES 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+between\-two\-genes \- select a range of tab-delimited lines
+.SH SYNOPSIS
+.B between\-two\-genes
+.I key1
+.I key2
+.SH DESCRIPTION
+\fBbetween\-two\-genes\fP reads a tab\-delimited file
+(as produced by \fBxtract\fP(1), perhaps)
+on standard input
+and writes to standard output a consecutive subset of its lines,
+from the (first) line whose first field is
+.I key1
+up to (but \fBnot\fP including) the next line whose first field is
+.IR key2 .
+Both keys are expected to be alphanumeric (gene symbols or the like);
+using other characters can yield undefined behavior.
+.SH SEE ALSO
+.BR reorder\-columns (1),
+.BR xtract (1).
diff --git a/debian/man/eaddress.1 b/debian/man/eaddress.1
new file mode 100644
index 0000000..a68682a
--- /dev/null
+++ b/debian/man/eaddress.1
@@ -0,0 +1,25 @@
+.TH EADDRESS 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+eaddress \- check edirect's notion of your e\-mail address
+.SH SYNOPSIS
+.B eaddress
+
+.B edirect -address
+.SH DESCRIPTION
+\fBeaddress\fP prints (to standard output) the e\-mail address
+that other \fBedirect\fP(1) subcommands will send by default
+to have someone to notify in case
+a runaway script causes problems with an NCBI Entrez server.
+If the \fBEMAIL\fP environment variable is set,
+\fBedirect\fP will honor it.
+Otherwise, it will combine a username
+from the \fBUSER\fP environment variable
+or reported by \fBwhoami\fP(1)
+with a hostname from \fB/etc/mailname\fP
+or \fBuname\fP(2),
+attempting to obtain a fully qualified form if necessary.
+.SH SEE ALSO
+.BR econtact (1),
+.BR edirect (1),
+.BR whoami (1).
+
diff --git a/debian/man/ecitmatch.1 b/debian/man/ecitmatch.1
new file mode 100644
index 0000000..1b99aeb
--- /dev/null
+++ b/debian/man/ecitmatch.1
@@ -0,0 +1,42 @@
+.TH ECITMATCH 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+ecitmatch \- look up a citation's PubMed ID
+.SH SYNOPSIS
+\fBecitmatch\fP (\fBedirect\ \-citmatch\fP)
+[\|\fB\-help\fP\|]
+[\|\fB\-journal\fP\ \fItitle\fP\|]
+[\|\fB\-year\fP\ \fIyear\fP\|]
+[\|\fB\-volume\fP\ \fIN\fP\|]
+[\|\fB\-page\fP\ \fIN\fP\|]
+[\|\fB\-author\fP\ \fIname\fP\|]
+.SH DESCRIPTION
+\fBecitmatch\fP prints (to standard output)
+the numeric PubMed identifier for a specified article.
+If there were multiple matches, it substitutes
+a parenthesized expression of the form
+\fB(\fP\fIn\fP\fB\ citations)\fP.
+If there were no matches, it prints nothing at all.
+.SH OPTIONS
+.TP
+\fB\-help\fP
+Print a summary of available options.
+.TP
+\fB\-journal\fP\ \fItitle\fP
+Match only articles whose journal has the given title
+(which may be specified as a standard abbreviation).
+.TP
+\fB\-year\fP\ \fIyear\fP
+Match only articles published in the given year.
+.TP
+\fB\-volume\fP\ \fIN\fP
+Match only articles with the given volume number.
+.TP
+\fB\-page\fP\ \fIN\fP
+Match only articles starting on the given page number.
+.TP
+\fB\-author\fP\ \fIname
+Match only articles with the given author name
+(may be partial; may not be repeated).
+.SH SEE ALSO
+.BR edirect (1).
+
diff --git a/debian/man/econtact.1 b/debian/man/econtact.1
new file mode 100644
index 0000000..7ff4c29
--- /dev/null
+++ b/debian/man/econtact.1
@@ -0,0 +1,30 @@
+.TH ECONTACT 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+econtact \- adjust contact information for an edirect pipeline
+.SH SYNOPSIS
+\fBecontact\fP (\fBedirect\ \-contact\fP)
+[\|\fB\-help\fP\|]
+[\|\fB\-email\fP\ \fIaddress\fP\|]
+[\|\fB\-tool\fP\ \fIname\fP\|]
+.SH DESCRIPTION
+\fBecontact\fP adjusts the e\-mail address and/or client name
+that subsequent \fBedirect\fP(1) pipeline stages will send
+to have someone to notify in case
+a runaway script causes problems with an NCBI Entrez server.
+.SH OPTIONS
+.TP
+\fB\-help\fP
+Print usage information.
+.TP
+\fB\-email\fP\ \fIaddress\fP
+Send the given e\-mail address.
+.TP
+\fB\-tool\fP\ \fIname
+Send the given client name.
+.SH SEE ALSO
+.BR eaddress (1),
+.BR edirect (1),
+.BR edirutil (1),
+.BR enotify (1),
+.BR eproxy (1).
+
diff --git a/debian/man/edirect.1 b/debian/man/edirect.1
new file mode 100644
index 0000000..cb5de30
--- /dev/null
+++ b/debian/man/edirect.1
@@ -0,0 +1,86 @@
+.TH EDIRECT 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+edirect \- access NCBI Entrez from the command line
+.SH SYNOPSIS
+.B edirect\ \-version
+
+\fBesearch\fP (\fBedirect\ \-search\fP) \fIoptions\fP
+
+\fBelink\fP (\fBedirect\ \-link\fP) \fIoptions\fP
+
+\fBefilter\fP (\fBedirect\ \-filter\fP) \fIoptions\fP
+
+\fBesummary\fP (\fBedirect\ \-summary\fP) \fIoptions\fP
+
+\fBefetch\fP (\fBedirect\ \-fetch\fP) \fIoptions\fP
+
+\fBeinfo\fP (\fBedirect\ \-info\fP) \fIoptions\fP
+
+\fBepost\fP (\fBedirect\ \-post\fP) \fIoptions\fP
+
+\fBespell\fP (\fBedirect\ \-spell\fP) \fIoptions\fP
+
+\fBecitmatch\fP (\fBedirect\ \-citmatch\fP) \fIoptions\fP
+
+\fBeproxy\fP (\fBedirect\ \-proxy\fP) \fIoptions\fP
+
+\fBecontact\fP (\fBedirect\ \-contact\fP) \fIoptions\fP
+
+\fBenotify\fP (\fBedirect\ \-notify\fP) \fIoptions\fP
+
+\fBeaddress\fP (\fBedirect\ \-address\fP) \fIoptions\fP
+.SH DESCRIPTION
+\fBedirect\fP (Entrez Direct) is a command\-line utility
+for consulting NCBI's set of interconnected databases
+(publication, sequence, structure, gene, variation, expression, etc.)
+in a variety of fashions,
+each of which is documented individually in a dedicated man page.
+.SH COMMON OPTIONS
+Most subcommands accept the following options,
+in addition to command\-specific options.
+.TP
+\fB\-help\fP
+Print usage information.
+.TP
+\fB\-email\fP\ \fIaddress\fP
+Send the given e\-mail address to have someone to notify
+in case a runaway script causes problems
+with an NCBI Entrez server.
+.TP
+\fB\-tool\fP\ \fIname
+Send the given client name.
+.TP
+\fB\-http\fP[\fBs\fP]\ \fBget\fP
+Force the use of \fBGET\fP rather than \fBPOST\fP HTTPS requests.
+.TP
+\fB-alias\fP\ \fIfilename\fP
+Specify a file of shortcut keywords and query strings or URL sections.
+.TP
+\fB\-silent\fP
+Suppress connection failure retry messages.
+.TP
+\fB\-verbose\fP
+Display the \fBENTREZ_DIRECT\fP XML field values at each step.
+.TP
+\fB\-debug\fP
+Print the internal URL query and XML results of each step.
+.TP
+\fB\-base\fP\ \fIURL\fP
+Specify a particular server for quality assurance testing.
+.SH SEE ALSO
+.BR eaddress (1),
+.BR ecitmatch (1),
+.BR econtact (1),
+.BR efetch (1),
+.BR efilter (1),
+.BR einfo (1),
+.BR elink (1),
+.BR enotify (1),
+.BR entrez\-phrase\-search (1),
+.BR epost (1),
+.BR eproxy (1),
+.BR esearch (1),
+.BR espell (1),
+.BR esummary (1),
+.BR nquire (1),
+.BR xtract (1).
diff --git a/debian/man/edirutil.1 b/debian/man/edirutil.1
new file mode 100644
index 0000000..9f78c78
--- /dev/null
+++ b/debian/man/edirutil.1
@@ -0,0 +1,52 @@
+.TH EDIRUTIL 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+edirutil \- synthesize NCBI ENTREZ_DIRECT XML (edirect pipeline state)
+.SH SYNOPSIS
+.B edirutil
+[\|\fB\-db\fP\ \fIname\fP\|]
+[\|\fB\-web\fP\ \fIwebenv\fP\|]
+[\|\fB\-key\fP\ \fIN\fP\|]
+[\|\fB\-count\fP\ \fIN\fP\|]
+[\|\fB\-step\fP\ \fIN\fP\|]
+.\"[\|\fB\-seconds\fP\ \fIX\fP\|] \" ignored
+.\"[\|\fB\-version\fP\ \fIver\fP\|] \" ignored
+[\|\fB\-silent\fP\|]
+[\|\fB\-verbose\fP\|]
+[\|\fB\-debug\fP\|]
+.SH DESCRIPTION
+\fBedirutil\fP synthesizes \fBENTREZ_DIRECT\fP XML records,
+which several \fBedirect\fP commands read, write, or both,
+to allow for server\-side transformation or filtering of results
+prior to presenting them.
+\fBedirutil\fP makes it possible to bypass
+one or more \fBedirect\fP pipeline stages
+on the basis of state observed in browsers or other tools
+that don't natively produce \fBENTREZ_DIRECT\fP XML.
+.SH OPTIONS
+.TP
+\fB\-db\fP\ \fIname\fP
+Work with the named Entrez database.
+.TP
+\fB\-web\fP\ \fIwebenv\fP
+Pass the specified \fBWebEnv\fP cookie.
+.TP
+\fB\-key\fP\ \fIN\fP
+Work with the \fIN\fPth result set associated with the specified \fBWebEnv\fP.
+.TP
+\fB\-count\fP\ \fIN\fP
+Expect \fIN\fP results.
+.TP
+\fB\-step\fP\ \fIN\fP
+Indicate the current pipeline depth.
+.TP
+\fB\-silent\fP
+Suppress connection failure retry messages.
+.TP
+\fB\-verbose\fP
+Display the \fBENTREZ_DIRECT\fP XML field values at each step.
+.TP
+\fB\-debug\fP
+Print the internal URL query and XML results of each step.
+.SH SEE ALSO
+.BR econtact (1),
+.BR edirect (1).
diff --git a/debian/man/efetch.1 b/debian/man/efetch.1
new file mode 100644
index 0000000..413028f
--- /dev/null
+++ b/debian/man/efetch.1
@@ -0,0 +1,115 @@
+.TH EFETCH 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+efetch, esummary \- retrieve results from an NCBI Entrez search
+.SH SYNOPSIS
+\fBefetch\fP (\fBedirect\ \-fetch\fP)
+[\|\fB\-help\fP\|]
+[\|\fB\-format\fP\ \fIfmt\fP\|]
+[\|\fB\-mode\fP\ \fImode\fP\|]
+[\|\fB\-db\fP\ \fIname\fP\|]
+[\|\fB\-id\fP\ \fIID\fP\|]
+[\|\fB\-seq_start\fP\ \fIN\fP\|]
+[\|\fB\-seq_stop\fP\ \fIN\fP\|]
+[\|\fB\-strand\fP\ \fIN\fP\|]
+[\|\fB\-chr_start\fP\ \fIN\fP\|]
+[\|\fB\-chr_stop\fP\ \fIN\fP\|]
+[\|\fB\-complexity\fP\ \fIN\fP\|]
+[\|\fB\-extend\fP\ \fIN\fP\|]
+[\|\fB\-extrafeat\fP\ \fIN\fP\|]
+
+\fBesummary\fP (\fBedirect\ \-summary\fP)
+[\|\fB\-help\fP\|]
+[\|\fB\-mode\fP\ \fImode\fP\|]
+[\|\fB\-db\fP\ \fIname\fP\|]
+[\|\fB\-id\fP\ \fIID\fP\|]
+[\|\fB\-seq_start\fP\ \fIN\fP\|]
+[\|\fB\-seq_stop\fP\ \fIN\fP\|]
+[\|\fB\-strand\fP\ \fIN\fP\|]
+[\|\fB\-chr_start\fP\ \fIN\fP\|]
+[\|\fB\-chr_stop\fP\ \fIN\fP\|]
+[\|\fB\-complexity\fP\ \fIN\fP\|]
+[\|\fB\-extend\fP\ \fIN\fP\|]
+[\|\fB\-extrafeat\fP\ \fIN\fP\|]
+.SH DESCRIPTION
+\fBefetch\fP and \fBesummary\fP retrieve results
+from either an \fBedirect\fP(1) pipeline
+or an immediate lookup (via \fB\-db\fP and \fB\-id\fP).
+\fBesummary\fP is equivalent to \fBefetch -format docsum\fP.
+
+\fBefetch\fP is also the name of an AceDB tool
+for consulting local sequence databases.
+To resolve this ambiguity,
+Debian systems with both AceDB tools and Entrez Direct installed
+arrange for AceDB's executable to have the name \fBefetch.acedb\fP(1)
+and for \fBefetch\fP to be a wrapper script
+that examines its usage and proceeds to run whichever of
+\fBedirect \-fetch\fP or \fBefetch.acedb\fP(1)
+looks like a better fit.
+.SH OPTIONS
+.SS Format Selection
+.TP
+\fB\-format\fP\ \fIfmt\fP
+Format of record or report.
+(See \fB-help\fP output for examples.)
+.TP
+\fB\-mode\fP\ \fImode\fP
+.BR text ,
+.BR xml ,
+.BR asn.1 ,
+or
+.BR json .
+.SS Direct Record Selection
+.TP
+\fB\-db\fP\ \fIname\fP
+Entrez database name for immediate lookups.
+.TP
+\fB\-id\fP\ \fIID\fP
+Unique identifier or accession for immediate lookups.
+.SS Sequence Range
+.TP
+\fB\-seq_start\fP\ \fIN\fP
+First sequence position to retrieve (1\-based).
+.TP
+\fB\-seq_stop\fP\ \fIN\fP
+Last sequence position to retrieve (1\-based).
+.TP
+\fB\-strand\fP\ \fIN\fP
+Strand of DNA to retrieve:
+\fB1\fP for plus, \fB2\fP for minus.
+.SS Gene Range
+.TP
+\fB\-chr_start\fP\ \fIN\fP
+First sequence position to retrieve (0\-based).
+.TP
+\fB\-chr_stop\fP\ \fIN\fP
+Last sequence position to retrieve (1\-based).
+.SS Miscellaneous
+.TP
+\fB\-help\fP
+Print usage information, complete with examples of notable
+.BR \-db / \-format / \-mode
+combinations.
+.TP
+\fB\-complexity\fP\ \fIN\fP
+How much context to fetch:
+.RS
+.PD 0
+.IP \fB0\fP
+default
+.IP \fB1\fP
+Bioseq
+.IP \fB3\fP
+Nuc\-prot set
+.PD
+.RE
+.TP
+\fB\-extend\fP\ \fIN\fP
+Extend sequence retrieval by \fIN\fP residues in both directions.
+.TP
+\fB\-extrafeat\fP\ \fIN\fP
+Bit flag specifying extra features.
+.SH SEE ALSO
+.BR edirect (1),
+.BR efetch.acedb (1),
+.BR esearch (1),
+.BR xtract (1).
diff --git a/debian/man/efilter.1 b/debian/man/efilter.1
new file mode 100644
index 0000000..21a38a3
--- /dev/null
+++ b/debian/man/efilter.1
@@ -0,0 +1,137 @@
+.TH EFILTER 1 2017-10-05 NCBI "NCBI Entrez Direct User's Manual"
+NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+efilter \- filter and/or sort NCBI Entrez search results
+.SH SYNOPSIS
+\fBefilter\fP (\fBefetch \-filter\fP)
+[\|\fB\-help\fP\|]
+[\|\fB\-query\fP\ \fIstr\fP\|]
+[\|\fB\-sort\fP\ \fIfield\fP\|]
+[\|\fB\-days\fP\ \fIN\fP\|]
+[\|\fB\-datetype\fP\ \fIfield\fP\|]
+[\|\fB\-mindate\fP\ \fIdate\fP\|]
+[\|\fB\-maxdate\fP\ \fIdate\fP\|]
+[\|\fB\-field\ \fIfield\fP\|]
+[\|\fB\-pairs\ \fIfield\fP\|]
+[\|\fB\-spell\fP\|]
+[\|\fB\-pub\fP\ \fItype\fP\|]
+[\|\fB\-feature\fP\ \fItype\fP\|]
+[\|\fB\-location\fP\ \fItype\fP\|]
+[\|\fB\-molecule\fP\ \fItype\fP\|]
+[\|\fB\-organism\fP\ \fItype\fP\|]
+[\|\fB\-source\fP\ \fItype\fP\|]
+[\|\fB\-status\ alive\fP\|]
+[\|\fB\-type\fP\ \fItype\fP\|]
+[\|\fB\-label\fP\ \fIname\fP\|]
+.SH DESCRIPTION
+\fBefilter\fP filters and/or sorts results
+from a previous \fBedirect\fP(1) search.
+.SH OPTIONS
+.SS Query Specification
+.TP
+\fB\-query\fP\ \fIstr\fP
+Limit results to those matching the given query string.
+.SS Document Order
+.TP
+\fB\-sort\fP\ \fIfield\fP
+Sort results by the given field.
+.SS Date Constraint
+.TP
+\fB\-days\fP\ \fIN\fP
+Keep only results from the past \fIN\fP days.
+.TP
+\fB\-datetype\fP\ \fIfield\fP
+Which date field (in abbreviated form) to consider.
+.TP
+\fB\-mindate\fP\ \fIdate\fP
+Start of date range.
+.TP
+\fB\-maxdate\fP\ \fIdate\fP
+End of date range.
+.SS Limit by Field
+.TP
+\fB\-field\fP\ \fIfield\fP
+Query words individually in field.
+.TP
+\fB\-pairs\fP\ \fIfield\fP
+Query overlapping word pairs.
+.SS Spell Check
+.TP
+\fB\-spell\fP
+Correct misspellings in query.
+.SS Publication Filters
+.TP
+\fB\-pub\fP\ \fItype\fP
+.BR abstract ,
+.BR clinical ,
+.BR english ,
+.BR free ,
+.BR historical ,
+.BR journal ,
+.BR last_week ,
+.BR last_month ,
+.BR last_year ,
+.BR preprint ,
+.BR review ,
+.BR structured .
+.SS Sequence Filters
+.TP
+\fB\-feature\fP\ \fItype\fP
+.BR gene ,
+.BR mrna ,
+.BR cds ,
+.BR mat_peptide ,
+\&...
+.TP
+\fB\-location\fP\ \fItype\fP
+.BR mitochondrion ,
+.BR chloroplast ,
+.BR plasmid ,
+.BR plastid .
+.TP
+\fB\-molecule\fP\ \fItype\fP
+.BR genomic ,
+.BR mrna ,
+.BR trna ,
+.BR rrna ,
+.BR ncrna .
+.TP
+\fB\-organism\fP\ \fItype\fP
+.BR animals ,
+.BR archaea ,
+.BR bacteria ,
+.BR eukaryotes ,
+.BR fungi ,
+.BR human ,
+.BR insects ,
+.BR mammals ,
+.BR plants ,
+.BR prokaryotes ,
+.BR protists ,
+.BR rodents ,
+.BR viruses .
+.TP
+\fB\-source\fP\ \fItype\fP
+.BR genbank ,
+.BR insd ,
+.BR pdb ,
+.BR pir ,
+.BR refseq ,
+.BR swissprot ,
+.BR tpa
+.SS Gene Filters
+.TP
+\fB\-status\ alive\fP
+.TP
+\fB\-type\fP\ \fItype\fP
+.BR coding ,
+.BR pseudo .
+.SS Miscellaneous Arguments
+.TP
+\fB\-help\fP
+Print usage information.
+.TP
+\fB\-label\fP\ \fIname\fP
+Alias for query step.
+.SH SEE ALSO
+.BR edirect (1).
diff --git a/debian/man/einfo.1 b/debian/man/einfo.1
new file mode 100644
index 0000000..5f56bc5
--- /dev/null
+++ b/debian/man/einfo.1
@@ -0,0 +1,54 @@
+.TH EINFO 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+einfo \- look up general NCBI Entrez database information
+.SH SYNOPSIS
+\fBeinfo\fP (\fBedirect\ \-info\fP)
+[\|\fB\-help\fP\|]
+[\|\fB\-db\fP\ \fIname\fP\|]
+[\|\fB\-dbs\fP\|]
+[\|\fB\-fields\fP\|]
+[\|\fB\-links\fP\|]
+.SH DESCRIPTION
+\fBeinfo\fP looks up general information about
+either an individual NCBI Entrez database
+with which other \fBedirect\fP(1) commands can work
+or the set of available databases as a whole.
+
+\fBeinfo\fP is also the name of an tool
+for accessing contents of local EPUB files.
+To resolve this ambiguity,
+Debian systems with both EPUB utilities and Entrez Direct installed
+arrange for the EPUB\-related executable
+to have the name \fBeinfo.epub\fP(1)
+and for \fBeinfo\fP to be a wrapper script
+that examines its usage and proceeds to run whichever of
+\fBedirect \-info\fP or \fBeinfo.epub\fP(1)
+looks like a better fit.
+.SH OPTIONS
+.SS Database Selection
+.TP
+\fB\-db\fP\ \fIname\fP
+Print information on the specified Entrez database,
+as an XML \fBeInfoResult\fP document.
+.TP
+\fB\-dbs\fP
+Print a plain\-text list of all available Entrez databases.
+.SS Data Summaries
+.TP
+\fB\-fields\fP
+Print just an XML\-structured summary of fields
+in the specified database.
+.TP
+\fB\-links\fP
+Print just an XML\-structured summary of links
+to and from the specified database.
+.SS Miscellaneous
+.TP
+\fB\-help\fP
+Print usage information,
+complete with samples of
+\fB\-fields\fP and \fB\-links\fP XML output.
+.SH SEE ALSO
+.BR edirect (1),
+.BR einfo.epub (1),
+.BR elink (1).
diff --git a/debian/man/elink.1 b/debian/man/elink.1
new file mode 100644
index 0000000..9443bd9
--- /dev/null
+++ b/debian/man/elink.1
@@ -0,0 +1,85 @@
+.TH ELINK 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+elink \- look up related NCBI Entrez records
+.SH SYNOPSIS
+\fBelink\fP (\fBedirect\ \-link\fP)
+[\|\fB\-help\fP\|]
+[\|\fB\-related\fP\|]
+[\|\fB\-target\fP\ \fIdbname\fP\|]
+[\|\fB\-name\fP\ \fIname\fP\|]
+[\|\fB\-db\fP\ \fIname\fP\|]
+[\|\fB\-id\fP\ \fIID(s)\fP\|]
+[\|\fB\-cmd\fP\ \fIcommand\fP\|]
+[\|\fB\-mode\ ref\fP\|]
+[\|\fB\-holding\fP\ \fIprovider\fP\|]
+[\|\fB\-batch\fP\|]
+[\|\fB\-label\fP\ \fIname\fP\|]
+.SH DESCRIPTION
+\fBelink\fP follows links between Entrez databases,
+either extending an existing \fBedirect\fP(1) pipeline
+or honoring explicit \fB\-db\fP and \fB\-id\fP options.
+.SH OPTIONS
+.SS Destination Database
+.TP
+\fB\-related\fP
+Look up neighbors in the same database.
+.TP
+\fB\-target\fP\ \fIdbname\fP
+Follow links to another database.
+.TP
+\fB\-name\fP\ \fIname\fP
+Follow an explicit link name such as
+.BR pubmed_protein_refseq .
+.SS Direct Record Selection
+.TP
+\fB\-db\fP\ \fIname\fP
+Entrez database name for immediate lookups.
+.TP
+\fB\-id\fP\ \fIID(s)\fP
+Unique identifier(s) for immediate lookups.
+.SS Advanced Control
+.TP
+\fB\-cmd\fP\ \fIcommand\fP
+Command type (returns \fBeLinkResult\fP XML):
+.RS
+.PD 0
+.IP \fBneighbor\fP
+Neighbors or links
+.IP \fBneighbor_score\fP
+Neighbors with computed similarity scores
+.IP \fBacheck\fP
+All links available
+.IP \fBncheck\fP
+Existence of neighbors
+.IP \fBlcheck\fP
+Existence of external links (LinkOuts)
+.IP \fBllinks\fP
+Non-library LinkOut providers
+.IP \fBllinkslib\fP
+All LinkOut providers
+.IP \fBprlinks\fP
+Primary LinkOut provider,
+or URL for single UID with \fB-mode\ ref\fP.
+.PD
+.RE
+.TP
+\fB\-mode\ ref\fP
+Use LinkOut provider's web site.
+.TP
+\fB\-holding\fP\ \fIprovider\fP
+Name of LinkOut provider.
+.SS Batch Processing
+.TP
+\fB\-batch\fP
+Bypass Entrez history mechanism.
+.SS Miscellaneous Arguments
+.TP
+\fB\-help\fP
+Print usage information.
+.TP
+\fB\-label\fP\ \fIname\fP
+Alias for query step.
+.SH SEE ALSO
+.BR edirect (1),
+.BR einfo (1),
+.BR epost (1).
diff --git a/debian/man/enotify.1 b/debian/man/enotify.1
new file mode 100644
index 0000000..a19d189
--- /dev/null
+++ b/debian/man/enotify.1
@@ -0,0 +1,25 @@
+.TH ENOTIFY 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+enotify \- send e\-mail with NCBI Entrez search results
+.SH SYNOPSIS
+\fBenotify\fP (\fBedirect\ \-notify\fP)
+[\|\fB\-help\fP\|]
+[\|\fB\-email\fP\ \fIaddress\fP\|]
+[\|\fB\-tool\fP\ \fIname\fP\|]
+.SH DESCRIPTION
+\fBenotify\fP sends e\-mail with results
+of an \fBedirect\fP(1) search.
+.SH OPTIONS
+.TP
+\fB\-help\fP
+Print a summary of available options.
+.TP
+\fB\-email\fP\ \fIaddress\fP
+Use the given e\-mail address.
+.TP
+\fB\-tool\fP\ \fIname
+Identify to Entrez with the given client name.
+.SH SEE ALSO
+.BR eaddress (1),
+.BR econtact (1),
+.BR edirect (1).
diff --git a/debian/man/entrez-phrase-search.1 b/debian/man/entrez-phrase-search.1
new file mode 100644
index 0000000..767f28f
--- /dev/null
+++ b/debian/man/entrez-phrase-search.1
@@ -0,0 +1,47 @@
+.TH ENTREZ-PHRASE-SEARCH 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+entrez\-phrase\-search \- search NCBI Entrez for phrases
+.SH SYNOPSIS
+\fBentrez\-phrase\-search\fP
+[\|\fB\-help\fP\|]
+[\|\fB\-count\fP[\fBs\fP]\|]
+[\|\fB\-string\fP\|]
+[\|\fB\-db\fP\ \fIname\fP\|]
+[\|\fB\-database\fP\ \fIname\fP\|]
+[\|\fB\-field\fP\ \fIname\fP\|]
+\fIquery\fP
+.SH DESCRIPTION
+\fBentrez\-phrase\-search\fP
+is an \fBedirect\fP(1) \fBesearch\fP(1) wrapper script
+that searches an NCBI Entrez database for a phrase
+rather than discrete keywords.
+It works by breaking the query up into pairs of adjacent words
+(disregarding connecting words like "the")
+and intersecting searches
+for word pairs that appear reasonably often.
+.SH OPTIONS
+.TP
+\fB\-help\fP
+Print usage information.
+.TP
+\fB\-count\fP[\fBs\fP]
+Just print counts for individual word pairs.
+.TP
+\fB\-string\fP
+Just print the final query string.
+.TP
+\fB\-db\fP\ \fIname\fP (\fB\-database\fP\ \fIname\fP)
+Search the specified Entrez database
+(default: \fBpubmed\fP).
+.TP
+\fB\-field\fP\ \fIname\fP
+Search the specified field
+(default: \fBTIAB\fP, titles + abstracts).
+.TP
+\fIquery\fP
+Phrase to search for.
+(Quotes optional.)
+.SH SEE ALSO
+.BR edirect (1),
+.BR esearch (1),
+.BR filter\-stop\-words (1).
diff --git a/debian/man/epost.1 b/debian/man/epost.1
new file mode 100644
index 0000000..bddfc55
--- /dev/null
+++ b/debian/man/epost.1
@@ -0,0 +1,41 @@
+.TH EPOST 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+epost \- upload a batch of NCBI Entrez record identifiers
+.SH SYNOPSIS
+\fBepost\fP (\fBedirect\ \-post\fP)
+[\|\fB\-help\fP\|]
+[\|\fB\-db\fP\ \fIname\fP\|]
+[\|\fB\-id\fP\ \fIID(s)\fP\|]
+[\|\fB\-format\fP\ \fIfmt\fP\|]
+[\|\fB\-input\fP\ \fIfilename\fP\|]
+[\|\fB\-label\fP\ \fIname\fP\|]
+.SH DESCRIPTION
+\fBepost\fP uploads a batch of record identifiers
+(textual accessions or numeric UIDs)
+to Entrez history servers for processing
+by other \fBedirect\fP commands.
+By default, it reads these identifiers from standard input.
+.SH OPTIONS
+.TP
+\fB\-help\fP
+Print usage information.
+.TP
+\fB\-db\fP\ \fIname\fP
+Indicate that the identifiers are from the specified database.
+.TP
+\fB\-id\fP\ \fIID(s)\fP
+Specify identifiers directly.
+.TP
+\fB\-format\fP\ \fIfmt\fP
+\fBuid\fP or \fBacc\fP(ession).
+.TP
+\fB\-input\fP\ \fIfilename\fP
+Read from \fIfilename\fP instead of standard input
+(which is then free to receive pipeline state
+from other \fBedirect\fP commands).
+.TP
+\fB\-label\fP\ \fIname\fP
+Alias for query step.
+.SH SEE ALSO
+.BR edirect (1),
+.BR elink (1).
diff --git a/debian/man/eproxy.1 b/debian/man/eproxy.1
new file mode 100644
index 0000000..204ca0f
--- /dev/null
+++ b/debian/man/eproxy.1
@@ -0,0 +1,26 @@
+.TH EPROXY 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+eproxy \- load NCBI Entrez search aliases
+.SH SYNOPSIS
+\fBeproxy\fP (\fBedirect\ \-proxy\fP)
+[\|\fB\-help\fP\|]
+[\|\fB\-alias\fP\ \fIfilename\fP\|]
+[\|\fB\-pipe\fP\|]
+.SH DESCRIPTION
+\fBeproxy\fP loads named search term aliases
+for use in subsequent \fBedirect\fP pipeline stages,
+from a two\-column tab\-delimited text file.
+.SH OPTIONS
+.TP
+\fB\-help\fP
+Print usage information.
+.TP
+\fB\-alias\fP\ \fIfilename\fP
+File of aliases.
+.TP
+\fB\-pipe\fP
+Read aliases from standard input.
+.SH SEE ALSO
+.BR econtact (1),
+.BR edirect (1),
+.BR esearch (1).
diff --git a/debian/man/esearch.1 b/debian/man/esearch.1
new file mode 100644
index 0000000..beed74d
--- /dev/null
+++ b/debian/man/esearch.1
@@ -0,0 +1,67 @@
+.TH ESEARCH 1 2017-10-05 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+esearch \- search an NCBI Entrez database
+.SH SYNOPSIS
+\fBesearch\fP (\fBedirect\ \-search\fP)
+[\|\fB\-help\fP\|]
+\fB\-db\fP\ \fIname\fP
+\fB\-query\fP\ \fIstr\fP
+[\|\fB\-sort\fP\ \fIfield\fP\|]
+[\|\fB\-days\fP\ \fIN\fP\|]
+[\|\fB\-datetype\fP\ \fIfield\fP\|]
+[\|\fB\-mindate\fP\ \fIdate\fP\|]
+[\|\fB\-maxdate\fP\ \fIdate\fP\|]
+[\|\fB\-field\ \fIfield\fP\|]
+[\|\fB\-pairs\ \fIfield\fP\|]
+[\|\fB\-spell\fP\|]
+[\|\fB\-label\fP\ \fIname\fP\|]
+.SH DESCRIPTION
+\fBesearch\fP searches an NCBI Entrez database for a given query.
+.SH OPTIONS
+.SS Query Specification
+.TP
+\fB\-db\fP\ \fIname\fP
+Entrez database name.
+.TP
+\fB\-query\fP\ \fIstr\fP
+Query string.
+.SS Document Order
+.TP
+\fB\-sort\fP\ \fIfield\fP
+Sort results by the given field.
+.SS Date Constraint
+.TP
+\fB\-days\fP\ \fIN\fP
+Return only results from the past \fIN\fP days.
+.TP
+\fB\-datetype\fP\ \fIfield\fP
+Which date field (in abbreviated form) to consider.
+.TP
+\fB\-mindate\fP\ \fIdate\fP
+Start of date range.
+.TP
+\fB\-maxdate\fP\ \fIdate\fP
+End of date range.
+.SS Limit by Field
+.TP
+\fB\-field\fP\ \fIfield\fP
+Query words individually in field.
+.TP
+\fB\-pairs\fP\ \fIfield\fP
+Query overlapping word pairs.
+.SS Spell Check
+.TP
+\fB\-spell\fP
+Correct misspellings in query.
+.SS Miscellaneous Arguments
+.TP
+\fB\-help\fP
+Print usage information.
+.TP
+\fB\-label\fP\ \fIname\fP
+Alias for query step.
+.SH SEE ALSO
+.BR edirect (1),
+.BR efetch (1),
+.BR eproxy (1),
+.BR espell (1).
diff --git a/debian/man/espell.1 b/debian/man/espell.1
new file mode 100644
index 0000000..f3f6ec5
--- /dev/null
+++ b/debian/man/espell.1
@@ -0,0 +1,25 @@
+.TH ESPELL 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+espell \- spell\-correct an NCBI Entrez query
+.SH SYNOPSIS
+\fBespell\fP (\fBedirect\ \-spell\fP)
+[\|\fB\-help\fP\|]
+\fB\-db\fP\ \fIname\fP
+\fB\-query\fP\ \fIstr\fP
+.SH DESCRIPTION
+\fBespell\fP produces an NCBI \fBeSpellResult\fP XML document
+indicating what changes, if any,
+\fBesearch \-spell\fP would make to the given query.
+.SH OPTIONS
+.TP
+\fB\-help\fP
+Print usage information.
+.TP
+\fB\-db\fP\ \fIname\fP
+Entrez database name.
+.TP
+\fB\-query\fP\ \fIstr\fP
+Query string.
+.SH SEE ALSO
+.BR edirect (1),
+.BR esearch (1).
diff --git a/debian/man/esummary.1 b/debian/man/esummary.1
new file mode 100644
index 0000000..d7ee720
--- /dev/null
+++ b/debian/man/esummary.1
@@ -0,0 +1 @@
+.so man1/efetch.1
diff --git a/debian/man/filter-stop-words.1 b/debian/man/filter-stop-words.1
new file mode 100644
index 0000000..8c2d629
--- /dev/null
+++ b/debian/man/filter-stop-words.1
@@ -0,0 +1,15 @@
+.TH FILTER-STOP-WORDS 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+filter\-stop\-words \- filter out unindexed NCBI Entrez words
+.SH SYNOPSIS
+.B filter\-stop\-words
+.SH DESCRIPTION
+\fBfilter\-stop\-words\fP is a Unix\-style filter
+that lets through only those lines of its input
+that do not consist of words that an Entrez search would ignore.
+Its input is expected to comprise
+one lowercase alphanumeric term per line,
+as produced by \fBword\-at\-a\-time\fP(1).
+.SH SEE ALSO
+.BR edirect (1),
+.BR word-at-a-time (1).
diff --git a/debian/man/ftp-cp.1 b/debian/man/ftp-cp.1
new file mode 100644
index 0000000..255d75d
--- /dev/null
+++ b/debian/man/ftp-cp.1
@@ -0,0 +1,15 @@
+.TH FTP-CP 1 2017-07-05 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+ftp\-cp \- download files from an FTP server
+.SH SYNOPSIS
+.B ftp\-cp
+.I server
+.I dir
+[\|\fIfilename...\fP\|]
+.SH DESCRIPTION
+\fBftp\-cp\fP downloads one or more files from a given directory
+on a specified file server.
+If no file names appear on the command line,
+it will read the list of names to use from standard input.
+.SH SEE ALSO
+.BR ftp-ls (1).
diff --git a/debian/man/ftp-ls.1 b/debian/man/ftp-ls.1
new file mode 100644
index 0000000..c6d491e
--- /dev/null
+++ b/debian/man/ftp-ls.1
@@ -0,0 +1,22 @@
+.TH FTP-LS 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+ftp\-ls \- list directory entries on an FTP server
+.SH SYNOPSIS
+.B ftp\-ls
+.I server
+.I dir
+.SH DESCRIPTION
+\fBftp\-ls\fP lists the contents of a given directory
+on a specified file server.
+It prints one line per item,
+using a subset of \fBls\ -F\fP's notation:
+.IP * 3
+Regular files' names appear as is.
+.IP * 3
+Subdirectories' names appear with trailing slashes (\fB/\fP).
+.IP * 3
+Symbolic links' names appear with trailing at signs (\fB@\fP),
+whether they refer to files or directories.
+.SH SEE ALSO
+.BR ftp-cp (1),
+.BR ls (1).
diff --git a/debian/man/gbf2xml.1 b/debian/man/gbf2xml.1
new file mode 100644
index 0000000..5e9597f
--- /dev/null
+++ b/debian/man/gbf2xml.1
@@ -0,0 +1,21 @@
+.TH GBF2XML 1 2017-07-05 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+gbf2xml \- Convert GenBank flatfiles to INSDSeq XML
+.SH SYNOPSIS
+.B gbf2xml
+[\|\fIfilename\fP\|]
+.SH DESCRIPTION
+\fBgbf2xml\fP reads the specified GenBank flatfile
+(or from standard input when not passed a filename)
+and writes a corresponding INSDSeq XML document
+to standard output.
+.SH BUGS
+Feature intervals that refer to 'far' locations, i.e., those not within
+the cited record and which have an accession and colon, are suppressed.
+Those rare features (e.g., trans\-splicing between molecules) are lost.
+
+Keywords and References are currently not supported.
+.SH SEE ALSO
+.BR asn2ff (1),
+.BR asn2gb (1),
+.BR xtract (1).
diff --git a/debian/man/join-into-groups-of.1 b/debian/man/join-into-groups-of.1
new file mode 100644
index 0000000..532c293
--- /dev/null
+++ b/debian/man/join-into-groups-of.1
@@ -0,0 +1,12 @@
+.TH JOIN-INTO-GROUPS-OF 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+join\-into\-groups\-of \- join input words into N\-word groups
+.SH SYNOPSIS
+.B join\-into\-groups\-of
+.I N
+.SH DESCRIPTION
+\fBjoin\-into\-groups\-of\fP is a Unix-style filter
+that splits its input into groups of \fIN\fP words
+(the last group possibly being partial)
+with each group appearing on its own line
+and delimited internally by commas.
diff --git a/debian/man/nquire.1 b/debian/man/nquire.1
new file mode 100644
index 0000000..aa115c2
--- /dev/null
+++ b/debian/man/nquire.1
@@ -0,0 +1,40 @@
+.TH NQUIRE 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+nquire \- query NCBI Entrez Utilities or other parameter\-based web services
+.SH SYNOPSIS
+\fBnquire\fP
+[\|\fB\-help\fP\|]
+[\|\fB\-get\fP\|]
+[\|\fB\-url\fP\ \fIURL\fP\|]
+[\|\fB\-eutils\fP\|]
+[\|\fIcomponent\fP ...\|]
+[\|\fB\-\fP\fItag\fP\ \fIvalue\fP ...\|]
+.SH DESCRIPTION
+\fBnquire\fP performs raw HTTP(S) queries
+against web services such as NCBI E\-Utilities
+that take \fBGET\fP or \fBPOST\fP parameters.
+.SH OPTIONS
+.TP
+\fB\-help\fP
+Print usage information, complete with a few examples,
+some additionally illustrating the use of \fBxtract\fP(1).
+.TP
+\fB\-get\fP
+Use HTTP(S) \fBGET\fP instead of \fBPOST\fP.
+.TP
+\fB\-url\fP\ \fIURL\fP
+Base URL for external search.
+.TP
+\fB\-eutils\fP\ \fIname\fP
+Shorthand for \fB\-url\ https://eutils.ncbi.nlm.nih.gov/entrez/eutils\fP.
+.TP
+\fIcomponent\fP
+Add \fB/\fP\fIcomponent\fP to the base URL.
+(Must precede any tag/value pairs.)
+.TP
+\fB\-\fP\fItag\fP\ \fIvalue\fP\ ...
+Add \fB&tag=\fP\fIvalue\fP,... to the base URL.
+(Must follow any simple components.)
+.SH SEE ALSO
+.BR edirect (1),
+.BR xtract (1).
diff --git a/debian/man/reorder-columns.1 b/debian/man/reorder-columns.1
new file mode 100644
index 0000000..7abd0c5
--- /dev/null
+++ b/debian/man/reorder-columns.1
@@ -0,0 +1,18 @@
+.TH REORDER-COLUMNS 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+reorder\-columns \- reorder columns of a tab\-delimited file
+.SH SYNOPSIS
+\fBreorder\-columns\fP
+\fIN\fP ...
+.SH DESCRIPTION
+\fBreorder\-columns\fP is a Unix-style filter
+that reads tab\-delimited data on standard input
+and prints to standard output a modified version
+with all rows in their original order
+but columns reordered and possibly removed or repeated.
+.SH OPTIONS
+\fIN\fP
+Use input column \fIN\fP next on each line.
+.SH SEE ALSO
+.BR between\-two\-genes (1),
+.BR xtract (1).
diff --git a/debian/man/run-ncbi-converter.1 b/debian/man/run-ncbi-converter.1
new file mode 100644
index 0000000..6ef1dfa
--- /dev/null
+++ b/debian/man/run-ncbi-converter.1
@@ -0,0 +1,25 @@
+.TH RUN-NCBI-CONVERTER 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+run\-ncbi\-converter \- Run a converter from NCBI's FTP site
+.SH SYNOPSIS
+\fBrun\-ncbi\-converter\fP
+\fIname\fP
+\fIarg\fP [\|...\|]
+.SH DESCRIPTION
+\fBrun\-ncbi\-converter\fP runs one of the tools from
+.UR ftp://ftp.ncbi.nlm.nih.gov/toolbox/ncbi_tools/converters
+NCBI's FTP site
+.UE
+with specified arguments.
+It maintains a cache of downloaded tools in
+\fB$NCBI_CONVERTER_DIR\fP
+(\fB$HOME/.cache/ncbi\-converters\fP by default).
+.SH OPTIONS
+.TP
+\fIname\fP
+Converter to run.
+.TP
+\fIarg\fP
+Argument to supply to it.
+.SH SEE ALSO
+.BR efetch (1).
diff --git a/debian/man/sort-uniq-count-rank.1 b/debian/man/sort-uniq-count-rank.1
new file mode 100644
index 0000000..18cf8a9
--- /dev/null
+++ b/debian/man/sort-uniq-count-rank.1
@@ -0,0 +1 @@
+.so man1/sort-uniq-count.1
diff --git a/debian/man/sort-uniq-count.1 b/debian/man/sort-uniq-count.1
new file mode 100644
index 0000000..19063b4
--- /dev/null
+++ b/debian/man/sort-uniq-count.1
@@ -0,0 +1,48 @@
+.TH SORT\-UNIQ\-COUNT 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+sort\-uniq\-count, sort\-uniq\-count\-rank \- print line frequencies
+.SH SYNOPSIS
+\fBsort\-uniq\-count\fP[\|\fB\-rank\fP\|]
+[\|[\|\fB\-\fP\|]\fBb\fP\|]
+[\|[\|\fB\-\fP\|]\fBf\fP\|]
+[\|[\|\fB\-\fP\|]\fBi\fP\|]
+[\|[\|\fB\-\fP\|]\fBn\fP\|]
+[\|[\|\fB\-\fP\|]\fBr\fP\|]
+[\|[\|\fB\-\fP\|]\fBs\fP\|]
+.SH DESCRIPTION
+\fBsort\-uniq\-count\fP and
+\fBsort\-uniq\-count\-rank\fP each
+read a text file on standard input,
+sort it according to any specified flags
+(\fB-f\fP by default),
+and report to standard output how often
+each input line occurs.
+Each output line consists of a count
+followed by a tab and an input line.
+
+\fBsort\-uniq\-count\fP produces its output
+in the user's choice of sort order.
+\fBsort\-uniq\-count\-rank\fP sorts its output
+primarily from highest to lowest count,
+with the user's sort order as a tiebreaker.
+.SH OPTIONS
+.TP
+[\|\fB\-\fP\|]\fBb\fP
+Ignore leading blanks.
+.TP
+[\|\fB\-\fP\|]\fBf\fP
+Ignore capitalization.
+.TP
+[\|\fB\-\fP\|]\fBi\fP
+Consider only printable characters.
+.TP
+[\|\fB\-\fP\|]\fBn\fP
+Compare according to numerical value.
+.TP
+[\|\fB\-\fP\|]\fBr\fP
+Reverse the result of comparisons.
+.TP
+[\|\fB\-\fP\|]\fBs\fP
+Stabilize sort.
+.SH SEE ALSO
+.BR sort (1).
diff --git a/debian/man/word-at-a-time.1 b/debian/man/word-at-a-time.1
new file mode 100644
index 0000000..2199702
--- /dev/null
+++ b/debian/man/word-at-a-time.1
@@ -0,0 +1,12 @@
+.TH WORD-AT-A-TIME 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+word\-at\-a\-time \- parse an input file into alphanumeric words
+.SH SYNOPSIS
+.B word\-at\-a\-time
+.SH DESCRIPTION
+\fBword\-at\-a\-time\fP reads a text file on standard input,
+extracts all sequences of digits and English letters,
+lowercases any capital letters,
+and prints the resulting terms in order, one per line.
+.SH SEE ALSO
+.BR join\-into\-groups\-of (1).
diff --git a/debian/man/xtract.1 b/debian/man/xtract.1
new file mode 100644
index 0000000..5b343a4
--- /dev/null
+++ b/debian/man/xtract.1
@@ -0,0 +1,469 @@
+.TH XTRACT 1 2017-06-05 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+xtract \- convert XML into a table of data values
+.SH SYNOPSIS
+\fBxtract\fP
+[\|\fB\-help\fP\|]
+[\|\fB\-compress\fP\|]
+[\|\fB\-mixed\fP\|]
+[\|\fB\-strict\fP\|]
+[\|\fB\-accent\fP\|]
+[\|\fB\-input\fP\ \fIfilename\fP\|]
+[\|\fB\-pattern\fP\ \fIexpr\fP\|]
+[\|\fB\-group\fP\ \fIexpr\fP\|]
+[\|\fB\-block\fP\ \fIexpr\fP\|]
+[\|\fB\-subset\fP\ \fIexpr\fP\|]
+[\|\fB\-if\fP\ \fIexpr\fP\ [\|\fIconstraint\fP\|]\|]
+[\|\fB\-unless\fP\ \fIexpr\fP\ [\|\fIconstraint\fP\|]\|]
+[\|\fB\-and\fP\ \fIcondition\fP\|]
+[\|\fB\-or\fP\ \fIcondition\fP\|]
+[\|\fB\-else\fP\|]
+[\|\fB\-position\fP\ \fIpos\fP\|]
+[\|\fB\-equals\fP\ \fIstr\fP\|]
+[\|\fB\-contains\fP\ \fIstr\fP\|]
+[\|\fB\-starts\-with\fP\ \fIstr\fP\|]
+[\|\fB\-ends\-with\fP\ \fIstr\fP\|]
+[\|\fB\-is\-not\fP\ \fIstr\fP\|]
+[\|\fB\-gt\fP\ \fIN\fP\|]
+[\|\fB\-ge\fP\ \fIN\fP\|]
+[\|\fB\-lt\fP\ \fIN\fP\|]
+[\|\fB\-le\fP\ \fIN\fP\|]
+[\|\fB\-eq\fP\ \fIN\fP\|]
+[\|\fB\-ne\fP\ \fIN\fP\|]
+[\|\fB\-ret\fP\ \fIstr\fP\|]
+[\|\fB\-tab\fP\ \fIstr\fP\|]
+[\|\fB\-sep\fP\ \fIstr\fP\|]
+[\|\fB\-pfx\fP\ \fIstr\fP\|]
+[\|\fB\-sfx\fP\ \fIstr\fP\|]
+[\|\fB\-clr\fP\|]
+[\|\fB\-pfc\fP\ \fIstr\fP\|]
+[\|\fB\-rst\fP\|]
+[\|\fB\-def\fP\ \fIstr\fP\|]
+[\|\fB\-lbl\fP\ \fIstr\fP\|]
+[\|\fB\-element\fP\ \fIelement\fP\|]
+[\|\fB\-first\fP\ \fIelement\fP\|]
+[\|\fB\-last\fP\ \fIelement\fP\|]
+[\|\fB\-\fP\fINAME\fP\|]
+[\|\fB\-num\fP\ \fIelement\fP\|]
+[\|\fB\-len\fP\ \fIelement\fP\|]
+[\|\fB\-sum\fP\ \fIelement\fP\|]
+[\|\fB\-min\fP\ \fIelement\fP\|]
+[\|\fB\-max\fP\ \fIelement\fP\|]
+[\|\fB\-inc\fP\ \fIelement\fP\|]
+[\|\fB\-dec\fP\ \fIelement\fP\|]
+[\|\fB\-sub\fP\ \fIelement\fP\|]
+[\|\fB\-avg\fP\ \fIelement\fP\|]
+[\|\fB\-dev\fP\ \fIelement\fP\|]
+[\|\fB\-encode\fP\ \fIelement\fP\|]
+[\|\fB\-upper\fP\ \fIelement\fP\|]
+[\|\fB\-lower\fP\ \fIelement\fP\|]
+[\|\fB\-title\fP\ \fIelement\fP\|]
+[\|\fB\-terms\fP\ \fIelement\fP\|]
+[\|\fB\-words\fP\ \fIelement\fP\|]
+[\|\fB\-pairs\fP\ \fIelement\fP\|]
+[\|\fB\-letters\fP\ \fIelement\fP\|]
+[\|\fB\-indices\fP\ \fIelement\fP\|]
+[\|\fB\-0\-based\fP\ \fIelement\fP\|]
+[\|\fB\-1\-based\fP\ \fIelement\fP\|]
+[\|\fB\-ucsc\-based\fP\ \fIelement\fP\|]
+[\|\fB\-insd\fP\ \fIarg\fP\ ...\|]
+[\|\fB\-head\fP\ \fIstr\fP\|]
+[\|\fB\-tail\fP\ \fIstr\fP\|]
+[\|\fB\-hd\fP\ \fIstr\fP\|]
+[\|\fB\-tl\fP\ \fIstr\fP\|]
+[\|\fB\-format\fP\ \fIfmt\fP\|]
+[\|\fB\-filter\fP\ \fIelement\fP \fIaction\fP\ \fItarget\fP\|]
+[\|\fB\-verify\fP\|]
+[\|\fB\-outline\fP\|]
+[\|\fB\-synopsis\fP\|]
+[\|\fB\-stash\fP\ \fIdirectory\fP\|]
+[\|\fB\-index\fP\ \fIelement\fP\|]
+[\|\fB\-missing\fP\|]
+[\|\fB\-phrase\fP\ \fIstr\fP\|]
+[\|\fB\-examples\fP\|]
+[\|\fB\-extras\fP\|]
+[\|\fB\-version\fP\|]
+.SH DESCRIPTION
+\fBxtract\fP converts an XML document
+into a table of data values
+according to user\-specified rules.
+.SH OPTIONS
+.SS Processing Flags
+.TP
+\fB\-compress\fP
+Compress runs of spaces.
+.TP
+\fB\-mixed\fP
+Allow PubMed mixed content.
+.TP
+\fB\-strict\fP
+Remove HTML highlight tags.
+.TP
+\fB\-accent\fP
+Delete Unicode accents.
+.TP
+\fB\-input\fP\ \fIfilename\fP
+Read XML from file instead of standard input.
+.SS Exploration Argument Hierarchy
+.PD 0
+.TP
+\fB\-pattern\fP\ \fIexpr\fP
+.TP
+\fB\-group\fP\ \fIexpr\fP
+.TP
+\fB\-block\fP\ \fIexpr\fP
+.TP
+\fB\-subset\fP\ \fIexpr\fP
+Name of record within set.
+Use of different argument names allows
+command-line control of nested looping.
+.PD
+.SS Exploration Constructs
+.PD 0
+.IP Object 15
+\fBDateCreated\fP
+.IP Parent/Child 15
+\fBBook/AuthorList\fP
+.IP Heterogeneous 15
+\fB"PubmedArticleSet/*"\fP
+.IP Nested 15
+\fB"*/Taxon"\fP
+.IP Recursive 15
+\fB"**/Gene-commentary"\fP
+.PD
+.SS Conditional Execution
+.TP
+\fB\-if\fP\ \fIexpr\fP\ [\|\fIconstraint\fP\|]
+Element (or \fB@\fP\fIattribute\fP) must exist
+and satisfy any specified constraint.
+.TP
+\fB\-unless\fP\ \fIexpr\fP\ [\|\fIconstraint\fP\|]
+Skip if element matches.
+.TP
+\fB\-and\fP\ \fIcondition\fP
+Preceding and following tests must both pass.
+.TP
+\fB\-or\fP\ \fIcondition\fP
+Any passing test suffices.
+.TP
+\fB\-else\fP
+Execute if conditional test failed.
+.TP
+\fB\-position\fP\ \fIpos\fP
+Must be at \fBfirst\fP/\fBlast\fP location in list.
+.SS String Constraints
+.TP
+\fB\-equals\fP\ \fIstr\fP
+String must match exactly.
+.TP
+\fB\-contains\fP\ \fIstr\fP
+Substring must be present.
+.TP
+\fB\-starts\-with\fP\ \fIstr\fP
+Substring must be at beginning.
+.TP
+\fB\-ends\-with\fP\ \fIstr\fP
+Substring must be at end.
+.TP
+\fB\-is\-not\fP\ \fIstr\fP
+String must not match.
+.SS Numeric Constraints
+.TP
+\fB\-gt\fP\ \fIN\fP
+Greater than.
+.TP
+\fB\-ge\fP\ \fIN\fP
+Greater than or equal to.
+.TP
+\fB\-lt\fP\ \fIN\fP
+Less than to.
+.TP
+\fB\-le\fP\ \fIN\fP
+Less than or equal to.
+.TP
+\fB\-eq\fP\ \fIN\fP
+Equal to.
+.TP
+\fB\-ne\fP\ \fIN\fP
+Not equal to.
+.SS Format Customization
+.TP
+\fB\-ret\fP\ \fIstr\fP
+Override line break between patterns.
+.TP
+\fB\-tab\fP\ \fIstr\fP
+Replace tab character between fields.
+.TP
+\fB\-sep\fP\ \fIstr\fP
+Separator between group members.
+.TP
+\fB\-pfx\fP\ \fIstr\fP
+Prefix to print before group.
+.TP
+\fB\-sfx\fP\ \fIstr\fP
+Suffix to print after group.
+.TP
+\fB\-clr\fP
+Clear queued tab separator.
+.TP
+\fB\-pfc\fP\ \fIstr\fP
+Preface combines \fB\-clr\fP and \fB\-pfx\fP.
+.TP
+\fB\-rst\fP
+Reset \fB\-sep\fP, \fB\-pfx\fP, and \fB\-sfx\fP.
+.TP
+\fB\-def\fP\ \fIstr\fP
+Default placeholder for missing fields.
+.TP
+\fB\-lbl\fP\ \fIstr\fP
+Insert arbitrary text.
+.SS Element Selection
+.TP
+\fB\-element\fP\ \fIelement\fP
+Print all items that match tag name.
+.TP
+\fB\-first\fP\ \fIelement\fP
+Only print value of first item.
+.TP
+\fB\-last\fP\ \fIelement\fP
+Only print value of last item.
+.TP
+\fB\-\fP\fINAME\fP
+Record value in named variable.
+.SS \-element Constructs
+.PD 0
+.IP Tag 15
+\fBCaption\fP
+.IP Group 15
+\fBInitials,LastName\fP
+.IP Attribute 15
+\fBDescriptorName@MajorTopicYN\fP
+.IP Recursive 15
+\fB"**/Gene-commentary_accession"\fP
+.IP "Object Count" 15
+\fB"#Author"\fP
+.IP "Item Length" 15
+\fB"%Title"\fP
+.IP "Element Depth" 15
+\fB"^PMID"\fP
+.IP Variable 15
+\fB"&NAME"\fP
+.PD
+.SS Special \-element Operations
+.PD 0
+.IP "Parent Index" 15
+\fB"+"\fP
+.IP "XML Subtree" 15
+\fB"*"\fP
+.IP Children 15
+\fB"$"\fP
+.IP Attributes 15
+\fB"@"\fP
+.PD
+.SS Numeric Processing
+.TP
+\fB\-num\fP\ \fIelement\fP
+Count.
+.TP
+\fB\-len\fP\ \fIelement\fP
+Length.
+.TP
+\fB\-sum\fP\ \fIelement\fP
+Sum.
+.TP
+\fB\-min\fP\ \fIelement\fP
+Minimum.
+.TP
+\fB\-max\fP\ \fIelement\fP
+Maximum.
+.TP
+\fB\-inc\fP\ \fIelement\fP
+Increment.
+.TP
+\fB\-dec\fP\ \fIelement\fP
+Decrement.
+.TP
+\fB\-sub\fP\ \fIelement\fP
+Difference.
+.TP
+\fB\-avg\fP\ \fIelement\fP
+Average.
+.TP
+\fB\-dev\fP\ \fIelement\fP
+Deviation.
+.SS String Processing
+.TP
+\fB\-encode\fP\ \fIelement\fP
+URL\-encode \fB<\fP, \fB>\fP, \fB&\fP,
+\fB\(dq\fP, and \fB\[aq]\fP characters.
+.TP
+\fB\-upper\fP\ \fIelement\fP
+Convert text to uppercase.
+.TP
+\fB\-lower\fP\ \fIelement\fP
+Convert text to lowercase.
+.TP
+\fB\-title\fP\ \fIelement\fP
+Capitalize initial letters of words.
+.SS Phrase Processing
+.TP
+\fB\-terms\fP\ \fIelement\fP
+Partition phrase at spaces.
+.TP
+\fB\-words\fP\ \fIelement\fP
+Split at punctuation marks.
+.TP
+\fB\-pairs\fP\ \fIelement\fP
+Adjacent informative words.
+.TP
+\fB\-letters\fP\ \fIelement\fP
+Separate individual letters.
+.TP
+\fB\-indices\fP\ \fIelement\fP
+Experimental index generation.
+.SS Sequence Coordinates
+.TP
+\fB\-0\-based\fP\ \fIelement\fP
+Zero\-based.
+.TP
+\fB\-1\-based\fP\ \fIelement\fP
+One\-based.
+.TP
+\fB\-ucsc\-based\fP\ \fIelement\fP
+Half\-open.
+.SS Command Generator
+.TP
+\fB\-insd\fP\ \fIarg\fP\ ...
+Generate INSDSeq extraction commands.
+Print them if invoked standalone;
+run them if invoked as part of a pipeline.
+Requires one or more arguments,
+which may appear in the following order:
+.RS
+.\".PD 0
+.IP Descriptor(s) 15
+.BR INSDSeq_sequence / INSDSeq_definition / INSDSeq_division "/... [\|...\|]"
+.IP Completeness 15
+.BR complete / partial
+.IP Feature(s) 15
+.BR CDS / mRNA /...[\| , ...\|]
+.IP Qualifier(s)
+.BR INSDFeature_key / \(dq#INSDInterval\(dq / gene / product "/... [\|...\|]"
+.\".PD
+.RE
+.SS Miscellaneous
+.TP
+\fB\-head\fP\ \fIstr\fP
+Print before everything else.
+.TP
+\fB\-tail\fP\ \fIstr\fP
+Print after everything else.
+.TP
+\fB\-hd\fP\ \fIstr\fP
+Print before each record.
+.TP
+\fB\-tl\fP\ \fIstr\fP
+Print after each record.
+.SS Reformatting
+.TP
+\fB\-format\fP\ \fIfmt\fP
+.PD 0
+.RS
+.IP \fBcopy\fP 9
+Fast block copy (still applies processing flags).
+.IP \fBcompact\fP 9
+Compress runs of spaces.
+.IP \fBflush\fP 9
+Suppress line indentation.
+.IP \fBindent\fP 9
+Indent according to nesting depth.
+.IP \fBexpand\fP 9
+Place each attribute on a separate line.
+.RE
+.PD
+.SS Modification
+.TP
+\fB\-filter\fP\ \fIelement\fP \fIaction\fP\ \fItarget\fP
+Actions:
+.PD 0
+.RS
+.IP \fBretain\fP 12
+Keep matching elements (no\-op).
+.IP \fBremove\fP 12
+Remove matching elements.
+.IP \fBencode\fP 12
+HTML\-escape special characters.
+.IP \fBdecode\fP 12
+Decode HTML escapes.
+.IP \fBshrink\fP 12
+Compress runs of spaces.
+.IP \fBexpand\fP 12
+Place each attribute on a separate line.
+.IP \fBaccent\fP 12
+Strip off Unicode accents.
+.PD
+.P
+Targets:
+.PD 0
+.IP \fBcontent\fP 12
+Plain\-text content.
+.IP \fBcdata\fP 12
+\fBCDATA\fP blocks.
+.IP \fBcomment\fP 12
+Comments.
+.IP \fBobject\fP 12
+The whole object.
+.IP \fBattributes\fP 12
+Attributes.
+.IP \fBcontainer\fP 12
+Start and end tags.
+.RE
+.PD
+.SS Summary
+.TP
+\fB\-outline\fP
+Display outline of XML structure.
+.TP
+\fB\-synopsis\fP
+Display count of unique XML paths.
+.SS Local Record Indexing
+.TP
+\fB\-stash\fP\ \fIdirectory\fP
+Base path for individual XML files.
+.TP
+\fB\-index\fP\ \fIelement\fP
+Name of element to use for identifier.
+.TP
+\fB\-missing\fP
+Print list of missing identifiers.
+.TP
+\fB\-phrase\fP\ \fIstr\fP
+Keep records that contain a given phrase.
+.SS Documentation
+.TP
+\fB\-help\fP
+Print usage information and some example argument combinations.
+.TP
+\fB\-examples\fP
+Complete examples of \fBedirect\fP(1) and \fBxtract\fP usage.
+.TP
+\fB\-extras\fP
+Batch and local processing examples,
+and a summary of specialized options
+the main \fB-help\fP text doesn't cover.
+.TP
+\fB-version\fP
+Print version number.
+.SH NOTES
+String constraints use case\-insensitive comparisons.
+
+Numeric constraints and selection arguments use integer values.
+
+\fB\-num\fP and \fB\-len\fP selections are synonyms for
+Object Count (\fB#\fP) and Item Length (\fB%\fP).
+
+\fB\-words\fP, \fB\-pairs\fP, and \fB\-indices\fP
+convert to lower case.
+.SH SEE ALSO
+.BR edirect (1),
+.BR xy-plot (1).
diff --git a/debian/man/xy-plot.1 b/debian/man/xy-plot.1
new file mode 100644
index 0000000..ac64a2b
--- /dev/null
+++ b/debian/man/xy-plot.1
@@ -0,0 +1,19 @@
+.TH XY-PLOT 1 2017-01-24 NCBI "NCBI Entrez Direct User's Manual"
+.SH NAME
+xy\-plot \- produce and display a line graph
+.SH SYNOPSIS
+\fBxy\-plot\fP
+[\|\fIfilename\fP\|]
+.SH DESCRIPTION
+xy\-plot reads from standard input a two\-column text file
+whose columns contain \fIx\fP and \fIy\fP coordinates respectively,
+generates a corresponding PNG image,
+and (if possible) displays the image to the user.
+.SH OPTIONS
+.TP
+\fIfilename\fP
+Output filename (\fBedirect.png\fP by default).
+Explicitly specifying the \fB.png\fP extension may be helpful.
+.SH SEE ALSO
+.BR xdg-open (1).
+
diff --git a/debian/manpages b/debian/manpages
new file mode 100644
index 0000000..13cdaf4
--- /dev/null
+++ b/debian/manpages
@@ -0,0 +1 @@
+debian/man/*.1
diff --git a/debian/patches/debian-changes b/debian/patches/debian-changes
new file mode 100644
index 0000000..6e638bd
--- /dev/null
+++ b/debian/patches/debian-changes
@@ -0,0 +1,43 @@
+Description: <short summary of the patch>
+ TODO: Put a short summary on the line above and replace this paragraph
+ with a longer explanation of this change. Complete the meta-information
+ with other relevant fields (see below for details). To make it easier, the
+ information below has been extracted from the changelog. Adjust it or drop
+ it.
+ .
+ ncbi-entrez-direct (6.90.20170705+ds-2) unstable; urgency=medium
+ .
+ * debian/rules: Rework Go-related logic to accommodate builds on
+ (non-release) architectures on which I've had to conditionalize out
+ the relevant build dependencies.
+Author: Aaron M. Ucko <ucko@debian.org>
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: https://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: 2017-07-07
+
+--- /dev/null
++++ ncbi-entrez-direct-6.90.20170705+ds/.gitignore
+@@ -0,0 +1,2 @@
++.pc
++bin
+--- ncbi-entrez-direct-6.90.20170705+ds.orig/xtract.pl
++++ ncbi-entrez-direct-6.90.20170705+ds/xtract.pl
+@@ -1788,7 +1788,7 @@ sub xtract {
+ # report execution time of original Perl implementation for comparison to new Go compiled version
+ $timer = true;
+
+- } elsif ( $ARGV[0] ne "-fallback" ) {
++ } elsif ( 0 && $ARGV[0] ne "-fallback" ) {
+
+ # ensure that platform-specific Go compiled version was used if available
+ print STDERR "\nPLEASE REWRITE YOUR SCRIPT TO CALL XTRACT INSTEAD OF XTRACT.PL.\n";
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..7bb8252
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+debian-changes
diff --git a/debian/postrm b/debian/postrm
new file mode 100755
index 0000000..5e5a803
--- /dev/null
+++ b/debian/postrm
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -e
+
+#DEBHELPER#
+
+if [ "$1" = "remove" ]; then
+ for x in efetch einfo; do
+ dpkg-divert --package ncbi-entrez-direct --remove --rename /usr/bin/$x
+ dpkg-divert --package ncbi-entrez-direct --remove --rename \
+ /usr/share/man/man1/$x.1.gz
+ done
+fi
diff --git a/debian/preinst b/debian/preinst
new file mode 100755
index 0000000..8794233
--- /dev/null
+++ b/debian/preinst
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -e
+
+#DEBHELPER#
+
+case "$1" in
+ install | upgrade )
+ dpkg-divert --package ncbi-entrez-direct --rename \
+ --divert /usr/bin/efetch.acedb /usr/bin/efetch
+ dpkg-divert --package ncbi-entrez-direct --rename \
+ --divert /usr/share/man/man1/efetch.acedb.1.gz \
+ /usr/share/man/man1/efetch.1.gz
+ dpkg-divert --package ncbi-entrez-direct --rename \
+ --divert /usr/bin/einfo.epub /usr/bin/einfo
+ dpkg-divert --package ncbi-entrez-direct --rename \
+ --divert /usr/share/man/man1/einfo.epub.1.gz \
+ /usr/share/man/man1/einfo.1.gz
+ ;;
+esac
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..e90250b
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,62 @@
+#!/usr/bin/make -f
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/default.mk
+
+%:
+ dh $@
+
+MODES = address citmatch contact filter link notify post proxy search spell
+STD_WRAPPERS = $(MODES:%=bin/e%)
+WRAPPERS = $(STD_WRAPPERS) bin/esummary
+AS_IS_SCRIPTS = amino-acid-composition between-two-genes edirutil \
+ entrez-phrase-search filter-stop-words ftp-* gbf2xml \
+ join-into-groups-of nquire reorder-columns sort-uniq-count* \
+ word-at-a-time xy-plot
+
+GOCODE = /usr/share/gocode
+GOLIBSRC = $(wildcard $(GOCODE)/src/golang.org/x/text)
+
+ifneq (,$(GOLIBSRC))
+ export GOPATH = $(CURDIR)/debian/gopath
+ GOLIBS = $(GOLIBSRC:$(GOCODE)/%=$(GOPATH)/%)
+
+ GOVERSION := $(word 3,$(shell go version)) # go version **goX.Y.Z** OS/CPU
+ GO_IS_OLD := $(shell dpkg --compare-versions 0$(GOVERSION) ge 0go1.8 || echo $$?)
+ ifneq (,$(GO_IS_OLD))
+ export PATH := /usr/lib/go-1.8/bin:$(PATH)
+ endif
+
+ $(GOLIBS): $(GOPATH)/%: /usr/share/gocode/%
+ mkdir -p $(dir $@)
+ ln -s $< $@
+endif
+
+bin/edirect: edirect.pl
+ mkdir -p bin
+ install $< $@
+
+$(STD_WRAPPERS): bin/e%: bin/edirect
+ echo '#!/bin/sh' > $@
+ echo 'exec /usr/bin/edirect -$* "$$@"' >> $@
+ chmod +x $@
+
+bin/esummary: bin/edirect
+ echo '#!/bin/sh' > $@
+ echo 'exec /usr/bin/edirect -fetch -format docsum "$$@"' >> $@
+ chmod +x $@
+
+override_dh_auto_build: $(WRAPPERS) $(GOLIBS)
+ dh_auto_build
+ install $(AS_IS_SCRIPTS) debian/efetch debian/einfo bin/
+# Always use gccgo? The resulting binary would be much smaller, but
+# pull in a large shared library with few other reverse dependencies.
+ go build -v -gccgoflags '$(CFLAGS) $(LDFLAGS)' -o bin/xtract xtract.go \
+ || install xtract.pl bin/xtract
+
+override_dh_auto_clean:
+ dh_auto_clean
+ rm -rf bin $(GOPATH)
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/options b/debian/source/options
new file mode 100644
index 0000000..7423a2d
--- /dev/null
+++ b/debian/source/options
@@ -0,0 +1 @@
+single-debian-patch
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..c7c9676
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,4 @@
+version=3
+opts="dversionmangle=s/\+ds//,repacksuffix=+ds" \
+https://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/versions/([\d.]+)/edirect-([\d.]+).tar.gz \
+debian uupdate
diff --git a/xtract.pl b/xtract.pl
index bd730c2..25d8374 100755
--- a/xtract.pl
+++ b/xtract.pl
@@ -1788,7 +1788,7 @@ sub xtract {
# report execution time of original Perl implementation for comparison to new Go compiled version
$timer = true;
- } elsif ( $ARGV[0] ne "-fallback" ) {
+ } elsif ( 0 && $ARGV[0] ne "-fallback" ) {
# ensure that platform-specific Go compiled version was used if available
print STDERR "\nPLEASE REWRITE YOUR SCRIPT TO CALL XTRACT INSTEAD OF XTRACT.PL.\n";