#
# spec file for package
#
# 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 http://bugs.opensuse.org/
#
Name: mit-scheme
Version: 9.2
Release: 0
License: GPL-2.0+
Summary: MIT implementation of the Scheme programming language
Url: http://www.gnu.org/software/mit-scheme
Group: Development/Languages/Scheme
Source: %{name}-%{version}.tar.gz
BuildRequires: libtool
BuildRequires: m4
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: libpq5
BuildRequires: libopenssl-devel
BuildRequires: ncurses-devel
BuildRequires: libX11-devel
BuildRequires: libXt-devel
BuildRequires: libltdl7
BuildRequires: mhash-devel
BuildRequires: libmcrypt-devel
BuildRequires: libgdbm4
BuildRequires: libdb-4_8-devel
BuildRequires: makeinfo
BuildRequires: gcc
BuildRequires: gdbm-devel
BuildRequires: zlib-devel
BuildRequires: glibc-devel
BuildRequires: pkg-config
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
MIT/GNU Scheme is an implementation othe Scheme programming language,
providing an interpreter, compiler, source-code debugger, integrated
Emacs-like editor, and a large runtime library. MIT/GNU Scheme is
best suited to programming large applications with a rapid development cycle.
%prep
%setup -q
%build
pushd src
etc/make-liarc.sh --prefix=/usr
popd
pushd doc
./configure --prefix=/usr
make
popd
%install
pushd src
%make_install
popd
pushd doc
%make_install
popd
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc changelog.txt
%{_bindir}/bchscheme
%{_bindir}/mit-scheme
%{_bindir}/mit-scheme-c
%{_bindir}/scheme
%{_libdir}/mit-scheme-c
%{_libdir}/mit-scheme
%{_infodir}/mit-scheme-doc-config.scm.gz
%{_infodir}/mit-scheme-ffi.info.gz
%{_infodir}/mit-scheme-imail.info.gz
%{_infodir}/mit-scheme-ref.info-1.gz
%{_infodir}/mit-scheme-ref.info-2.gz
%{_infodir}/mit-scheme-ref.info-3.gz
%{_infodir}/mit-scheme-ref.info-4.gz
%{_infodir}/mit-scheme-ref.info-5.gz
%{_infodir}/mit-scheme-ref.info.gz
%{_infodir}/mit-scheme-sos.info.gz
%{_infodir}/mit-scheme-user.info.gz
%{_mandir}/man1/scheme.1.gz
%changelog
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="3"
inherit multilib flag-o-matic #elisp-common
DESCRIPTION="GNU/MIT-Scheme"
HOMEPAGE="http://www.swiss.ai.mit.edu/projects/scheme/"
SRC_URI="http://ftp.gnu.org/gnu/mit-scheme/stable.pkg/${PV}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc" # emacs"
#SITEFILE="50mitscheme-gentoo.el"
RDEPEND="app-crypt/mhash
dev-db/postgresql-base
dev-libs/libmcrypt
dev-libs/openssl
sys-libs/gdbm
sys-libs/ncurses
x11-libs/libX11"
DEPEND="${RDEPEND}
doc? ( dev-texlive/texlive-texinfo )"
src_prepare() {
sed "s:@for:@+for:" -i \
Makefile || die "sed failed"
sed "s:make:make -j1:" -i \
src/etc/make-in-subdirs.sh || die "sed failed"
sed "s:CFLAGS=\"\${CFLAGS} -O3\":CFLAGS=\"${CFLAGS}\":" -i \
{src/lib/include,src/microcode}/configure{,.ac} || die "sed failed"
}
src_configure() {
if use doc; then
cd "${S}"/doc
econf
fi
}
src_compile() {
cd "${S}"/src
./etc/make-liarc.sh --prefix=/usr --exec-prefix=/usr --libdir=/usr/$(get_libdir) || die "making liar C failed"
if use doc ; then
cd "${S}"/doc
emake -j1 || die "emake doc failed"
fi
cd ..
# if use emacs ; then
# elisp-compile etc/*.el || die
# fi
}
src_install() {
cd "${S}"/src
emake DESTDIR="${D}" install || die "make install failed"
cd "${S}"/doc
doman scheme.1 || die "doman failed"
if use doc ; then
dohtml index.html || die "dhtml failed"
doinfo ref-manual/mit-scheme-ref.info* || die "doinfo failed"
dodoc ref-manual/mit-scheme-ref.{pdf,ps} || die "dodoc failed"
doinfo user-manual/mit-scheme-user.info || die "doinfo failed"
dodoc user-manual/mit-scheme-user.{pdf,ps} || die "dodoc failed"
doinfo sos/mit-scheme-sos.info || die "doinfo failed"
dodoc sos/mit-scheme-sos.{pdf,ps} || die "dodoc failed"
doinfo imail/mit-scheme-imail.info || die "doinfo failed"
dodoc imail/mit-scheme-imail.{pdf,ps} || die "dodoc failed"
cd ref-manual
docinto html/mit-scheme-ref
dohtml mit-scheme-ref/* || die "dhtml failed"
cd ../user-manual
docinto html/mit-scheme-user
dohtml mit-scheme-user/* || die "dhtml failed"
cd ../sos
docinto html/mit-scheme-sos
dohtml mit-scheme-sos/* || die "dhtml failed"
cd ../imail
docinto html/mit-scheme-imail
dohtml mit-scheme-imail/* || die "dhtml failed"
cd ../
fi
}
#pkg_postinst() {
# use emacs && elisp-site-regen
#}
#pkg_postrm() {
# use emacs && elisp-site-regen
#}