%define pkg_name    sbcl
%define pkg_version 1.4.14
%define pkg_release 1%{?_dist_release}

%define sbcl 1

Summary: Steel Bank Common Lisp
Name:    %{pkg_name}
Version: %{pkg_version}
Release: %{pkg_release}

License: A mixture of BSD-style and public domain
Group:   Development/Languages
URL:     http://www.sbcl.org/
SOURCE:  %{name}-%{version}-source.tar.bz2

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

%if !%{sbcl}
BuildRequires: clisp
%else
BuildRequires: sbcl
%endif

BuildRequires: texinfo
BuildRequires: texlive-common
BuildRequires: texlive-collection-plaingeneric
BuildRequires: texlive-collection-fontsrecommended


Vendor: Project Vine
Distribution: Vine Linux
Packager: ara_t


%description
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.


%prep
%{__rm} -rf ${RPM_BUILD_ROOT}
%setup -q

%build
%if !%{sbcl}
sh make.sh "clisp" --prefix=%{_usr}
%else
sh make.sh --prefix=%{_usr}
%endif

cd doc/manual
%{__make} pdf html info

%install
export INSTALL_ROOT=${RPM_BUILD_ROOT}%{_prefix}
sh install.sh

%{__rm} ${RPM_BUILD_ROOT}%{_infodir}/dir
%{__mv} ${RPM_BUILD_ROOT}%{_docdir}/sbcl/*.html \
        ${RPM_BUILD_ROOT}%{_docdir}/sbcl/html

%{__mv} ${RPM_BUILD_ROOT}%{_docdir}/sbcl \
        ${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version}

%post
for doc in asdf sbcl; do
    file=%{_infodir}/${doc}.info.gz
    if [ -e ${file} ]; then
        %{_syssbindir}/install-info ${file} %{_infodir}/dir 2>/dev/null
    fi
done

%preun
if [ $1 = 0 ]; then
    for doc in asdf sbcl; do
        file=%{_infodir}/${doc}.info.gz
        if [ -e ${file} ]; then
            %{_syssbindir}/install-info --delete ${file} %{_infodir}/dir \
             2>/dev/null
        fi
    done
fi

%clean
%{__rm} -rf ${RPM_BUILD_ROOT}


%files
%defattr(-, root, root)
%{_bindir}/
/usr/lib/sbcl/
%{_docdir}/sbcl-%{version}
%{_infodir}/
%{_mandir}/man1/


%changelog
* Thu Dec 06 2018 Toshiaki Ara <ara_t@384.jp> 1.4.14-1
- new upstream release

* Fri Jun 01 2018 Toshiaki Ara <ara_t@384.jp> 1.4.8-1
- new upstream release

* Wed Nov 01 2017 Toshiaki Ara <ara_t@384.jp> 1.4.1-1
- new upstream release

* Sun Oct 01 2017 Toshiaki Ara <ara_t@384.jp> 1.4.0-1
- new upstream release

* Sat Sep 02 2017 Toshiaki Ara <ara_t@384.jp> 1.3.21-1
- new upstream release

* Tue Aug 01 2017 Toshiaki Ara <ara_t@384.jp> 1.3.20-1
- new upstream release

* Sat Jul 01 2017 Toshiaki Ara <ara_t@384.jp> 1.3.19-1
- new upstream release
- change to BuildRequires: texlive-collection-plaingeneric

* Sat Jun 03 2017 Toshiaki Ara <ara_t@384.jp> 1.3.18-1
- new upstream release

* Wed May 03 2017 Toshiaki Ara <ara_t@384.jp> 1.3.17-1
- new upstream release

* Tue Apr 11 2017 Toshiaki Ara <ara_t@384.jp> 1.3.16-1
- new upstream release

* Sat Jan 28 2017 Toshiaki Ara <ara_t@384.jp> 1.3.14-1
- new upstream release

* Sat Dec 31 2016 Toshiaki Ara <ara_t@384.jp> 1.3.13-1
- new upstream release

* Wed Nov 30 2016 Toshiaki Ara <ara_t@384.jp> 1.3.12-1
- new upstream release

* Sun Nov 06 2016 Toshiaki Ara <ara_t@384.jp> 1.3.11-2
- change Group to Development/Languages

* Wed Nov 02 2016 Toshiaki Ara <ara_t@384.jp> 1.3.11-1
- update to 1.3.11

* Sun Oct 02 2016 Toshiaki Ara <ara_t@384.jp> 1.3.10-1
- update to 1.3.10

* Wed Aug 31 2016 Toshiaki Ara <ara_t@384.jp> 1.3.9-1
- update to 1.3.9

* Tue Aug 02 2016 Toshiaki Ara <ara_t@384.jp> 1.3.8-1
- update to 1.3.8

* Mon Jul 18 2016 Toshiaki Ara <ara_t@384.jp> 1.3.7-1
- update to 1.3.7

* Sun Jun 19 2016 Toshiaki Ara <ara_t@384.jp> 1.3.6-1
- update to 1.3.6
- make PDF files for VineSeed

* Sun Apr 17 2016 Toshiaki Ara <ara_t@384.jp> 1.3.4-1
- new package
