File minsky.spec of Package minsky-beta-restservice
#
# spec file for package minsky
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# See also http://en.opensuse.org/openSUSE:Shared_library_packaging_policy
Name: minsky-beta-restservice
%define semver 3.19.0
%define betaver beta.6
Version: %{semver}~%{betaver}
Source0: Minsky-%{semver}-%{betaver}.tar.gz
Release: 1.1
Summary: Economics dynamical systems simulator
License: GPL-3.0+
Group: Productivity/Scientific/Math
Url: http://minsky.sourceforge.net
BuildRequires: gcc-c++ clang boost-devel librsvg2-devel gsl-devel cairo-devel pango-devel readline-devel libclipboard-devel openssl-devel hostname zlib-devel libicu-devel python3-devel
# I don't know why this is needed, as rpm should figure it out!!
Requires: libclipboard
%dump
# Upstream recommends to turn off _GLIBCXX_ASSERTIONS.
# See: https://github.com/highperformancecoder/minsky/pull/370
%global optflags %optflags -U_GLIBCXX_ASSERTIONS
# disable Fedora fiddling with the build flags
%undefine _auto_set_build_flags
%global python_sitelib %(%{__python3} %{_sourcedir}/sitePackages.py)
# required to exclude libXScrnSaver-devel on ppc64
%ifarch i586 || x86_64 || aarch64
BuildRequires: libXScrnSaver-devel
%endif
%global bdb BDB=1
%if "%{_vendor}"=="suse"
%if "%{_repository}"!="openSUSE_Tumbleweed" && "%{_repository}"!="openSUSE_Slowroll" && %{suse_version}<1600
# leap versions require specifying gcc version, but Tumbleweed always uses the latest?
BuildRequires: gcc11-c++
%endif
BuildRequires: libdb-4_8-devel libboost_system-devel libboost_regex-devel libboost_date_time-devel libboost_program_options-devel libboost_filesystem-devel libboost_thread-devel
%global clang_flto FLTO=
%ifarch ppc64 || ppc64le || armv7l
BuildRequires: libXss-devel
%endif
%endif
%if "%{_vendor}"=="redhat"
#%global clang_flto FLTO=1
BuildRequires: libdb-devel
%endif
%global debug_package %{nil}
%description
The %{name} package contains libraries and header files for
developing applications that use %{name}.
%prep
%setup -n Minsky-%{semver}-%{betaver}
%build
# work around a bodgy libXss devel package on ARM
if [ -f /usr/lib/libXss.so.1 ]; then
mkdir -p ~/usr/lib
ln -sf /usr/lib/libXss.so.1 ~/usr/lib/libXss.so
fi
# assert presence of Berkley DB, as it sometimes fails to find it
make %{?_smp_mflags} OBS=1 HAVE_NODE=1 NOWERROR=1 %{bdb} %{clang_flto}
%install
mkdir -p %{buildroot}/usr/bin %{buildroot}/usr/lib/minsky/resources/build %{buildroot}/%{python_sitelib}
cp RESTService/minsky-RESTService %{buildroot}/usr/bin
cp gui-js/build/*.node %{buildroot}/usr/lib/minsky/resources/build
cp pyminsky.so %{buildroot}/%{python_sitelib}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr (-,root,root)
%{_bindir}/minsky*
%dir /usr/lib/minsky
/usr/lib/minsky/*
%dir %{python_sitelib}
%{python_sitelib}/pyminsky.so
%changelog