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