File moose.spec of Package moose

# maintainer: Dilawar Singh <>
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

%global version 3.1.4
%define _unpackaged_files_terminate_build 0 

Name: moose

# fixme: build debuginfo if possible with given complicated cmake calls.
%define debug_package %{nil}

Group: Applications/Biology
Summary: Neuronal modeling software spanning molecules, electrophysiology and networks

Version: %{version}
Release: 1%{?dist}
Source: moose-%{version}.tar.gz
License: GPL-3.0

BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: python-devel
BuildRequires: libxml2-devel
BuildRequires: gsl-devel

%if 0%{?centos_version} || 0%{?rhel_version} || 0%{?scientificlinux_version}
BuildRequires: pkg-config
BuildRequires: boost-devel
BuildRequires: pkgconfig
BuildRequires: fdupes
BuildRequires: gsl-devel

%if 0%{?fedora_version} > 27
%BuildRequires: generic-release

%if 0%{?suse_version} 
BuildRequires: python-sip
BuildRequires: sip-devel

%if 0%{?suse_version} 
BuildRequires: python-qt4-devel
BuildRequires: libqt4-devel
BuildRequires: PyQt4-devel
BuildRequires: qt4-devel  libjpeg-devel

%if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?scientificlinux_version}
BuildRequires: numpy atlas
BuildRequires: python-numpy-devel

%if 0%{?centos_version} || 0%{?rhel_version} || 0%{?scientificlinux_version}
Requires: PyQt4
Requires: python-qt4

Requires: python-networkx
Requires: python-matplotlib
Requires: python-lxml

%if 0%{?fedora_version} || 0%{?suse_version} || 0%{?centos_version} || 0%{?scientificlinux_version}
Requires: numpy 
Requires: python-numpy

%if 0%{?suse_version} || 0%{?rhel_version} 
Requires: python-qt4
Requires: PyQt4

MOOSE is the Multiscale Object-Oriented Simulation Environment. It is designed
to simulate neural systems ranging from biochemical signaling to complex models
of single neurons, circuits, and large networks. A typical use case is to model
neural activity-driven synaptic plasticity, in which network activity to
synapses triggers biochemical reaction-diffusion events, which in turn modulate
ion channels to give rise to synaptic plasticity.

%setup -q

# Explicitly adding flags.
mkdir -p _build
cd _build 
cmake \
          -DCMAKE_INSTALL_PREFIX=%{buildroot}/usr \
          -DCMAKE_INSALL_LIBEXEC=%_libexecdir \
          -DCMAKE_C_FLAGS=%optflags \
          -DCMAKE_CXX_FLAGS=%optflags \
          -DVERSION_MOOSE=%version \
%if 0%{?centos_version}
          -DWITH_MOOGLI=OFF \
          -DWITH_MOOGLI=ON \

make VERBOSE=0 %{?_smp_mflags}

cd _build
make install
# Note: direct installation causes following
find "%{buildroot}%{python_sitelib}" -type f -name "*.pyc" -exec %__rm {} \;
%__python -c 'import compileall; 
    , ddir="%{python_sitelib}/", force=1)'

# Create a launcher.
cat > $GUIBIN <<EOF
cd %{_prefix}/lib/moose/gui && python  
chmod a+x $GUIBIN
%if 0%{?centos_version} || 0%{?rhel_version} || 0%{?scientificlinux_version}
%fdupes %{buildroot}/%{_prefix}

%dir /usr/lib/moose
openSUSE Build Service is sponsored by