seqan3/seqan3.spec
2026-03-22 14:45:04 +01:00

215 lines
6.3 KiB
RPMSpec

%global debug_package %{nil}
%global middle_release 0
%bcond_without check
%bcond_without test_api
%bcond_without test_header
%bcond_without benchmark
# Documentation needs external online `cppreference-doc/releases/download/v20220201/html-book-20220201.tar.xz`
%bcond_with 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 8c604d98e0d291bc3909ecbad78ca778b3ad5a5c
%global date .20230403git
%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.4.2
Release: %autorelease
License: BSD-3-Clause
URL: https://www.seqan.de/
# Source code archive generated by:
# git clone -b 3.3.0 --depth 1 --single-branch --progress --recursive https://github.com/seqan/seqan3.git
# find seqan3 -name '.git*' -exec rm -rf {} ';'
# find seqan3 -name '.git*' -exec rm -f {} ';'
# tar -czvf seqan3-%%{version}.tar.gz seqan3
%if 0%{?middle_release}
Source0: https://github.com/seqan/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz
%else
Source0: https://github.com/seqan/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
%endif
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: ccache
BuildRequires: cmake >= 3.4
BuildRequires: cereal-devel >= 1.3.2
BuildRequires: sdsl-lite-devel >= 3.0.1
BuildRequires: make
BuildRequires: zlib-devel >= 1.2
BuildRequires: bzip2-devel >= 1.0
BuildRequires: range-v3-devel >= 0.11.0
%if %{with check}
BuildRequires: google-benchmark-devel
BuildRequires: gtest-devel >= 1.10.0
%endif
%if %{with doc}
BuildRequires: texlive-newunicodechar
BuildRequires: doxygen >= 1.9.4
%endif
# Use Fedora's CMake only
Patch1: %{name}-3.4.0-disable_CPM.patch
# Include missing header files
Patch2: %{name}-fix_GCC15.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
# bzip2stream and zipstream libraries are distributed under zlib/libpng
License: BSD-3-Clause AND Zlib
Requires: cmake%{?_isa} >= 3.4
Requires: cereal-devel%{?_isa} >= 1.3.2
Requires: sdsl-lite-devel%{?_isa} >= 3.0.1
Requires: zlib-devel%{?_isa} >= 1.2
Requires: bzip2-devel%{?_isa} >= 1.0
Requires: range-v3-devel%{?_isa} >= 0.11.0
Provides: bundled(bzip2stream)
Provides: bundled(zipstream)
%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
%patch 1 -p1 -b .backup
%patch 2 -p1 -b .backup
# Unbundle libraries already available in 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
export CXXFLAGS="%{build_cxxflags} -std=c++23"
%cmake -S test/unit -B build -DCMAKE_BUILD_TYPE=Release \
-DCPM_USE_LOCAL_PACKAGES:BOOL=OFF -DCPM_LOCAL_PACKAGES_ONLY:BOOL=OFF \
-DCPM_DONT_UPDATE_MODULE_PATH:BOOL=ON -DCPM_DONT_CREATE_PACKAGE_LOCK:BOOL=ON \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DSEQAN3_CEREAL:BOOL=ON \
-DSEQAN3_TEST_BUILD_OFFLINE:BOOL=ON -DFETCHCONTENT_FULLY_DISCONNECTED:BOOL=ON \
-DFETCHCONTENT_UPDATES_DISCONNECTED:BOOL=ON \
-DSEQAN3_NO_ZLIB=OFF
%define _vpath_builddir build
%cmake_build
%endif
%if %{with test_header}
mkdir -p build-header
export CXXFLAGS="%{build_cxxflags} -std=c++23"
%cmake -S test/header -B build-header -DCMAKE_BUILD_TYPE=Release \
-DCPM_USE_LOCAL_PACKAGES:BOOL=OFF -DCPM_LOCAL_PACKAGES_ONLY:BOOL=OFF \
-DCPM_DONT_UPDATE_MODULE_PATH:BOOL=ON -DCPM_DONT_CREATE_PACKAGE_LOCK:BOOL=ON \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DSEQAN3_CEREAL:BOOL=ON \
-DSEQAN3_TEST_BUILD_OFFLINE:BOOL=ON -DFETCHCONTENT_FULLY_DISCONNECTED:BOOL=ON \
-DFETCHCONTENT_UPDATES_DISCONNECTED:BOOL=ON \
-DSEQAN3_NO_ZLIB=OFF
%define _vpath_builddir build-header
%cmake_build
%endif
%if %{with benchmark}
mkdir -p build-performance
export CXXFLAGS="%{build_cxxflags} -std=c++23"
%cmake -S test/performance -B build-performance -DCMAKE_BUILD_TYPE=Release \
-DCPM_USE_LOCAL_PACKAGES:BOOL=OFF -DCPM_LOCAL_PACKAGES_ONLY:BOOL=OFF \
-DCPM_DONT_UPDATE_MODULE_PATH:BOOL=ON -DCPM_DONT_CREATE_PACKAGE_LOCK:BOOL=ON \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DSEQAN3_CEREAL:BOOL=ON \
-DSEQAN3_TEST_BUILD_OFFLINE:BOOL=ON -DFETCHCONTENT_FULLY_DISCONNECTED:BOOL=ON \
-DFETCHCONTENT_UPDATES_DISCONNECTED:BOOL=ON \
-DSEQAN3_NO_ZLIB=OFF
%define _vpath_builddir build-performance
%cmake_build
%endif
%endif
%if %{with doc}
mkdir -p build-doc
%cmake -S test/documentation -B build-doc -DCMAKE_BUILD_TYPE=Release
%define _vpath_builddir build-doc
%cmake_build -- -j1
%endif
%install
mkdir -p %{buildroot}%{_libdir}/cmake/%{name}
cp -a include %{buildroot}%{_prefix}/
rm %{buildroot}%{_includedir}/%{name}/contrib/std/.{clang-format,gitignore}
install -pm 644 cmake/seqan3-config-version.cmake %{buildroot}%{_libdir}/cmake/%{name}/
install -pm 644 cmake/seqan3-config.cmake %{buildroot}%{_libdir}/cmake/%{name}/
%if %{with doc}
mkdir -p build-doc
%cmake -S test/documentation -B build-doc -DCMAKE_BUILD_TYPE=Release
%define _vpath_builddir build-doc
%cmake_install
%endif
%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
%autochangelog