seqan3/seqan3.spec

258 lines
7.2 KiB
RPMSpec

%global debug_package %{nil}
%global middle_release 0
# Not ready for GCC-12
# See rhbz#2047005
%bcond_with check
%bcond_with test_api
%bcond_with test_header
%bcond_with benchmark
%bcond_without doc
# SeqAn3 aims to support any 64-bit architecture running Linux/POSIX;
# currently big-endian CPU architectures like s390x are less supported.
ExclusiveArch: %{power64} x86_64 aarch64
%if 0%{?middle_release}
%global commit 4604f1b2db7131ea10b9d9ff56bf5a93e8c66847
%global date .20210809git
%global shortcommit %(c=%{commit}; echo ${c:0:8})
%else
%global commit %{nil}
%global date %{nil}
%global shortcommit %{nil}
%endif
Name: seqan3
Summary: The modern C++ library for sequence analysis
Version: 3.1.0
Release: 3%{date}%{shortcommit}%{?dist}
License: BSD
URL: http://www.seqan.de/
%if 0%{?middle_release}
# git clone -b 3.1.0-rc.1 --depth 1 --single-branch --progress --recursive https://github.com/seqan/seqan3.git
# find . -name '.git*' -exec rm -rf {} ';'
# find seqan3 -name '.git*' -exec rm -f {} ';'
# tar -czvf seqan3-%%{version}.tar.gz seqan3
Source0: https://github.com/seqan/%{name}/archive/%{commit}/%{name}-%{version}-rc1.tar.gz
%else
Source0: https://github.com/seqan/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
%endif
BuildRequires: gcc, gcc-c++, dos2unix
BuildRequires: ccache
BuildRequires: cmake >= 3.4
BuildRequires: cereal-devel >= 1.3.0
BuildRequires: sdsl-lite-devel >= 3.0.0
BuildRequires: make
BuildRequires: zlib-devel >= 1.2
BuildRequires: bzip2-devel >= 1.0
BuildRequires: range-v3-devel >= 0.11.0
BuildRequires: coin-or-lemon-devel
%if %{with check}
BuildRequires: google-benchmark-devel
BuildRequires: gtest-devel >= 1.10.0
%endif
%if %{with doc}
BuildRequires: texlive-newunicodechar
BuildRequires: doxygen >= 1.9.1
%endif
# Patches for unbundling libraries and fix some errors
Patch0: %{name}-unbundle_benchmark.patch
Patch1: %{name}-unbundle_gtest.patch
Patch2: %{name}-fix_bug2848.patch
Patch3: %{name}-fix_bug2918.patch
%description
SeqAn3 is the new version of the popular SeqAn template
library for the analysis of biological sequences.
It enables the rapid development of high-performance
solutions by providing generic algorithms and
data structures for:
- sequence representation and transformation
- full-text indexing and efficient search
- sequence alignment
- input/output of common file formats
%package devel
Summary: SeqAn3 header only files
Requires: cmake%{?_isa} >= 3.4
Requires: cereal-devel%{?_isa} >= 1.3.0
Requires: sdsl-lite-devel%{?_isa} >= 3.0.0
Requires: zlib-devel%{?_isa} >= 1.2
Requires: bzip2-devel%{?_isa} >= 1.0
Requires: range-v3-devel%{?_isa} >= 0.11.0
%description devel
C++ headers files of SeqAn3, including CMake configuration files.
%package doc
Summary: SeqAn3 documentation
BuildArch: noarch
%description doc
SeqAn3 documentation.
%prep
%autosetup -n %{name}-%{version} -N
dos2unix test/cmake/seqan3_require_benchmark.cmake
%patch0 -p1 -b .backup
%patch1 -p1 -b .backup
%if 0%{?fedora} > 35
%patch2 -p1 -b .backup
%patch3 -p1 -b .backup
%endif
# Unbundle libraries already on Fedora
rm -rf submodules/cereal
rm -rf submodules/range-v3
rm -rf submodules/sdsl-lite
# Fix file permissions
find . -type f -name "*.hpp" -exec chmod 0644 '{}' \;
%build
%if %{with check}
%if %{with test_api}
mkdir -p build
%cmake -S test/unit -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DSEQAN3_CEREAL:BOOL=ON \
-DSEQAN3_LEMON:BOOL=ON \
-DSEQAN3_TEST_BUILD_OFFLINE:BOOL=ON
%define _vpath_builddir build
%cmake_build
%endif
%if %{with test_header}
mkdir -p build-header
%cmake -S test/header -B build-header -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DSEQAN3_CEREAL:BOOL=ON \
-DSEQAN3_LEMON:BOOL=ON \
-DSEQAN3_TEST_BUILD_OFFLINE:BOOL=ON
%define _vpath_builddir build-header
%cmake_build
%endif
%if %{with benchmark}
mkdir -p build-performance
%cmake -S test/performance -B build-performance -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DSEQAN3_CEREAL:BOOL=ON \
-DSEQAN3_LEMON:BOOL=ON \
-DSEQAN3_TEST_BUILD_OFFLINE:BOOL=ON
%define _vpath_builddir build-performance
%cmake_build
%endif
%endif
%if %{with doc}
# This command needs to download a 'cppreference-doxygen-web.tag.xml' file
#mkdir -p build-doc
#%%cmake -S test/documentation -B build-doc -DCMAKE_BUILD_TYPE=Release
#make -j1 -C build-doc
%endif
%install
mkdir -p %{buildroot}%{_libdir}/cmake/%{name}
cp -a include %{buildroot}%{_prefix}/
install -pm 644 build_system/*.cmake %{buildroot}%{_libdir}/cmake/%{name}/
%if %{with check}
%check
# Tests the API of the library
%if %{with test_api}
%define _vpath_builddir build
%ctest
%endif
# Tests that every header includes all required headers and detects linkage issues
%if %{with test_header}
%define _vpath_builddir build-header
%ctest
%endif
# Microbenchmarks
%if %{with benchmark}
%define _vpath_builddir build-performance
%ctest
%endif
%endif
%files devel
%license LICENSE.md
%doc README.md
%{_includedir}/%{name}/
%{_libdir}/cmake/%{name}/
%if %{with doc}
%files doc
#%%doc build-doc/doc_usr/html
%doc doc/*
%license LICENSE.md
%doc README.md
%endif
%changelog
* Sat Feb 05 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
- Patched for GCC-12
* Mon Jan 17 2022 Kevin Fenzi <kevin@scrye.com> - 3.1.0-2
- Rebuild for hiredis 1.0.2
* Fri Nov 26 2021 Antonio Trande <sagitter@fedoraproject.org> - 3.1.0-1
- Release 3.1.0
* Sun Sep 05 2021 Antonio Trande <sagitter@fedoraproject.org> - 3.1.0-0.2.20210809git4604f1b2
- Rebuild for gtest-1.11.0
* Mon Aug 09 2021 Antonio Trande <sagitter@fedoraproject.org> - 3.1.0-0.1.20210809git4604f1b2
- Pre-release 3.1.0
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri May 28 2021 Antonio Trande <sagitter@fedoraproject.org> - 3.0.3-1
- Release 3.0.3
* Wed May 26 2021 Antonio Trande <sagitter@fedoraproject.org> - 3.0.3-0.1.rc1
- Pre-release 3.0.3-rc1
* Sun Feb 14 2021 Antonio Trande <sagitter@fedoraproject.org> - 3.0.2-7
- Disable tests with GCC-11 (rhbz#1923593)
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri Dec 11 2020 Antonio Trande <sagitter@fedoraproject.org> - 3.0.2-6
- Rebuild for GCC-11
* Tue Nov 03 2020 Antonio Trande <sagitter@fedoraproject.org> - 3.0.2-5
- Bundle sdsl header files
* Sat Oct 17 2020 Antonio Trande <sagitter@fedoraproject.org> - 3.0.2-4
- Remove old License file from bundled libraries
- Redefine vpath builddir
* Fri Oct 16 2020 Antonio Trande <sagitter@fedoraproject.org> - 3.0.2-3
- Fix Requires packages
* Wed Oct 14 2020 Antonio Trande <sagitter@fedoraproject.org> - 3.0.2-2
- Use -std=c++2a flag
- Patched for upstream bugs #2209 #2210
* Tue Oct 13 2020 Antonio Trande <sagitter@fedoraproject.org> - 3.0.2-1
- Release 3.0.2
* Fri Aug 07 2020 Antonio Trande <sagitter@fedoraproject.org> - 3.0.2-0.2.20200806gitbf04354
- Pre-release 3.0.2 with bundled range-v3
* Thu Aug 06 2020 Antonio Trande <sagitter@fedoraproject.org> - 3.0.2-0.1.20200806gitbf04354
- Pre-release 3.0.2
* Thu Mar 05 2020 Antonio Trande <sagitter@fedoraproject.org> - 3.0.1-1
- Execute header/performance tests
- Build docs
- First package