diff -Nru tantan-39/debian/changelog tantan-40/debian/changelog --- tantan-39/debian/changelog 2022-07-30 16:22:32.000000000 +0000 +++ tantan-40/debian/changelog 2022-10-24 20:30:23.000000000 +0000 @@ -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 Mon, 24 Oct 2022 22:30:23 +0200 + tantan (39-1) unstable; urgency=medium * Team upload. diff -Nru tantan-39/debian/control tantan-40/debian/control --- tantan-39/debian/control 2022-07-30 16:20:13.000000000 +0000 +++ tantan-40/debian/control 2022-10-24 20:30:23.000000000 +0000 @@ -3,7 +3,8 @@ Uploaders: Sascha Steinbiss 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 diff -Nru tantan-39/debian/copyright tantan-40/debian/copyright --- tantan-39/debian/copyright 2022-05-28 07:22:37.000000000 +0000 +++ tantan-40/debian/copyright 2022-10-24 20:30:23.000000000 +0000 @@ -10,7 +10,7 @@ License: GPL-3+ Files: debian/* -Copyright: © 2015 Sascha Steinbiss +Copyright: © 2015-2022 Sascha Steinbiss License: GPL-3+ License: GPL-3+ diff -Nru tantan-39/debian/patches/buildflags.patch tantan-40/debian/patches/buildflags.patch --- tantan-39/debian/patches/buildflags.patch 2022-05-28 07:30:50.000000000 +0000 +++ tantan-40/debian/patches/buildflags.patch 2022-10-24 20:30:23.000000000 +0000 @@ -5,7 +5,7 @@ +++ 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 @@ + +../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 diff -Nru tantan-39/README.rst tantan-40/README.rst --- tantan-39/README.rst 2022-06-10 00:03:21.000000000 +0000 +++ tantan-40/README.rst 2022-10-11 03:54:54.000000000 +0000 @@ -26,14 +26,15 @@ * 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 @@ .. _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/ diff -Nru tantan-39/src/Makefile tantan-40/src/Makefile --- tantan-39/src/Makefile 2022-06-10 00:03:21.000000000 +0000 +++ tantan-40/src/Makefile 2022-10-11 03:54:54.000000000 +0000 @@ -4,13 +4,13 @@ ../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)`\" diff -Nru tantan-39/src/mcf_util.cc tantan-40/src/mcf_util.cc --- tantan-39/src/mcf_util.cc 2022-06-10 00:03:21.000000000 +0000 +++ tantan-40/src/mcf_util.cc 2022-10-11 03:54:54.000000000 +0000 @@ -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) { diff -Nru tantan-39/src/mcf_util.hh tantan-40/src/mcf_util.hh --- tantan-39/src/mcf_util.hh 2022-06-10 00:03:21.000000000 +0000 +++ tantan-40/src/mcf_util.hh 2022-10-11 03:54:54.000000000 +0000 @@ -3,6 +3,8 @@ #ifndef MCF_UTIL_HH #define MCF_UTIL_HH +#include "mcf_zstream.hh" + #include #include #include @@ -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 @@ template 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? diff -Nru tantan-39/src/mcf_zstream.hh tantan-40/src/mcf_zstream.hh --- tantan-39/src/mcf_zstream.hh 1970-01-01 00:00:00.000000000 +0000 +++ tantan-40/src/mcf_zstream.hh 2022-10-11 03:54:54.000000000 +0000 @@ -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 + +#include // BUFSIZ +#include +#include +#include + +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 diff -Nru tantan-39/src/tantan_app.cc tantan-40/src/tantan_app.cc --- tantan-39/src/tantan_app.cc 2022-06-10 00:03:21.000000000 +0000 +++ tantan-40/src/tantan_app.cc 2022-10-11 03:54:54.000000000 +0000 @@ -416,8 +416,8 @@ 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); }