File picat.spec of Package picat

#
# spec file for package picat
#
# Copyright (c) 2019 SUSE LINUX 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 https://bugs.opensuse.org/
#


%define uver    26
%ifarch %ix86 || %arm
%define arch_suffix 32
%else
%define arch_suffix 64
%endif
Name:           picat
Version:        2.6
Release:        0
Summary:        Multi-paradigm programming language
License:        MPL-2.0
Group:          Development/Languages/Other
URL:            http://picat-lang.org
Source0:        http://picat-lang.org/download/picat%{uver}_src.tar.gz
Source98:       https://www.mozilla.org/media/MPL/2.0/index.815ca599c9df.txt#/LICENSE
# PATCH-FIX-OPENSUSE picat-cflags.patch
Patch0:         picat-cflags.patch
# PATCH-FIX-UPSTREAM picat-implicit.patch
Patch1:         picat-implicit.patch
# PATCH-FIX-UPSTREAM picat-no_return_in_nonvoid.patch
Patch2:         picat-no_return_in_nonvoid.patch
BuildRequires:  dos2unix
BuildRequires:  fdupes

%description
A logic-based multi-paradigm programming language aimed at
general-purpose applications.

%prep
%setup -q -n Picat
%patch0 -p1
%patch1 -p1
%patch2 -p1
install -m0644 %{SOURCE98} .
dos2unix README; chmod -x README
find doc exs lib -type f \( -exec dos2unix '{}' \; \) -exec chmod -x '{}' \;
rm exs/smt/__tmp.* exs/cp/sudoku.pi~ exs/smt/bqueens.pi~

%build
pushd emu
cp Makefile.picat.linux%{arch_suffix} Makefile
make %{?_smp_mflags} picat_linux%{arch_suffix}
popd

%install
install -Dm0755 emu/picat_linux%{arch_suffix} %{buildroot}%{_bindir}/%{name}
mkdir -pv %{buildroot}%{_libexecdir}/%{name} %{buildroot}%{_defaultdocdir}/%{name}/exs
cp lib/* %{buildroot}%{_libexecdir}/%{name}
cp -a exs/* %{buildroot}%{_defaultdocdir}/%{name}/exs
%fdupes -s %{buildroot}%{_defaultdocdir}/%{name}/exs

%files
%license LICENSE
%doc README doc
%doc %{_defaultdocdir}/%{name}/exs
%{_bindir}/%{name}
%{_libexecdir}/%{name}

%changelog
openSUSE Build Service is sponsored by