File sbcl.spec of Package sbcl

# spec file for package sbcl
# Copyright (c) 2014 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

Name:           sbcl
Version:        1.2.3
Release:        0
Summary:        Steel Bank Common Lisp
License:        SUSE-Public-Domain and BSD-3-Clause
Group:          Development/Languages/Other
Source1:        README.openSUSE
Source2:        sbclrc.sample
Source3:        customize-target-features.lisp
BuildRequires:  ctags
BuildRequires:  ghostscript
# Use --with-bootstrap to bootstrap sbcl with clisp
%bcond_with bootstrap
%if 0%{?centos_version} == 600 || 0%{?rhel_version} == 600 ||  0%{?suse_version} == 1110 
%global with_bootstrap 1
%if %{with bootstrap}
BuildRequires:  clisp
BuildRequires:  sbcl
BuildRequires:  zlib-devel
%if 0%{?fedora_version:1}
BuildRequires:  texinfo-tex
BuildRequires:  netcfg
BuildRequires:  texinfo
%if 0%{?suse_version} > 1220 || 0%{?fedora_version:1}
BuildRequires:  texlive-dvips
BuildRequires:  texlive
# PATCH-FIX-OPENSUSE  sbcl-1.1.17-optflags.patch based on fedora patch --use optflags
Patch0:         sbcl-1.1.17-optflags.patch
# PATCH-FIX-OPENSUSE  dont-split-doc.patch from debian author unknown --don't split docs
Patch1:         dont-split-doc.patch
# PATCH-FIX-OPENSUSE install README.openSUSE and sbclrc.sample
Patch3:         sbcl-1.1.2-install.patch
# PATCH-FIX-OPENSUSE  sbcl-1.1.4-personality.patch based on fedora author unknown --fix access to proc in chroot env
Patch4:         sbcl-1.1.13-personality.patch
Patch5:         sbcl-disable-frlock-test.patch
# PATCH-FIX-UPSTREAM add missing cast
Patch6:         sbcl-cast.patch
# PATCH-FIX-OPENSUSE  disable localport bsd sockets tests broken in kvm builds for some
Patch7:         disable-localport-bsd-sockets-test.patch
#PATCH-FIX-UPSTREAM backported from git
Patch8:          0002-Fix-array-bound-checking-with-negative-indexes-on-AR.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Steel Bank Common Lisp (SBCL) is a high performance Common Lisp
compiler. It is open source / free software, with a permissive license.
In addition to the compiler and runtime system for ANSI Common Lisp, it
provides an interactive environment including a debugger, a statistical
profiler, a code coverage tool, and many other extensions.

%setup -q
%patch0 -p1 -b optflags
%patch1 -p1 -b docpatch
%patch3 -p1 -b install
%patch4 -p1 -b personality
%patch5 -p1 -b frlock
%patch6 -p1 -b cast

%if 0%{suse_version} > 1310
%patch7 -p1 -b sockets

%ifarch %arm
%patch8 -p1 -b arm

cp %{S:1} .
cp %{S:2} .
cp %{S:3} .

sed -i -e "s|\"%version\"|\"%version-%release-%_vendor\"|" version.lisp-expr

%if %{with bootstrap}
%_buildshell --xc-host='clisp -q -norc' --prefix=%{_prefix} 
%_buildshell --xc-host="sbcl --disable-debugger --no-sysinit --no-userinit"  --prefix=%{_prefix}
cd doc/manual && make

INSTALL_ROOT=%{buildroot}/%{_prefix} %_buildshell
if test %{_docdir} != %{_prefix}/share/doc ;then
    mkdir -p %{buildroot}/%{_docdir}
    mv %{buildroot}/%{_prefix}/share/doc/sbcl %{buildroot}/%{_docdir}/
## Unpackaged files
rm -f  %{buildroot}%{_infodir}/dir
# CVS crud
find %{buildroot} -name CVS -type d | xargs rm -rf
find %{buildroot} -name .cvsignore | xargs rm -f
find %{buildroot} -name .gitignore | xargs rm -f
# remove the a.out files
find %{buildroot} -name a\.out | xargs rm -f
# 'test-passed' files from %%check
find %{buildroot} -name 'test-passed' | xargs rm -vf
find %{buildroot} -name 'test-output' -type d | xargs rm -rf

# remove dangling texinfo files
find %{buildroot} -name *\.texinfo | xargs rm -f
# remove Makefiles
find %{buildroot} -name Makefile | xargs rm -f

rm -rf %{buildroot}

# How to make that info stuff portable?
%if 0%{?install_info:1} > 0

%install_info --info-dir=%{_infodir} %{_infodir}/*
%install_info --info-dir=%{_infodir} %{_infodir}/*

%install_info_delete --info-dir=%{_infodir} %{_infodir}/*
%install_info_delete --info-dir=%{_infodir} %{_infodir}/*

%doc %{_docdir}/%{name}
%doc %{_mandir}/man1/sbcl.1*
%doc %{_infodir}/*
%doc %{_infodir}/*
%dir %{_prefix}/lib/%{name}

openSUSE Build Service is sponsored by