[med-svn] [Git][med-team/tantan][master] 6 commits: New upstream version 40

Sascha Steinbiss (@satta) gitlab at salsa.debian.org
Mon Oct 24 21:44:20 BST 2022



Sascha Steinbiss pushed to branch master at Debian Med / tantan


Commits:
31713d06 by Sascha Steinbiss at 2022-10-24T22:30:21+02:00
New upstream version 40
- - - - -
aa88fcab by Sascha Steinbiss at 2022-10-24T22:30:21+02:00
Update upstream source from tag 'upstream/40'

Update to upstream version '40'
with Debian dir 171073567a8378897453686dbaa686bd6a6cb47f
- - - - -
3919b3c6 by Sascha Steinbiss at 2022-10-24T22:30:54+02:00
new upstream release

- - - - -
73fc0a69 by Sascha Steinbiss at 2022-10-24T22:43:32+02:00
refresh patch

- - - - -
d6f29630 by Sascha Steinbiss at 2022-10-24T22:43:45+02:00
add new dependency on zlib1g

- - - - -
4d52be29 by Sascha Steinbiss at 2022-10-24T22:43:52+02:00
update d/copyright email and date

- - - - -


10 changed files:

- README.rst
- debian/changelog
- debian/control
- debian/copyright
- debian/patches/buildflags.patch
- src/Makefile
- src/mcf_util.cc
- src/mcf_util.hh
- + src/mcf_zstream.hh
- src/tantan_app.cc


Changes:

=====================================
README.rst
=====================================
@@ -26,14 +26,15 @@ set up your computer to find it automatically.  Some possible ways:
 * Copy ``tantan`` to a standard directory: ``sudo make install``
   (using "sudo" to request administrator permissions).
 
-* Copy it to your personal bin directory: ``make install prefix=~``
+* Copy it to your personal bin directory: ``make install prefix=~`` or
+  ``make install prefix=~/.local``
 
 * Adjust your `PATH variable`_.
 
 You might need to log out and back in for your computer to recognize
 the new program.
 
-**Alternative:** Install tantan from bioconda_.
+**Alternative:** Install tantan from bioconda_ or `Debian Med`_.
 
 Normal usage
 ------------
@@ -219,3 +220,4 @@ sequences", MC Frith, Nucleic Acids Research 2011 39(4):e23.
 .. _BED: https://genome.ucsc.edu/FAQ/FAQformat.html#format1
 .. _PATH variable: https://en.wikipedia.org/wiki/PATH_(variable)
 .. _bioconda: https://bioconda.github.io/
+.. _Debian Med: https://www.debian.org/devel/debian-med/


=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+tantan (40-1) unstable; urgency=medium
+
+  * New upstream version 40.
+  * Add new dependency on zlib1g.
+  * Update d/copyright email and date.
+
+ -- Sascha Steinbiss <satta at debian.org>  Mon, 24 Oct 2022 22:30:23 +0200
+
 tantan (39-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/control
=====================================
@@ -3,7 +3,8 @@ Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.
 Uploaders: Sascha Steinbiss <satta at debian.org>
 Section: science
 Priority: optional
-Build-Depends: debhelper-compat (= 13)
+Build-Depends: debhelper-compat (= 13),
+               zlib1g-dev
 Standards-Version: 4.6.1
 Vcs-Browser: https://salsa.debian.org/med-team/tantan
 Vcs-Git: https://salsa.debian.org/med-team/tantan.git


=====================================
debian/copyright
=====================================
@@ -10,7 +10,7 @@ Copyright: © 2010 Martin Frith <tantan at cbrc.jp>
 License: GPL-3+
 
 Files: debian/*
-Copyright: © 2015 Sascha Steinbiss <sascha at steinbiss.name>
+Copyright: © 2015-2022 Sascha Steinbiss <satta at debian.org>
 License: GPL-3+
 
 License: GPL-3+


=====================================
debian/patches/buildflags.patch
=====================================
@@ -5,7 +5,7 @@ Author: Sascha Steinbiss <sascha at steinbiss.name>
 +++ b/src/Makefile
 @@ -1,10 +1,13 @@
 -CXXFLAGS = -msse4 -O3 -Wall -g
-+#CXXFLAGS = -O3 -Wall -g
++#CXXFLAGS = -msse4 -O3 -Wall -g
  
  all: ../bin/tantan
  
@@ -15,8 +15,8 @@ Author: Sascha Steinbiss <sascha at steinbiss.name>
 +
 +../bin/tantan: $(CCSRCS) $(CCHDRS) version.hh Makefile
  	mkdir -p ../bin
--	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ *.cc
-+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $(CCSRCS)
+-	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ *.cc -lz
++	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $(CCSRCS) -lz
  
  clean:
  	rm -f ../bin/tantan


=====================================
src/Makefile
=====================================
@@ -4,13 +4,13 @@ all: ../bin/tantan
 
 ../bin/tantan: *.cc *.hh version.hh Makefile
 	mkdir -p ../bin
-	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ *.cc
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ *.cc -lz
 
 clean:
 	rm -f ../bin/tantan
 
 VERSION1 = git describe --dirty
-VERSION2 = echo ' (HEAD -> main, tag: 39) ' | sed -e 's/.*tag: *//' -e 's/[,) ].*//'
+VERSION2 = echo ' (HEAD -> main, tag: 40) ' | sed -e 's/.*tag: *//' -e 's/[,) ].*//'
 
 VERSION = \"`test -e ../.git && $(VERSION1) || $(VERSION2)`\"
 


=====================================
src/mcf_util.cc
=====================================
@@ -6,11 +6,11 @@
 
 namespace mcf {
 
-std::istream &openIn(const std::string &fileName, std::ifstream &ifs) {
+std::istream &openIn(const std::string &fileName, izstream &z) {
   if (fileName == "-") return std::cin;
-  ifs.open(fileName.c_str());
-  if (!ifs) throw std::runtime_error("can't open file: " + fileName);
-  return ifs;
+  z.open(fileName.c_str());
+  if (!z) throw std::runtime_error("can't open file: " + fileName);
+  return z;
 }
 
 std::ostream &openOut(const std::string &fileName, std::ofstream &ofs) {


=====================================
src/mcf_util.hh
=====================================
@@ -3,6 +3,8 @@
 #ifndef MCF_UTIL_HH
 #define MCF_UTIL_HH
 
+#include "mcf_zstream.hh"
+
 #include <cassert>
 #include <fstream>
 #include <sstream>
@@ -12,7 +14,7 @@
 namespace mcf {
 
 // open an input file, but if the name is "-", just return cin
-std::istream &openIn(const std::string &fileName, std::ifstream &ifs);
+std::istream &openIn(const std::string &fileName, izstream &z);
 
 // open an output file, but if the name is "-", just return cout
 std::ostream &openOut(const std::string &fileName, std::ofstream &ofs);
@@ -34,8 +36,8 @@ void unstringify(T& x, const std::string &s) {
 
 template <typename T>
 void unfilify(T& x, const std::string &fileName) {
-  std::ifstream ifs;
-  std::istream &input = openIn(fileName, ifs);
+  izstream z;
+  std::istream &input = openIn(fileName, z);
   input >> x;
   if (!input) throw std::runtime_error("can't read file: " + fileName);
   // check for junk at end of file?


=====================================
src/mcf_zstream.hh
=====================================
@@ -0,0 +1,83 @@
+// Copyright 2017 Martin C. Frith
+
+// mcf::izstream is similar to std::ifstream.  The difference is, if
+// you give it a gzip-compressed file, it will decompress what it
+// reads.
+
+#ifndef MCF_ZSTREAM_HH
+#define MCF_ZSTREAM_HH
+
+#include <zlib.h>
+
+#include <cstdio>  // BUFSIZ
+#include <istream>
+#include <stdexcept>
+#include <streambuf>
+
+namespace mcf {
+
+class zbuf : public std::streambuf {
+public:
+  zbuf() : input(0) {}
+
+  ~zbuf() { close(); }
+
+  bool is_open() const { return input; }
+
+  zbuf *open(const char *fileName) {
+    if (is_open()) return 0;
+    input = gzopen(fileName, "rb");
+    if (!is_open()) return 0;
+    return this;
+  }
+
+  zbuf *close() {
+    if (!is_open()) return 0;
+    int e = gzclose(input);
+    input = 0;
+    return (e == Z_OK || e == Z_BUF_ERROR) ? this : 0;
+  }
+
+protected:
+  int underflow() {
+    if (gptr() == egptr()) {
+      int size = gzread(input, buffer, BUFSIZ);
+      if (size < 0) throw std::runtime_error("gzread error");
+      setg(buffer, buffer, buffer + size);
+    }
+    return (gptr() == egptr()) ?
+      traits_type::eof() : traits_type::to_int_type(*gptr());
+  }
+
+private:
+  gzFile input;
+  char buffer[BUFSIZ];
+};
+
+class izstream : public std::istream {
+public:
+  izstream() : std::istream(&buf) {}
+
+  izstream(const char *fileName) : std::istream(&buf) {
+    open(fileName);
+  }
+
+  bool is_open() const { return buf.is_open(); }
+
+  void open(const char *fileName) {
+    // do something special if fileName is "-"?
+    if (!buf.open(fileName)) setstate(failbit);
+    else clear();
+  }
+
+  void close() {
+    if (!buf.close()) setstate(failbit);
+  }
+
+private:
+  zbuf buf;
+};
+
+}
+
+#endif


=====================================
src/tantan_app.cc
=====================================
@@ -416,8 +416,8 @@ try {
     processOneFile(std::cin, output);
 
   for (int i = options.indexOfFirstNonOptionArgument; i < argc; ++i) {
-    std::ifstream ifs;
-    std::istream &input = openIn(argv[i], ifs);
+    izstream z;
+    std::istream &input = openIn(argv[i], z);
     processOneFile(input, output);
   }
 



View it on GitLab: https://salsa.debian.org/med-team/tantan/-/compare/62239853d177b9ec34380ad61203ad3ffcb6fd77...4d52be29354ddb14794edcfe91e43f6873141e1b

-- 
View it on GitLab: https://salsa.debian.org/med-team/tantan/-/compare/62239853d177b9ec34380ad61203ad3ffcb6fd77...4d52be29354ddb14794edcfe91e43f6873141e1b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20221024/afdc7b72/attachment-0001.htm>


More information about the debian-med-commit mailing list