File samtools-legacy.spec of Package samtools-legacy
#
# spec file for package samtools-legacy
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: samtools-legacy
Version: 0.1.19
Release: 0
Summary: Tools for manipulating next-generation sequencing data
License: MIT
Group: Productivity/Scientific/Other
Url: http://samtools.sourceforge.net/
Source: https://sourceforge.net/projects/samtools/files/samtools/%{version}/samtools-%{version}.tar.bz2
Patch0: samtools-0.1.14-soname.patch
Patch1: samtools-0.1.19-faidx_fetch_seq2.patch
# The Rsamtools upstream is fixing issues in the samtools 0.1.19 codebase
Patch2: samtools-0.1.19-R-fixes.patch
BuildRequires: ncurses-devel
BuildRequires: zlib-devel >= 1.2.3
Requires: libbam1 = %{version}-%{release}
Requires: perl
Conflicts: samtools
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Samtools implements various utilities for post-processing alignments in the
SAM, BAM, and CRAM formats, including indexing, variant calling (in conjunction
with bcftools), and a simple alignment viewer.
This is the legacy version which does not use the HTSlib and is required by some software.
%package devel
Summary: Header files and libraries for compiling against %{name}
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}-%{release}
Requires: libbam1 = %{version}-%{release}
%description devel
Header files and libraries for compiling against %{name}
%package -n libbam1
Summary: Libraries for applications using %{name}
Group: Development/Libraries/C and C++
%description -n libbam1
Libraries for applications using %{name}
%prep
%setup -q -n samtools-%{version}
%patch0 -p1 -b .soname
%patch1 -p1 -b .seq2
%patch2 -p1 -b .Rfixes
# fix wrong interpreter
perl -pi -e "s[/software/bin/python][python]" misc/varfilter.py
# fix eol encoding
sed -i 's/\r//' misc/export2sam.pl
%build
make CFLAGS="%{optflags}" dylib %{?_smp_mflags}
make LIBCURSES="-lncurses" CFLAGS="%{optflags} -fPIC" samtools razip %{?_smp_mflags}
cd misc/
make CFLAGS="%{optflags} -fPIC" %{?_smp_mflags}
cd ../bcftools
make CFLAGS="%{optflags} -fPIC" %{?_smp_mflags}
%install
mkdir -p %{buildroot}%{_bindir}
install -p samtools razip %{buildroot}%{_bindir}
# header and library files
mkdir -p %{buildroot}%{_includedir}/%{name}
install -p -m 644 *.h %{buildroot}%{_includedir}/%{name}
mkdir -p %{buildroot}%{_libdir}
strip libbam.so.1
install -p -m 755 libbam.so.1 %{buildroot}%{_libdir}
ln -sf libbam.so.1 %{buildroot}%{_libdir}/libbam.so
mkdir -p %{buildroot}%{_mandir}/man1/
cp -p samtools.1 %{buildroot}%{_mandir}/man1/
#cp -p bcftools/bcftools.1 %{buildroot}%{_mandir}/man1/
cd misc/
install -p blast2sam.pl bowtie2sam.pl export2sam.pl interpolate_sam.pl \
maq2sam-long maq2sam-short md5fa md5sum-lite novo2sam.pl psl2sam.pl \
sam2vcf.pl samtools.pl soap2sam.pl varfilter.py wgsim wgsim_eval.pl \
zoom2sam.pl \
%{buildroot}%{_bindir}
cd ../bcftools/
install -p bcftools vcfutils.pl %{buildroot}%{_bindir}
mv README README.bcftools
%post -n libbam1 -p /sbin/ldconfig
%postun -n libbam1 -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog.old COPYING INSTALL NEWS examples/ bcftools/README.bcftools bcftools/bcf.tex
%{_bindir}/*
%{_mandir}/man1/*
%files devel
%defattr(-,root,root,-)
%{_includedir}/%{name}
%{_libdir}/libbam.so
%files -n libbam1
%defattr(-,root,root,-)
%{_libdir}/libbam.so.*
%changelog