summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-biology/ncbi-tools')
-rw-r--r--sci-biology/ncbi-tools/Manifest1
-rw-r--r--sci-biology/ncbi-tools/files/21ncbi-r16
-rw-r--r--sci-biology/ncbi-tools/files/ncbi-tools-2.2.26-_DEFAULT_SOURCE.patch81
-rw-r--r--sci-biology/ncbi-tools/files/ncbi-tools-2.2.26-bfr-overflow.patch103
-rw-r--r--sci-biology/ncbi-tools/files/ncbi-tools-2.2.26-format-security.patch124
-rw-r--r--sci-biology/ncbi-tools/files/ncbi-tools-asn2all.patch27
-rw-r--r--sci-biology/ncbi-tools/files/ncbi-tools-extra_vib.patch37
-rw-r--r--sci-biology/ncbi-tools/files/ncbi-tools-lop.patch15
-rw-r--r--sci-biology/ncbi-tools/files/ncbirc2
-rw-r--r--sci-biology/ncbi-tools/metadata.xml5
-rw-r--r--sci-biology/ncbi-tools/ncbi-tools-2.2.26-r2.ebuild165
11 files changed, 566 insertions, 0 deletions
diff --git a/sci-biology/ncbi-tools/Manifest b/sci-biology/ncbi-tools/Manifest
new file mode 100644
index 000000000000..b4e27e229585
--- /dev/null
+++ b/sci-biology/ncbi-tools/Manifest
@@ -0,0 +1 @@
+DIST ncbi-tools-2.2.26.tar.gz 68691452 SHA256 d8fffac25efc8ca894c707c840a4797a8a949ae6fd983d2f91c9972f788efb7d SHA512 da167216b56386b8c91a660e8ea0f3ac39b991d4519af9e02fc26aa16ed602eb3d9d874446f69a8f6840ae31a4d5a29da170e04e8a72b56f8c3ca038d1437014 WHIRLPOOL 6f390a4487b7ebf9d5ca31018f3b33602a695e4b0a4b090952fec9c7e8c3956edc197e75ffd32588f9431cc04b4262a2ca2e3b0ba50dd622ed73a4da6655a956
diff --git a/sci-biology/ncbi-tools/files/21ncbi-r1 b/sci-biology/ncbi-tools/files/21ncbi-r1
new file mode 100644
index 000000000000..d4de68e6081a
--- /dev/null
+++ b/sci-biology/ncbi-tools/files/21ncbi-r1
@@ -0,0 +1,6 @@
+# Location of the formatdb data sets
+BLASTDB="/usr/share/ncbi/formatdb"
+# Location of the BLAST matrixes.
+BLASTMAT="/usr/share/ncbi/data"
+# Location of the ".ncbi.rc" file which sets the default path for shared data.
+NCBI=/etc/ncbi
diff --git a/sci-biology/ncbi-tools/files/ncbi-tools-2.2.26-_DEFAULT_SOURCE.patch b/sci-biology/ncbi-tools/files/ncbi-tools-2.2.26-_DEFAULT_SOURCE.patch
new file mode 100644
index 000000000000..bbc4623609c8
--- /dev/null
+++ b/sci-biology/ncbi-tools/files/ncbi-tools-2.2.26-_DEFAULT_SOURCE.patch
@@ -0,0 +1,81 @@
+ corelib/ncbilcl.beos | 2 +-
+ corelib/ncbilcl.hlx | 2 +-
+ corelib/ncbilcl.lnx | 4 ++--
+ corelib/ncbilcl.plx | 2 +-
+ corelib/ncbilcl.qnx | 2 +-
+ 5 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/corelib/ncbilcl.beos b/corelib/ncbilcl.beos
+index f720567..fe6346f 100644
+--- a/corelib/ncbilcl.beos
++++ b/corelib/ncbilcl.beos
+@@ -77,7 +77,7 @@
+ #endif
+
+ /* good for the EGCS C/C++ compiler on Linux(e.g. putenv(), tempnam() proto) */
+-#define _SVID_SOURCE 1
++#define _DEFAULT_SOURCE 1
+
+
+ /*----------------------------------------------------------------------*/
+diff --git a/corelib/ncbilcl.hlx b/corelib/ncbilcl.hlx
+index 1492f93..0e98fb6 100644
+--- a/corelib/ncbilcl.hlx
++++ b/corelib/ncbilcl.hlx
+@@ -67,7 +67,7 @@
+ #endif
+
+ /* good for the EGCS C/C++ compiler on Linux(e.g. putenv(), tempnam() proto) */
+-/*#define _SVID_SOURCE 1 */
++/*#define _DEFAULT_SOURCE 1 */
+
+
+ /*----------------------------------------------------------------------*/
+diff --git a/corelib/ncbilcl.lnx b/corelib/ncbilcl.lnx
+index 46e2978..b3256b3 100644
+--- a/corelib/ncbilcl.lnx
++++ b/corelib/ncbilcl.lnx
+@@ -65,7 +65,7 @@
+ * fixes for new RedHat6.2
+ *
+ * Revision 6.3 2000/02/10 16:36:32 vakatov
+-* Added _SVID_SOURCE
++* Added _DEFAULT_SOURCE
+ *
+ * Revision 6.2 1999/07/12 05:50:49 vakatov
+ * Avoid redefinition of #_REENTRANT
+@@ -141,7 +141,7 @@
+ #endif
+
+ /* good for the EGCS C/C++ compiler on Linux(e.g. putenv(), tempnam() proto) */
+-#define _SVID_SOURCE 1
++#define _DEFAULT_SOURCE 1
+ #define _GNU_SOURCE 1
+
+ /*----------------------------------------------------------------------*/
+diff --git a/corelib/ncbilcl.plx b/corelib/ncbilcl.plx
+index bf5824c..f2b53e1 100644
+--- a/corelib/ncbilcl.plx
++++ b/corelib/ncbilcl.plx
+@@ -68,7 +68,7 @@
+ #endif
+
+ /* good for the EGCS C/C++ compiler on Linux(e.g. putenv(), tempnam() proto) */
+-/*#define _SVID_SOURCE 1 */
++/*#define _DEFAULT_SOURCE 1 */
+
+
+ /*----------------------------------------------------------------------*/
+diff --git a/corelib/ncbilcl.qnx b/corelib/ncbilcl.qnx
+index c3d1f0a..4b27bd1 100644
+--- a/corelib/ncbilcl.qnx
++++ b/corelib/ncbilcl.qnx
+@@ -72,7 +72,7 @@
+ #endif
+
+ /* good for the EGCS C/C++ compiler on Linux(e.g. putenv(), tempnam() proto) */
+-#define _SVID_SOURCE 1
++#define _DEFAULT_SOURCE 1
+
+
+
diff --git a/sci-biology/ncbi-tools/files/ncbi-tools-2.2.26-bfr-overflow.patch b/sci-biology/ncbi-tools/files/ncbi-tools-2.2.26-bfr-overflow.patch
new file mode 100644
index 000000000000..e6763214a6e5
--- /dev/null
+++ b/sci-biology/ncbi-tools/files/ncbi-tools-2.2.26-bfr-overflow.patch
@@ -0,0 +1,103 @@
+ cdromlib/cdnewlib.c | 6 +++---
+ corelib/ncbierr.c | 2 +-
+ corelib/ncbisgml.c | 8 ++++----
+ demo/errhdr.c | 2 +-
+ 4 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/cdromlib/cdnewlib.c b/cdromlib/cdnewlib.c
+index 461292c..be4a2d6 100644
+--- a/cdromlib/cdnewlib.c
++++ b/cdromlib/cdnewlib.c
+@@ -2676,7 +2676,7 @@ static int CdDevice_FileBuildPath (CdDevice *cddev, char *fpath, const char *fdi
+ char volname[16];
+ volname[0] = '\0';
+ if (cddev->volume != NULL)
+- strncat(volname,cddev->volume->volume_name,sizeof volname);
++ strncat(volname,cddev->volume->volume_name,sizeof volname - 1);
+ else
+ sprintf(volname,"entrez%d",cddev->hint);
+ if (!FileBuildPath(fpath,volname,NULL))
+@@ -2748,7 +2748,7 @@ static int CdDevice_Init (CdDevice *cddev)
+ memset((void*)&info,0,sizeof info);
+ fpath[0] = '\0';
+ if (cddev->inf.root !=NULL)
+- strncat(fpath,cddev->inf.root,sizeof fpath);
++ strncat(fpath,cddev->inf.root,sizeof fpath - 1);
+
+ if (cddev->ins_volname)
+ {
+@@ -2766,7 +2766,7 @@ static int CdDevice_Init (CdDevice *cddev)
+ {
+ fpath[0] = '\0';
+ if (cddev->inf.root !=NULL)
+- strncat(fpath,cddev->inf.root,sizeof fpath);
++ strncat(fpath,cddev->inf.root,sizeof fpath - 1);
+ sprintf(volname,"entrez%d",j+1);
+ FileBuildPath(fpath,volname,NULL);
+ if (CdTestPath(fpath,&info))
+diff --git a/corelib/ncbierr.c b/corelib/ncbierr.c
+index 0429d86..7b96a2e 100644
+--- a/corelib/ncbierr.c
++++ b/corelib/ncbierr.c
+@@ -952,7 +952,7 @@ static FILE * ErrMsgRoot_fopen (ErrMsgRoot *ctx)
+ if (FileLength(file)==0 || (fd = FileOpen(file,s_msg_mode)) == NULL)
+ {
+ strcpy(path,info->msgpath);
+- strncat(path,file,sizeof(path));
++ strncat(path,file,sizeof(path) - 1);
+ fd = FileOpen(path,s_msg_mode);
+ }
+
+diff --git a/corelib/ncbisgml.c b/corelib/ncbisgml.c
+index 99412be..a653aef 100644
+--- a/corelib/ncbisgml.c
++++ b/corelib/ncbisgml.c
+@@ -260,7 +260,7 @@ NLM_EXTERN char * LIBCALL Nlm_Sgml2Ascii (const char *sgml, char *ascii, size_t
+ }
+ if (i >= num_sgml_entity)
+ {
+- char bad[SGML_ERROR_MSG_LIM];
++ char bad[SGML_ERROR_MSG_LIM + 2];
+ bad[0] = '\0';
+ strncat(bad,sgml,SGML_ERROR_MSG_LIM);
+ ErrPostEx(SEV_ERROR,E_SGML,3,"Unrecognized SGML entity &%s in [%s]",tbuf,bad);
+@@ -279,7 +279,7 @@ NLM_EXTERN char * LIBCALL Nlm_Sgml2Ascii (const char *sgml, char *ascii, size_t
+ from++;
+ if (*from == '\0')
+ {
+- char bad[SGML_ERROR_MSG_LIM];
++ char bad[SGML_ERROR_MSG_LIM + 2];
+ bad[0] = '\0';
+ strncat(bad,sgml,SGML_ERROR_MSG_LIM);
+ ErrPostEx(SEV_ERROR,E_SGML,2, "Unbalanced <> in SGML [%s]",bad);
+@@ -335,7 +335,7 @@ NLM_EXTERN size_t LIBCALL Nlm_Sgml2AsciiLen (const char *sgml)
+ }
+ if (i >= num_sgml_entity)
+ {
+- char bad[SGML_ERROR_MSG_LIM];
++ char bad[SGML_ERROR_MSG_LIM + 2];
+ bad[0] = '\0';
+ strncat(bad,sgml,SGML_ERROR_MSG_LIM);
+ ErrPostEx(SEV_ERROR,E_SGML,3,"Unrecognized SGML entity &%s in [%s]",tbuf,bad);
+@@ -349,7 +349,7 @@ NLM_EXTERN size_t LIBCALL Nlm_Sgml2AsciiLen (const char *sgml)
+ from++;
+ if (*from == '\0')
+ {
+- char bad[SGML_ERROR_MSG_LIM];
++ char bad[SGML_ERROR_MSG_LIM + 2];
+ bad[0] = '\0';
+ strncat(bad,sgml,SGML_ERROR_MSG_LIM);
+ ErrPostEx(SEV_ERROR,E_SGML,2,"Unbalanced <> in SGML [%s]",bad);
+diff --git a/demo/errhdr.c b/demo/errhdr.c
+index 01cd955..5081489 100644
+--- a/demo/errhdr.c
++++ b/demo/errhdr.c
+@@ -41,7 +41,7 @@ int main (int argc, char **argv)
+ else if (mod[0] == '\0')
+ {
+ char *p;
+- strncat(mod,argv[i],sizeof mod);
++ strncat(mod,argv[i],sizeof mod - 1);
+ if ((p = strstr(argv[i],".msg")) != NULL)
+ *p = '\0';
+ }
diff --git a/sci-biology/ncbi-tools/files/ncbi-tools-2.2.26-format-security.patch b/sci-biology/ncbi-tools/files/ncbi-tools-2.2.26-format-security.patch
new file mode 100644
index 000000000000..c12feff51af1
--- /dev/null
+++ b/sci-biology/ncbi-tools/files/ncbi-tools-2.2.26-format-security.patch
@@ -0,0 +1,124 @@
+ api/alignmgr2.c | 2 +-
+ api/pgppop.c | 2 +-
+ api/txalign.c | 10 +++++-----
+ desktop/seqpanel.c | 4 ++--
+ tools/spidey.c | 4 ++--
+ 5 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/api/alignmgr2.c b/api/alignmgr2.c
+index 5b43ef3..4b9007e 100644
+--- a/api/alignmgr2.c
++++ b/api/alignmgr2.c
+@@ -5616,7 +5616,7 @@ NLM_EXTERN void AlnMgr2PrintSeqAlign(SeqAlignPtr sap, Int4 linesize, Boolean isn
+ spp = SeqPortNew(bsp, amp->from_row, amp->to_row, amp->strand, seqcode);
+ ctr = SeqPortRead(spp, (Uint1Ptr)buf, amp->to_row-amp->from_row+1);
+ buf[ctr] = '\0';
+- fprintf(ofp, buf);
++ fprintf(ofp, "%s", buf);
+ SeqPortFree(spp);
+ }
+ }
+diff --git a/api/pgppop.c b/api/pgppop.c
+index d16d79d..b359378 100644
+--- a/api/pgppop.c
++++ b/api/pgppop.c
+@@ -2994,7 +2994,7 @@ Char DefLine[255];
+ if (szSeq){
+ if (!DDV_GetSequenceFromParaG(pgp,&szSeq,bspLength,IsAA,NULL,
+ NULL,NULL)) continue;
+- fprintf(fp,szSeq);
++ fprintf(fp, "%s", szSeq);
+ fprintf(fp,"\n");
+ MemFree(szSeq);
+ }
+diff --git a/api/txalign.c b/api/txalign.c
+index 5877f9c..cb35fbc 100644
+--- a/api/txalign.c
++++ b/api/txalign.c
+@@ -1767,13 +1767,13 @@ static CharPtr DrawTextToBuffer(ValNodePtr tdp_list, CharPtr PNTR m_buf, Boolean
+ if(options&TXALIGN_HTML&&options&TXALIGN_MASTER&&DbHasGi&&(options&TXALIGN_GET_SEQUENCE)){
+ Char checkboxBuf[200];
+ sprintf(checkboxBuf, "<input type=\"checkbox\" name=\"getSeqGi\" value=\"%ld\" onClick=\"synchronizeCheck(this.value, 'getSeqAlignment%ld', 'getSeqGi', this.checked)\">", sip->data.intvalue, query_number_glb);
+- sprintf(docbuf+pos,checkboxBuf);
++ sprintf(docbuf+pos,"%s", checkboxBuf);
+
+ pos += StringLen(checkboxBuf);
+ }
+
+ html_len = StringLen(HTML_buffer);
+- sprintf(docbuf+pos, HTML_buffer);
++ sprintf(docbuf+pos, "%s", HTML_buffer);
+ pos += html_len;
+
+ pos += print_label_to_buffer_all_ex(docbuf+pos, tdp->label, tdp->pos,
+@@ -1790,7 +1790,7 @@ static CharPtr DrawTextToBuffer(ValNodePtr tdp_list, CharPtr PNTR m_buf, Boolean
+ sprintf(HTML_buffer, "<a name = THC%ld></a><a href=\"http://www.tigr.org/docs/tigr-scripts/hgi_scripts/thc_report.spl?est=THC%ld&report_type=n\">", (long) oip->id, (long) oip->id);
+
+ html_len = StringLen(HTML_buffer);
+- sprintf(docbuf+pos, HTML_buffer);
++ sprintf(docbuf+pos, "%s", HTML_buffer);
+ pos += html_len;
+ pos += print_label_to_buffer_all_ex(docbuf+pos, tdp->label, tdp->pos,
+ tdp->strand, FALSE, TRUE, label_size, num_size, show_strand, strip_semicolon);
+@@ -1799,7 +1799,7 @@ static CharPtr DrawTextToBuffer(ValNodePtr tdp_list, CharPtr PNTR m_buf, Boolean
+ sprintf(HTML_buffer, "<a name = TI%ld></a><a href=\"http://www.ncbi.nlm.nih.gov/Traces/trace.cgi?cmd=retrieve&dopt=fasta&val=%ld\">", (long) oip->id, (long) oip->id);
+
+ html_len = StringLen(HTML_buffer);
+- sprintf(docbuf+pos, HTML_buffer);
++ sprintf(docbuf+pos, "%s", HTML_buffer);
+ pos += html_len;
+ pos += print_label_to_buffer_all_ex(docbuf+pos, tdp->label, tdp->pos,
+ tdp->strand, FALSE, TRUE, label_size, num_size, show_strand, strip_semicolon);
+@@ -1816,7 +1816,7 @@ static CharPtr DrawTextToBuffer(ValNodePtr tdp_list, CharPtr PNTR m_buf, Boolean
+ if(options&TXALIGN_HTML&&options&TXALIGN_MASTER&&DbHasGi&&(options&TXALIGN_GET_SEQUENCE)){
+ Char checkboxBuf[200];
+ sprintf(checkboxBuf, "<input type=\"checkbox\" name=\"getSeqMaster\" value=\"\" onClick=\"uncheckable('getSeqAlignment%ld', 'getSeqMaster')\">", query_number_glb);
+- sprintf(docbuf+pos,checkboxBuf);
++ sprintf(docbuf+pos,"%s",checkboxBuf);
+
+ pos += StringLen(checkboxBuf);
+ }
+diff --git a/desktop/seqpanel.c b/desktop/seqpanel.c
+index 2e78e13..c7538aa 100644
+--- a/desktop/seqpanel.c
++++ b/desktop/seqpanel.c
+@@ -8661,7 +8661,7 @@ WriteAlignmentInterleaveToFileEx
+ seqbuf, alnbuf, &alnbuf_len,
+ show_substitutions);
+ MemCpy (printed_line + label_len + 1 + coord_len, alnbuf, alnbuf_len);
+- fprintf (fp, printed_line);
++ fprintf (fp, "%s", printed_line);
+ }
+ fprintf (fp, "\n");
+ start = stop + 1;
+@@ -8757,7 +8757,7 @@ extern void WriteAlignmentContiguousToFile
+ seqbuf, alnbuf, &alnbuf_len,
+ show_substitutions);
+ MemCpy (printed_line, alnbuf, alnbuf_len);
+- fprintf (fp, printed_line);
++ fprintf (fp, "%s", printed_line);
+ start = stop + 1;
+ stop += seq_chars_per_row;
+ }
+diff --git a/tools/spidey.c b/tools/spidey.c
+index d6ce62d..ac9f59a 100644
+--- a/tools/spidey.c
++++ b/tools/spidey.c
+@@ -2088,7 +2088,7 @@ static void SPI_PrintResult(FILE *ofp, FILE *ofp2, SPI_RegionInfoPtr srip, Biose
+ fprintf(ofp2, " ");
+ ctr++;
+ }
+- fprintf(ofp2, buf);
++ fprintf(ofp2, "%s", buf);
+ if (spp){
+ SeqPortFree(spp);
+ }
+@@ -2417,7 +2417,7 @@ static void SPI_PrintHerdResult(FILE *ofp, FILE *ofp2, SPI_mRNAToHerdPtr herd, S
+ ctr = SeqPortRead(spp, (Uint1Ptr)buf, 10);
+ if (ctr > 0)
+ buf[ctr] = '\0';
+- fprintf(ofp2, buf);
++ fprintf(ofp2, "%s", buf);
+ SeqPortFree(spp);
+ }
+ done = TRUE;
diff --git a/sci-biology/ncbi-tools/files/ncbi-tools-asn2all.patch b/sci-biology/ncbi-tools/files/ncbi-tools-asn2all.patch
new file mode 100644
index 000000000000..1cd7976af599
--- /dev/null
+++ b/sci-biology/ncbi-tools/files/ncbi-tools-asn2all.patch
@@ -0,0 +1,27 @@
+--- ncbi-20050605/make/makedis.csh 2005-05-13 05:42:12.000000000 +0200
++++ ncbi/make/makedis.csh 2005-09-20 22:02:38.000000000 +0200
+@@ -472,6 +472,24 @@
+
+ set net_stat = $status
+
++if ("$?NCBI_MT_OTHERLIBS" == "1") then
++ set CMD='make $MFLG -f makenet.unx \
++ CFLAGS1=\"$NCBI_OPTFLAG $NCBI_CFLAGS1 $OGL_INCLUDE\" \
++ LDFLAGS1=\"$NCBI_LDFLAGS1\" SHELL=\"$NCBI_MAKE_SHELL\" \
++ AR=\"$NCBI_AR\" CC=\"$NCBI_CC\" RAN=\"$NCBI_RANLIB\" OTHERLIBS=\"$NCBI_OTHERLIBS\" \
++ THREAD_OBJ=$NCBI_THREAD_OBJ \
++ THREAD_OTHERLIBS=\"$NCBI_MT_OTHERLIBS\" \
++ NETENTREZVERSION=\"$NETENTREZVERSION\" $NET_VIB asn2all'
++else
++ set CMD='make $MFLG -f makenet.unx \
++ CFLAGS1=\"$NCBI_OPTFLAG $NCBI_CFLAGS1 $OGL_INCLUDE\" \
++ LDFLAGS1=\"$NCBI_LDFLAGS1\" SHELL=\"$NCBI_MAKE_SHELL\" \
++ AR=\"$NCBI_AR\" CC=\"$NCBI_CC\" RAN=\"$NCBI_RANLIB\" OTHERLIBS=\"$NCBI_OTHERLIBS\" \
++ NETENTREZVERSION=\"$NETENTREZVERSION\" $NET_VIB asn2all'
++endif
++eval echo $CMD
++eval echo $CMD | sh
++
+ if ($make_stat != 0 || $demo_stat != 0 || $threaded_demo_stat != 0 || $net_stat != 0) then
+ echo FAILURE primary make status = $make_stat, demo = $demo_stat, threaded_demo = $threaded_demo_stat, net = $net_stat
+ cat <<EOF
diff --git a/sci-biology/ncbi-tools/files/ncbi-tools-extra_vib.patch b/sci-biology/ncbi-tools/files/ncbi-tools-extra_vib.patch
new file mode 100644
index 000000000000..cb7d1adf9208
--- /dev/null
+++ b/sci-biology/ncbi-tools/files/ncbi-tools-extra_vib.patch
@@ -0,0 +1,37 @@
+--- ncbi-20061015/make/makedis.csh 2006-09-14 17:37:03.000000000 +0200
++++ ncbi/make/makedis.csh 2007-03-07 21:00:36.090836460 +0100
+@@ -485,6 +485,34 @@
+
+ set net_stat = $status
+
++if ( $net_stat == 0 ) then
++ # Compile additional tools, usually hidden
++ if ( ! $?EXTRA_VIB ) then
++ set EXTRA_VIB = ( asn2all )
++ endif
++
++ if ("$?NCBI_MT_OTHERLIBS" == "1") then
++ set CMD='make $MFLG -f makenet.unx \
++ CFLAGS1=\"$NCBI_OPTFLAG $NCBI_CFLAGS1 $OGL_INCLUDE\" \
++ LDFLAGS1=\"$NCBI_LDFLAGS1\" SHELL=\"$NCBI_MAKE_SHELL\" \
++ AR=\"$NCBI_AR\" CC=\"$NCBI_CC\" RAN=\"$NCBI_RANLIB\" OTHERLIBS=\"$NCBI_OTHERLIBS\" \
++ THREAD_OBJ=$NCBI_THREAD_OBJ \
++ THREAD_OTHERLIBS=\"$NCBI_MT_OTHERLIBS\" \
++ NETENTREZVERSION=\"$NETENTREZVERSION\" $NET_VIB $EXTRA_VIB'
++ else
++ set CMD='make $MFLG -f makenet.unx \
++ CFLAGS1=\"$NCBI_OPTFLAG $NCBI_CFLAGS1 $OGL_INCLUDE\" \
++ LDFLAGS1=\"$NCBI_LDFLAGS1\" SHELL=\"$NCBI_MAKE_SHELL\" \
++ AR=\"$NCBI_AR\" CC=\"$NCBI_CC\" RAN=\"$NCBI_RANLIB\" OTHERLIBS=\"$NCBI_OTHERLIBS\" \
++ NETENTREZVERSION=\"$NETENTREZVERSION\" $NET_VIB $EXTRA_VIB'
++ endif
++ eval echo $CMD
++ eval echo $CMD | sh
++
++ set net_stat = $status
++
++endif
++
+ if ($make_stat != 0 || $demo_stat != 0 || $threaded_demo_stat != 0 || $net_stat != 0) then
+ echo FAILURE primary make status = $make_stat, demo = $demo_stat, threaded_demo = $threaded_demo_stat, net = $net_stat
+ cat <<EOF
diff --git a/sci-biology/ncbi-tools/files/ncbi-tools-lop.patch b/sci-biology/ncbi-tools/files/ncbi-tools-lop.patch
new file mode 100644
index 000000000000..867b203aecb1
--- /dev/null
+++ b/sci-biology/ncbi-tools/files/ncbi-tools-lop.patch
@@ -0,0 +1,15 @@
+--- platform/linux-power.ncbi.mk.bak 2005-08-04 22:45:13.000000000 -0500
++++ platform/linux-power.ncbi.mk 2005-08-04 22:45:35.000000000 -0500
+@@ -9,10 +9,10 @@
+ #it appears the flags above do not work anymore with newer libc,
+ #the new flags should work. Dima. 08/23/01
+ NCBI_AR=ar
+-NCBI_CC = xlc_r -w -qcpluscmt -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
++NCBI_CC = gcc -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
+ NCBI_CFLAGS1 = -c
+ NCBI_LDFLAGS1 = -O3 -D_LARGE_FILES
+-NCBI_OPTFLAG = -O3 -qmaxmem=-1 -D_LARGE_FILE
++NCBI_OPTFLAG = -O3 -D_LARGE_FILE
+ NCBI_BIN_MASTER = /vol/stcfs/rchen/LoP/ncbi/bin
+ NCBI_BIN_COPY = /vol/stcfs/rchen/LoP/ncbi/bin
+ NCBI_INCDIR = /vol/stcfs/rchen/LoP/ncbi/include
diff --git a/sci-biology/ncbi-tools/files/ncbirc b/sci-biology/ncbi-tools/files/ncbirc
new file mode 100644
index 000000000000..dd77b452fe74
--- /dev/null
+++ b/sci-biology/ncbi-tools/files/ncbirc
@@ -0,0 +1,2 @@
+[NCBI]
+Data=@GENTOO_PORTAGE_EPREFIX@/usr/share/ncbi/data
diff --git a/sci-biology/ncbi-tools/metadata.xml b/sci-biology/ncbi-tools/metadata.xml
new file mode 100644
index 000000000000..f17a827e3101
--- /dev/null
+++ b/sci-biology/ncbi-tools/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-biology</herd>
+</pkgmetadata>
diff --git a/sci-biology/ncbi-tools/ncbi-tools-2.2.26-r2.ebuild b/sci-biology/ncbi-tools/ncbi-tools-2.2.26-r2.ebuild
new file mode 100644
index 000000000000..5542dd5f67b2
--- /dev/null
+++ b/sci-biology/ncbi-tools/ncbi-tools-2.2.26-r2.ebuild
@@ -0,0 +1,165 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic prefix toolchain-funcs
+
+DESCRIPTION="Development toolkit and applications for computational biology, including NCBI BLAST"
+HOMEPAGE="http://www.ncbi.nlm.nih.gov/"
+SRC_URI="ftp://ftp.ncbi.nlm.nih.gov/blast/executables/release/${PV}/ncbi.tar.gz -> ${P}.tar.gz"
+
+SLOT="0"
+LICENSE="public-domain"
+KEYWORDS="~alpha amd64 ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="doc static-libs X"
+
+RDEPEND="
+ app-shells/tcsh
+ dev-lang/perl
+ media-libs/libpng:0=
+ X? (
+ media-libs/fontconfig
+ x11-libs/motif:0=
+ x11-libs/libICE
+ x11-libs/libX11
+ x11-libs/libXft
+ x11-libs/libXmu
+ x11-libs/libXt
+ )"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/ncbi"
+
+EXTRA_VIB="asn2all asn2asn"
+
+pkg_setup() {
+ echo
+ ewarn 'Please note that the NCBI toolkit (and especially the X'
+ ewarn 'applications) are known to have compilation and run-time'
+ ewarn 'problems when compiled with agressive compilation flags. The'
+ ewarn '"-O3" flag is filtered by the ebuild on the x86 architecture if'
+ ewarn 'X support is enabled.'
+ echo
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-extra_vib.patch \
+ "${FILESDIR}"/${P}-bfr-overflow.patch \
+ "${FILESDIR}"/${P}-format-security.patch \
+ "${FILESDIR}"/${P}-_DEFAULT_SOURCE.patch
+
+ if use ppc || use ppc64; then
+ epatch "${FILESDIR}"/${PN}-lop.patch
+ fi
+
+ if ! use X; then
+ sed \
+ -e "s:\#set HAVE_OGL=0:set HAVE_OGL=0:" \
+ -e "s:\#set HAVE_MOTIF=0:set HAVE_MOTIF=0:" \
+ -i "${S}"/make/makedis.csh || die
+ else
+ # X applications segfault on startup on x86 with -O3.
+ use x86 || replace-flags '-O3' '-O2'
+ fi
+
+ # Apply user C flags...
+ cd "${S}"/platform
+ sed \
+ -e "s:-O[s0-9]\?::g" \
+ -e 's:-m\(cpu\|arch\)=[a-zA-Z0-9]*::g' \
+ -e 's:-x[A-Z]*::g' \
+ -e 's:-pipe::g' \
+ -e "/NCBI_MAKE_SHELL *=/s:=.*:= \"${EPREFIX}/bin/sh\":g" \
+ -e "/NCBI_AR *=/s:ar:$(tc-getAR):g" \
+ -e "/NCBI_RANLIB *=/s:ranlib:$(tc-getRANLIB):g" \
+ -e "/NCBI_CC *=/s:= [a-zA-Z0-9]* := $(tc-getCC) :g" \
+ -e "/NCBI_OPTFLAG *=/s:$: ${CFLAGS}:g" \
+ -e "/NCBI_LDFLAGS1 *=/s:$: ${CFLAGS} ${LDFLAGS}:g" \
+ -e "/NCBI_OGLLIBS *=/s:=.*:= $($(tc-getPKG_CONFIG) --cflags gl glu 2>/dev/null):g" \
+ -e "/OPENGL_LIBS *=/s:=.*:= $($(tc-getPKG_CONFIG) --libs gl glu 2>/dev/null):g" \
+ -e "/NCBI_OGLLIBS *=/s:=.*:= $($(tc-getPKG_CONFIG) --libs gl glu 2>/dev/null):g" \
+ -i * || die
+
+ # We use dynamic libraries
+ sed -i -e "s/-Wl,-Bstatic//" *linux*.ncbi.mk || die
+
+ sed \
+ -re "s:/usr(/bin/.*sh):\1:g" \
+ -e "s:(/bin/.*sh):${EPREFIX}\1:g" \
+ -i $(find "${S}" -type f) || die
+}
+
+src_compile() {
+ export EXTRA_VIB
+ cd "${WORKDIR}"
+ csh ncbi/make/makedis.csh || die
+ mkdir "${S}"/cgi "${S}"/real || die
+ mv "${S}"/bin/*.cgi "${S}"/cgi || die
+ mv "${S}"/bin/*.REAL "${S}"/real || die
+ cd "${S}"/demo
+ emake \
+ -f ../make/makenet.unx \
+ CC="$(tc-getCC) ${CFLAGS} -I../include -L../lib" \
+ LDFLAGS="${LDFLAGS}" \
+ spidey
+ cp spidey ../bin/ || die
+}
+
+src_install() {
+ #sci-geosciences/cdat-lite
+ mv "${S}"/bin/cdscan "${S}"/bin/cdscan-ncbi || die
+
+ dobin "${S}"/bin/*
+
+ for i in ${EXTRA_VIB}; do
+ dobin "${S}"/build/${i} || die "Failed to install binaries."
+ done
+ use static-libs && dolib.a "${S}"/lib/*.a
+ mkdir -p "${ED}"/usr/include/ncbi
+ cp -RL "${S}"/include/* "${ED}"/usr/include/ncbi || \
+ die "Failed to install headers."
+
+ # TODO: wwwblast with webapps
+ #insinto /usr/share/ncbi/lib/cgi
+ #doins ${S}/cgi/*
+ #insinto /usr/share/ncbi/lib/real
+ #doins ${S}/real/*
+
+ # Basic documentation
+ dodoc "${S}"/{README,VERSION,doc/{*.txt,README.*}}
+ newdoc "${S}"/doc/fa2htgs/README README.fa2htgs
+ newdoc "${S}"/config/README README.config
+ newdoc "${S}"/network/encrypt/README README.encrypt
+ newdoc "${S}"/network/nsclilib/readme README.nsclilib
+ newdoc "${S}"/sequin/README README.sequin
+ mv "${S}"/doc/man/fmerge{,-ncbi}.1 || die
+ doman "${S}"/doc/man/*
+
+ # Hypertext user documentation
+ dohtml "${S}"/{README.htm,doc/{*.html,*.htm,*.gif}}
+ insinto /usr/share/doc/${PF}/html
+ doins -r "${S}"/doc/blast "${S}"/doc/images "${S}"/doc/seq_install
+
+ # Developer documentation
+ if use doc; then
+ # Demo programs
+ mkdir "${ED}"/usr/share/ncbi
+ mv "${S}"/demo "${ED}"/usr/share/ncbi/demo || die
+ fi
+
+ # Shared data (similarity matrices and such) and database directory.
+ insinto /usr/share/ncbi
+ doins -r "${S}"/data
+ dodir /usr/share/ncbi/formatdb
+
+ # Default config file to set the path for shared data.
+ insinto /etc/ncbi
+ newins "${FILESDIR}"/ncbirc .ncbirc
+ eprefixify "${ED}"/etc/ncbi/.ncbirc
+
+ # Env file to set the location of the config file and BLAST databases.
+ newenvd "${FILESDIR}"/21ncbi-r1 21ncbi
+}