python-graph-tool/python-graph-tool.spec

206 lines
7.0 KiB
RPMSpec
Raw Permalink Normal View History

2022-12-21 22:31:26 +00:00
# This needs about 15 gigs per thread, otherwise OOMs.
%constrain_build -m 15360
2019-11-09 19:00:21 +00:00
%global _description %{expand:
Graph-tool is an efficient Python module for manipulation and statistical
analysis of graphs (a.k.a. networks). Contrary to most other python modules
with similar functionality, the core data structures and algorithms are
implemented in C++, making extensive use of template metaprogramming, based
heavily on the Boost Graph Library. This confers it a level of performance that
is comparable (both in memory usage and computation time) to that of a pure
C/C++ library.
Please refer to https://graph-tool.skewed.de/static/doc/index.html for
documentation.}
Name: python-graph-tool
2024-01-06 16:36:30 +00:00
Version: 2.59
2021-12-17 03:48:33 +00:00
Release: %autorelease
2019-11-09 19:00:21 +00:00
Summary: Efficient network analysis tool written in Python
2022-11-18 01:03:00 +00:00
# The entire source is LGPL-3.0-or-later, except:
# - BSL-1.0: src/boost-workaround/
# src/graph/graphml.cpp
# src/graph/read_graphviz_new.cpp
# - LGPL-3.0-or-later AND BSD-3-Clause: src/graph_tool/collection/small.py
# Additionally, the following libraries are header-only and are therefore
# treated as static libraries; their licenses do contribute to that of the
# binary RPMs:
# - CGAL is: LGPL-3.0-or-later AND GPL-3.0-or-later AND BSL-1.0 AND MIT
# - pcg-cpp is: MIT OR Apache-2.0
2022-11-18 01:03:00 +00:00
# Additionally, the following are under other licenses but do not contribute to
# the licenses of the binary RPMs:
# - FSFULLR: aclocal.m4
# - FSFUL (or perhaps FSFUL AND LGPL-3.0-or-later): configure
# - GPL-2.0-or-later: build-aux/compile
# build-aux/depcomp
# build-aux/ltmain.sh
# build-aux/py-compile
# m4/ax_boost_python.m4
# - GPL-3.0-or-later: build-aux/config.guess
# build-aux/config.sub
# m4/ax_create_pkgconfig_info.m4
# m4/ax_openmp.m4
# m4/ax_python_devel.m4
# - X11: build-aux/install-sh
# - FSFAP: m4/ax_boost_base.m4
# m4/ax_boost_context.m4
# m4/ax_boost_coroutine.m4
# m4/ax_boost_graph.m4
# m4/ax_boost_iostreams.m4
# m4/ax_boost_regex.m4
# m4/ax_boost_thread.m4
# m4/ax_cxx_compile_stdcxx.m4,
# m4/ax_cxx_compile_stdcxx_17.m4
# m4/ax_lib_cgal_core.m4
# m4/ax_python_module.m4
2023-10-30 11:07:39 +00:00
License: %{shrink:
LGPL-3.0-or-later AND
BSL-1.0 AND
BSD-3-Clause AND
GPL-3.0-or-later AND
MIT AND
(MIT OR Apache-2.0)
}
2019-11-09 19:00:21 +00:00
URL: https://graph-tool.skewed.de/
Source: https://downloads.skewed.de/graph-tool/graph-tool-%{version}.tar.bz2
# Remove upstream compiler flags
#
# We can leave those controlling warnings and dynamic symbol visibility;
# we must remove any that hard-code the optimization settings or otherwise
# fail to respect the distribution defaults.
Patch: 0001-Remove-upstream-compiler-flags.patch
2019-11-09 19:00:21 +00:00
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
ExcludeArch: %{ix86}
2019-11-11 18:37:28 +00:00
2021-08-16 08:42:16 +00:00
BuildRequires: make
2019-11-09 19:00:21 +00:00
BuildRequires: git-core
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: gawk
2019-11-09 19:00:21 +00:00
%description %_description
%package -n python3-graph-tool
2019-11-09 19:00:21 +00:00
Summary: %{summary}
2019-11-09 19:00:21 +00:00
BuildRequires: python3-devel
BuildRequires: boost-devel
BuildRequires: boost-python3-devel
BuildRequires: CGAL-devel
# CGAL is header-only since version 5.4.0, so we must BR the virtual -static
# subpackage for tracking, per Fedora guidelines
BuildRequires: CGAL-static
BuildRequires: pkgconfig(cairomm-1.16)
2019-11-09 19:00:21 +00:00
BuildRequires: expat-devel
BuildRequires: gcc-c++
2019-11-09 19:00:21 +00:00
BuildRequires: gmp-devel
BuildRequires: gtk3-devel
BuildRequires: python3-cairo-devel
BuildRequires: python3-devel
BuildRequires: %{py3_dist scipy}
BuildRequires: %{py3_dist matplotlib}
BuildRequires: %{py3_dist numpy}
BuildRequires: sparsehash-devel
# BR -static package of header-only libraries for tracking per guidelines
BuildRequires: pcg-cpp-devel
BuildRequires: pcg-cpp-static
2019-11-09 19:00:21 +00:00
Provides: graph-tool%{?_isa} = %{version}-%{release}
%description -n python3-graph-tool %_description
2019-11-09 19:00:21 +00:00
%package -n python3-graph-tool-devel
Summary: %{summary}
# This package does not contain compiled binaries, so its license does not
# include the licenses of header-only “static” dependencies. The headers of
# pcg-cpp are “re-exposed” in this package, but it uses symbolic links rather
# than installing additional copies. Additionally, no .py source files are
# included.
License: LGPL-3.0-or-later AND BSL-1.0
Requires: python3-graph-tool%{?_isa} = %{version}-%{release}
# Since this header-only package is re-exposed as part of the extension API,
# dependent packages should ideally also BuildRequire pcg-cpp-static for
# tracking, per guidelines.
Requires: pcg-cpp-devel
Provides: graph-tool-devel%{?_isa} = %{version}-%{release}
%description -n python3-graph-tool-devel %_description
2019-11-09 19:00:21 +00:00
%prep
%autosetup -S git -n graph-tool-%{version}
2021-09-20 14:53:01 +00:00
# Remove shebangs from non-script sources
#
# The pattern of selecting files before modifying them with sed keeps us from
# unnecessarily discarding the original mtimes on unmodified files.
find 'src' -type f -name '*.py' \
2021-09-20 14:53:01 +00:00
-exec gawk '/^#!/ { print FILENAME }; { nextfile }' '{}' '+' |
xargs -r sed -r -i '1{/^#!/d}'
# Fix shebang(s) in sample script(s)
%py3_shebang_fix doc
2019-11-09 19:00:21 +00:00
# Unbundle pcg-cpp. To avoid having to patch the Makefiles, we use symbolic
# links from the original locations. Note that these are followed when the
# extension API headers are installed, so we need to re-create them afterwards.
rm -vf src/pcg-cpp/include/*
ln -sv \
'%{_includedir}/pcg_extras.hpp' \
'%{_includedir}/pcg_random.hpp' \
'%{_includedir}/pcg_uint128.hpp' \
'src/pcg-cpp/include/'
# Drop intersphinx mappings, since we cant download remote inventories and
# cant easily produce working hyperlinks from inventories in local
# documentation packages.
echo 'intersphinx_mapping.clear()' >> doc/conf.py
2019-11-09 19:00:21 +00:00
%build
./autogen.sh
2022-11-19 19:36:40 +00:00
%configure \
--with-python-module-path=%{python3_sitearch} \
--with-boost-libdir=%{_libdir} \
--enable-debug
2022-12-21 22:31:26 +00:00
%make_build
2019-11-09 19:00:21 +00:00
2019-11-09 19:00:21 +00:00
%install
%make_install
# Remove installed doc sources
rm -rf %{buildroot}/%{_datadir}/doc/graph-tool
2019-11-09 19:00:21 +00:00
# Remove static objects
find %{buildroot} -name '*.la' -print -delete
# Restore symbolic links that were followed in “wheelification”
ln -svf \
'%{_includedir}/pcg_extras.hpp' \
'%{_includedir}/pcg_random.hpp' \
'%{_includedir}/pcg_uint128.hpp' \
'%{buildroot}%{python3_sitearch}/graph_tool/include/pcg-cpp/'
2019-11-09 19:00:21 +00:00
%files -n python3-graph-tool
2022-11-18 01:04:02 +00:00
%license COPYING src/boost-workaround/LICENSE_1_0.txt
2019-11-09 19:00:21 +00:00
%doc README.md ChangeLog AUTHORS
%{python3_sitearch}/graph_tool/
%exclude %{python3_sitearch}/graph_tool/include/
%files -n python3-graph-tool-devel
%{python3_sitearch}/graph_tool/include/
%{_libdir}/pkgconfig/graph-tool-py%{python3_version}.pc
2019-11-09 19:00:21 +00:00
2019-11-09 19:00:21 +00:00
%changelog
2021-12-17 03:48:33 +00:00
%autochangelog