[med-svn] [snpomatic] 09/15: add hardening, build all binaries

Sascha Steinbiss sascha-guest at moszumanska.debian.org
Sat Dec 12 21:59:59 UTC 2015


This is an automated email from the git hooks/post-receive script.

sascha-guest pushed a commit to branch master
in repository snpomatic.

commit 5801febdd11d5a181efdfa24e7c86ea0b4612c73
Author: Sascha Steinbiss <sascha at steinbiss.name>
Date:   Sat Dec 12 21:27:57 2015 +0000

    add hardening, build all binaries
---
 debian/patches/build_all_binaries |   2 +-
 debian/patches/fix_ungap          | 134 ++++++++++++++++++++++++++++++++++++++
 debian/patches/hardening          |  12 ++--
 debian/patches/series             |   1 +
 debian/rules                      |   4 ++
 5 files changed, 146 insertions(+), 7 deletions(-)

diff --git a/debian/patches/build_all_binaries b/debian/patches/build_all_binaries
index 83ed7d5..97b9ff0 100644
--- a/debian/patches/build_all_binaries
+++ b/debian/patches/build_all_binaries
@@ -8,4 +8,4 @@
 +all: findknownsnps reassemble variety mapcontigs ungap
  
  findknownsnps: src/findknownsnps.o src/global_functions.o src/TChromosome.o src/TChromosomalIndices.o src/TAlignmentOutput.o src/TChromosomeAlign.o
- 	$(CXX) $(CFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LIBS) $^ -o $@
+ 	$(CXX) $(CFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LIBS) $^ -o $@
diff --git a/debian/patches/fix_ungap b/debian/patches/fix_ungap
new file mode 100644
index 0000000..baa91e6
--- /dev/null
+++ b/debian/patches/fix_ungap
@@ -0,0 +1,134 @@
+--- a/src/ungap.cpp
++++ b/src/ungap.cpp
+@@ -17,7 +17,7 @@
+ 	TRegionScan ( chrvec &_chrs , TChromosomalIndices &_index ) : TChromosomeAlign ( _chrs , _index ) {} ;
+ 	void assemble_leftovers ( int cnt ) ;
+ 	vector <TLeftovers> leftovers ;
+-	
++
+ 	protected:
+ 	virtual uint align_solexa_paired_read ( const string &name , const string &sequence , string quality , uint read_length_1 , uint fragment_length , uint range ) ;
+ 	int get_overlap ( TLeftovers &l1 , TLeftovers &l2 ) ;
+@@ -52,7 +52,7 @@
+ /*
+ 	string s1 = l1.seq.substr ( o , l1.seq.length() - o ) ;
+ 	string s2 = l2.seq ;
+-	
++
+ 	if ( s1.length() < s2.length() ) s2 = s2.substr ( 0 , s1.length() ) ;
+ 	else if ( s2.length() < s1.length() ) s1 = s1.substr ( 0 , s2.length() ) ;
+ 	if ( s1 != s2 ) return -1 ; // No match
+@@ -63,9 +63,9 @@
+ void TRegionScan::assemble_leftovers ( int cnt ) {
+ 	uint a , b ;
+ 	vector <TLeftovers> lo ;
+-	
++
+ 	cout << "Assembling, depth " << cnt << endl ;
+-	
++
+ 	for ( a = 0 ; a+1 < leftovers.size() ; a++ ) {
+ 		for ( b = a+1 ; b < leftovers.size() ; b++ ) {
+ 			int o = get_overlap ( leftovers[a] , leftovers[b] ) ;
+@@ -77,30 +77,30 @@
+ 		}
+ 	}
+ 	if ( cnt <= 0 ) return ;
+-	
++
+ 	for ( a = 0 ; a < leftovers.size() ; a++ ) {
+ 		if ( leftovers[a].used ) continue ;
+ 		lo.push_back ( leftovers[a] ) ;
+ 	}
+-	
++
+ 	// Add unique sequences as new source set
+ 	sort ( lo.begin() , lo.end() ) ;
+ 	leftovers.clear() ;
+ 	for ( a = 0 ; a < lo.size() ; a++ ) {
+ 		if ( a == 0 || lo[a-1].seq != lo[a].seq ) leftovers.push_back ( lo[a] ) ;
+ 	}
+-	
++
+ 	assemble_leftovers ( cnt - 1 ) ;
+ }
+ 
+ uint TRegionScan::align_solexa_paired_read ( const string &name , const string &sequence , string quality , uint read_length_1 , uint fragment_length , uint range ) {
+ 	string seq1 = sequence.substr ( 0 , read_length_1 ) ;
+ 	string seq2 = sequence.substr ( read_length_1 , sequence.length() - read_length_1 ) ;
+-	
++
+ 	while ( quality.length() < sequence.length() ) quality += (char) 33+30 ;
+ 	string qual1 = quality.substr ( 0 , read_length_1 ) ;
+ 	string qual2 = quality.substr ( read_length_1 , sequence.length() - read_length_1 ) ;
+-	
++
+ 	pwi_vector res1 , res2 ;
+ 	get_align_solexa_read ( seq1.c_str() , res1 ) ;
+ 	get_align_solexa_read ( seq2.c_str() , res2 ) ;
+@@ -112,7 +112,7 @@
+ 	int ret = 0 ;
+ 	ret += paired_read_combine ( res1 , res2 , maxfrag/2 , maxfrag/2 , read_length_1 , seq1 , qual1 , seq2 , qual2 ) ;
+ 	ret += paired_read_combine ( res2 , res1 , maxfrag/2 , maxfrag/2 , read_length_1 , seq2 , qual2 , seq1 , qual1 ) ;
+-	
++
+ 	if ( ret == 0 && res1.size() + res2.size() == 1 ) {
+ 		string seq ;
+ 		int newpos , chr ;
+@@ -136,7 +136,7 @@
+ 			leftovers.push_back ( l ) ;
+ 		}
+ 	}
+-	
++
+ 	return ret ;
+ }
+ 
+@@ -185,7 +185,7 @@
+ 	int c ;
+ 	int option_index = 0;
+ 	while ( -1 != ( c = getopt_long (argc, argv, "g:a::q::s::f::p::b::r::w::n::",long_options, NULL) ) ) {
+-		
++
+ 		switch ( c ) {
+ 			case 0 : break ;
+ 			case 'g' : genome_file = optarg ; break ;
+@@ -214,7 +214,7 @@
+ 	if ( name.empty() ) die_with_description("No name given!") ; // Need one
+ 	if ( from == 0 ) die_with_description("Needs --from!") ; // Need one
+ 	if ( to == 0 ) die_with_description("Needs --to!") ; // Need one
+-	
++
+ 
+ 	// Incorporating known SNPs and indexing chromosomes
+ 	init_iupac () ;
+@@ -223,7 +223,7 @@
+ 	index.max_snps_per_index = mspi ;
+ 	vector <TChromosome> chrs ;
+ 	load_all_chromosomes ( genome_file , chrs ) ;
+-	
++
+ 	if ( !gff_file.empty() ) incorporate_all_gff ( gff_file , chrs ) ;
+ 	if ( !simple_snp_file.empty() ) incorporate_simple_snps ( simple_snp_file , chrs ) ;
+ 
+@@ -240,7 +240,7 @@
+ 	cout << "Keeping " << chrs[0].sequence.length() << " bases from " << chromosome << endl ;
+ 
+ 	index.run ( &chrs ) ;
+-	
++
+ 	// Now look at the SOlexa reads and do the thing
+ 	TRegionScan ca ( chrs , index ) ;
+ 	if ( !coverage_file.empty() ) ca.coverage = fopen ( coverage_file.c_str() , "w" ) ;
+@@ -258,9 +258,9 @@
+ 		ca.using_bins = true ;
+ 	}
+ */
+-	ca.align_solexa_paired ( fastq_file , pair_length , fragment_length , variance ) ;
++	ca.align_solexa_paired ( genome_file, fastq_file , pair_length , fragment_length , variance ) ;
+ //	ca.assemble_leftovers ( 2 ) ;
+-	
++
+ 	string fasta_output = name + ".fasta" ;
+ 	fstream filestr;
+ 	filestr.open ( fasta_output.c_str() , fstream::out ); //| fstream::app);
diff --git a/debian/patches/hardening b/debian/patches/hardening
index 38c5326..3aea285 100644
--- a/debian/patches/hardening
+++ b/debian/patches/hardening
@@ -5,27 +5,27 @@
  
  findknownsnps: src/findknownsnps.o src/global_functions.o src/TChromosome.o src/TChromosomalIndices.o src/TAlignmentOutput.o src/TChromosomeAlign.o
 -	$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
-+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LIBS) $^ -o $@
++	$(CXX) $(CFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LIBS) $^ -o $@
  
  reassemble: src/reassemble.o src/global_functions.o src/TChromosome.o src/TChromosomalIndices.o src/TAlignmentOutput.o src/TChromosomeAlign.o
 -	$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
-+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LIBS) $^ -o $@
++	$(CXX) $(CFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LIBS) $^ -o $@
  
  variety: src/variety.o src/global_functions.o src/TChromosome.o src/TChromosomalIndices.o src/TAlignmentOutput.o src/TChromosomeAlign.o
 -	$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
-+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LIBS) $^ -o $@
++	$(CXX) $(CFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LIBS) $^ -o $@
  
  mapcontigs: src/mapcontigs.o src/global_functions.o src/TChromosome.o src/TChromosomalIndices.o src/TAlignmentOutput.o src/TChromosomeAlign.o
 -	$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
-+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LIBS) $^ -o $@
++	$(CXX) $(CFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LIBS) $^ -o $@
  
  ungap: src/ungap.o src/global_functions.o src/TChromosome.o src/TChromosomalIndices.o src/TAlignmentOutput.o src/TChromosomeAlign.o
 -	$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
-+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(LIBS) $^ -o $@
++	$(CXX) $(CFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(LIBS) $^ -o $@
  
  .cpp.o:
 -	$(CXX) $(CXXFLAGS) -c $< -o $@
-+	$(CXX) $(CFLAGS) $(CXXFLAGS) -c $< -o $@
++	$(CXX) $(CFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
  
  clean:
  	rm -f *.o
diff --git a/debian/patches/series b/debian/patches/series
index 8cf2dc3..1daaa77 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
+fix_ungap
 hardening
 build_all_binaries
diff --git a/debian/rules b/debian/rules
index 3836efb..7bd0d33 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,6 +15,10 @@ override_dh_auto_clean:
 override_dh_auto_install:
 	mkdir -p $(debfolder)/snpomatic/usr/bin
 	cp findknownsnps $(debfolder)/snpomatic/usr/bin
+	cp reassemble $(debfolder)/snpomatic/usr/bin
+	cp variety $(debfolder)/snpomatic/usr/bin
+	cp mapcontigs $(debfolder)/snpomatic/usr/bin
+	cp ungap $(debfolder)/snpomatic/usr/bin
 
 override_dh_installman:
 	ronn debian/findknownsnps.1.ronn

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/snpomatic.git



More information about the debian-med-commit mailing list