00ff2c8
# Smoldyn provides the SFMT-1.3.3 (SIMD-oriented Fast Mersenne Twister) source code;
00ff2c8
# currently unavailable on Fedora.
00ff2c8
# http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/index.html
00ff2c8
00ff2c8
# VTK support?
00ff2c8
# See https://github.com/ssandrews/Smoldyn-official/issues/3
00ff2c8
%global with_vtk 0
00ff2c8
00ff2c8
Name:  smoldyn
00ff2c8
Summary: A particle-based spatial stochastic simulator
3135055
Version: 2.63
2c46829
Release: 2%{?dist}
00ff2c8
00ff2c8
# The rxnparam.c and SurfaceParam.c source code files are in the public domain.
00ff2c8
#
00ff2c8
# The Next Subvolume module is Copyright 2012 by Martin Robinson and is distributed
00ff2c8
# under the Gnu LGPL license.
00ff2c8
#
00ff2c8
# The rest of the code is Copyright 2003-2018 by Steven Andrews and also
00ff2c8
# distributed under the Gnu LGPL.
00ff2c8
#
3135055
# source/libSteve/SFMT is licensed under the 'BSD 3-clause "New" or "Revised" License'
00ff2c8
License: LGPLv3+ and Public Domain and BSD
00ff2c8
URL:   http://www.smoldyn.org
7c0dc02
Source0: %{url}/%{name}-%{version}.zip
00ff2c8
00ff2c8
# Fix library paths according to the Fedora Project guidelines
00ff2c8
Patch0: %{name}-fix_libpaths.patch
ed9e774
Patch1: %{name}-freeglut.patch
00ff2c8
679404a
BuildRequires: make
00ff2c8
BuildRequires: cmake3
00ff2c8
BuildRequires: gcc
3135055
BuildRequires: gcc-c++
3341dd7
BuildRequires: boost-devel
00ff2c8
BuildRequires: freeglut-devel
00ff2c8
BuildRequires: libXmu-devel
00ff2c8
BuildRequires: libXi-devel
00ff2c8
BuildRequires: libtiff-devel
00ff2c8
BuildRequires: libglvnd-devel
4f8d76a
BuildRequires: perl-macros
3135055
BuildRequires: python3-devel
00ff2c8
%if %{?with_vtk}
00ff2c8
BuildRequires: vtk-devel
00ff2c8
%endif
00ff2c8
BuildRequires: zlib-devel
00ff2c8
00ff2c8
Requires: bionetgen-perl
00ff2c8
Provides: bundled(SFMT) = 1.3.3 
00ff2c8
00ff2c8
%description
00ff2c8
Smoldyn is a computer program for cell-scale biochemical simulations.
00ff2c8
It simulates each molecule of interest individually to capture natural
00ff2c8
stochasticity and to yield nanometer-scale spatial resolution.
00ff2c8
It treats other molecules implicitly, enabling it to simulate hundreds
00ff2c8
of thousands of molecules over several minutes of real time.
00ff2c8
00ff2c8
Simulated molecules diffuse, react, are confined by surfaces,
00ff2c8
and bind to membranes much as they would in a real biological system.
00ff2c8
00ff2c8
It is more accurate and faster than other particle-based simulators.
3135055
Smoldyn unique features include: a "virtual experimenter" who can
00ff2c8
manipulate or measure the simulated system, support for spatial compartments,
00ff2c8
molecules with excluded volume, and simulations in 1, 2, or 3 dimensions. 
00ff2c8
00ff2c8
%package doc
00ff2c8
Summary: %{name} PDF documentation
00ff2c8
Requires: %{name} = %{version}-%{release}
00ff2c8
BuildArch: noarch
00ff2c8
%description doc
00ff2c8
%{name} PDF documentation.
00ff2c8
00ff2c8
%prep
ed9e774
%autosetup -n %{name}-%{version} -N
00ff2c8
%patch0 -p0 -b .fix_libpaths
ed9e774
%patch1 -p0 -b .freeglut
00ff2c8
3135055
# Remove bundled archives
3135055
rm -rf source/MSVClibs source/pybind11
00ff2c8
00ff2c8
# Remove bundled libraries
00ff2c8
rm -rf source/BioNetGen source/MinGWlibs Toolchain-mingw32.cmake
00ff2c8
rm -rf source/vcell/* source/NextSubVolume/Eigen
00ff2c8
rm -rf source/NextSubVolume/boost_include
00ff2c8
%if !%{?with_vtk}
00ff2c8
rm -f source/vtk/*
00ff2c8
%endif
00ff2c8
00ff2c8
#Fix permissions
00ff2c8
find . -type f -name "*.h" -exec chmod 0644 '{}' \;
00ff2c8
find . -type f -name "*.c" -exec chmod 0644 '{}' \;
00ff2c8
find . -type f -name "*.pdf" -exec chmod 0644 '{}' \;
00ff2c8
find . -type f -name "*.txt" -exec chmod 0644 '{}' \;
00ff2c8
find . -type f -name "*.txt" -exec sed -i 's/\r$//' '{}' \;
00ff2c8
00ff2c8
# Set system path to BNG2.pl
00ff2c8
sed -e 's|../../../source/BioNetGen/BNG2.pl|%{perl_vendorlib}/BioNetGen/BNG2.pl|g' -i examples/S95_regression/lrmsim.txt \
00ff2c8
 examples/S12_bionetgen/lrm/lrmsim.txt \
00ff2c8
 examples/S12_bionetgen/abba/abbasim.txt \
00ff2c8
 examples/S94_archive/Andrews_2016/BioNetGen/lrm/lrmsim.txt \
00ff2c8
 examples/S94_archive/Andrews_2016/BioNetGen/abba/abbasim.txt
3135055
 
3135055
# Copy license file
3135055
cp -p source/libSteve/SFMT/LICENSE.txt source/libSteve/SFMT/SFMT-LICENSE.txt
3135055
cp -p source/libSteve/SFMT/README.txt source/libSteve/SFMT/SFMT-README.txt
3135055
00ff2c8
%build
3135055
# Python binding needs shared libraries
3135055
%cmake3 -Wno-dev -B . -S . \
00ff2c8
 -DCPACK_BINARY_STGZ:BOOL=OFF \
00ff2c8
 -DCPACK_BINARY_TGZ:BOOL=OFF \
00ff2c8
 -DCPACK_BINARY_TZ:BOOL=OFF \
00ff2c8
 -DCPACK_SOURCE_TBZ2:BOOL=OFF \
00ff2c8
 -DCPACK_SOURCE_TGZ:BOOL=OFF \
00ff2c8
 -DCPACK_SOURCE_TXZ:BOOL=OFF \
00ff2c8
 -DCPACK_SOURCE_TZ:BOOL=OFF \
00ff2c8
 -DOPTION_VCELL:BOOL=OFF \
00ff2c8
%if %{?with_vtk}
00ff2c8
 -DOPTION_VTK:BOOL=ON \
00ff2c8
%else
00ff2c8
 -DOPTION_VTK:BOOL=OFF \
00ff2c8
%endif
3135055
 -DBUILD_SHARED_LIBS:BOOL=OFF \
3135055
 -DSMOLDYN_VERSION:STRING=%{version} \
00ff2c8
 -DOPTION_TARGET_LIBSMOLDYN:BOOL=OFF \
3135055
 -DOPTION_STATIC:BOOL=OFF \
3135055
 -DOPTION_PYTHON:BOOL=OFF -DPYBIND11_FINDPYTHON:BOOL=OFF \
00ff2c8
 -DOPTION_USE_ZLIB:BOOL=ON \
00ff2c8
 -DOPTION_PDE:BOOL=ON \
00ff2c8
 -DPERL_VENDORLIB:PATH=%{perl_vendorlib} \
00ff2c8
 -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \
00ff2c8
 -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
00ff2c8
 -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE -DCMAKE_COLOR_MAKEFILE:BOOL=ON \
a17a6ee
 -DCMAKE_SKIP_RPATH:BOOL=YES \
3135055
 -DHAVE_GL_FREEGLUT_H=TRUE
3135055
%make_build
00ff2c8
00ff2c8
%install
3135055
%make_install
00ff2c8
00ff2c8
%files
3135055
%license License.txt source/libSteve/SFMT/SFMT-LICENSE.txt
00ff2c8
%{_bindir}/%{name}
00ff2c8
00ff2c8
%files doc
4195571
%doc documentation/*
00ff2c8
00ff2c8
%changelog
4195571
* Sat Jan 30 2021 Antonio Trande <sagitter@fedoraproject.org> - 2.63-2
4195571
- Exclude example files (strange permissions)
4195571
3135055
* Fri Jan 29 2021 Antonio Trande <sagitter@fedoraproject.org> - 2.63-1
3135055
- Release 2.63
3135055
582d57a
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.61-6
582d57a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
582d57a
8a30d60
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.61-5
8a30d60
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
8a30d60
e8000a2
* Fri Jul 24 2020 Jeff Law <law@redhat.com> - 2.61-4
e8000a2
- Use  __cmake_in_source_build
e8000a2
e42aee6
* Mon May 25 2020 Antonio Trande <sagitter@fedoraproject.org> - 2.61-3
e42aee6
- Fix patch for EPEL7
e42aee6
3341dd7
* Mon May 25 2020 Antonio Trande <sagitter@fedoraproject.org> - 2.61-2
3341dd7
- Patched for using Boost169 on EPEL7
3341dd7
ed9e774
* Sun May 24 2020 Antonio Trande <sagitter@fedoraproject.org> - 2.61-1
ed9e774
- Release 2.61
ed9e774
f519290
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.58-4
f519290
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
f519290
a17a6ee
* Tue Sep 17 2019 Gwyn Ciesla <gwync@protonmail.com> - 2.58-3
a17a6ee
- Rebuilt for new freeglut
a17a6ee
23898f8
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.58-2
23898f8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
23898f8
00ff2c8
* Fri Mar 29 2019 Antonio Trande <sagitter@fedoraproject.org> - 2.58-1
00ff2c8
- Release 2.58
00ff2c8
00ff2c8
* Sun Feb 03 2019 Antonio Trande <sagitter@fedoraproject.org> - 2.56-1
00ff2c8
- First package
00ff2c8
- Unbundle zlib, boost and BioNetGen
00ff2c8
- Remove unused header files
00ff2c8
- Fix file permissions
00ff2c8
- Add License file provided by upstream