diff --git a/sbcl-install-clc.lisp b/sbcl-install-clc.lisp new file mode 100644 index 0000000..c75c3dc --- /dev/null +++ b/sbcl-install-clc.lisp @@ -0,0 +1,37 @@ +;;; -*- Mode: LISP; Package: CL-USER -*- +;;; +;;; Copyright (C) Peter Van Eynde 2001 and Kevin Rosenberg 2002-2003 +;;; +;;; License: LGPL v2 +;;; +(in-package "COMMON-LISP-USER") + +(handler-case + (load "/usr/share/common-lisp/source/common-lisp-controller/common-lisp-controller.lisp") + (error (e) + (format t "~%Error during load of common-lisp-controller.lisp: ~A~%" e) + (sb-unix:unix-exit 1))) + +(handler-case + (common-lisp-controller:init-common-lisp-controller-v4 "sbcl") + (error (e) + (format t "~%Error running init-common-lisp-controller-v4: ~A~%" e) + (sb-unix:unix-exit 1))) + +(when (probe-file #p"/etc/lisp.config") + (load #p"/etc/lisp.config")) + +(setf (logical-pathname-translations "SYS") + '(("SYS:**;*.*.*" + #P"/usr/share/sbcl-source/**/*.*"))) + +(set-dispatch-macro-character #\# #\! + (lambda (stream bang arg) + (declare (ignore bang arg)) + (read-line stream) + (values))) + +(ignore-errors + (format t "~%Saving to sbcl-new.core...") + (sb-ext:gc :full t) + (sb-ext:save-lisp-and-die "sbcl-new.core")) diff --git a/sbcl.rc b/sbcl.rc new file mode 100644 index 0000000..299d5f5 --- /dev/null +++ b/sbcl.rc @@ -0,0 +1,7 @@ +;;; -*- Lisp -*- +;;; this file gets installed as /etc/sbcl.rc and run on every +;;; invocation of sbcl + +(if (probe-file "/etc/lisp-config.lisp") + (load "/etc/lisp-config.lisp") + (format t "~%;;; Hey: there is no /etc/lisp-config.lisp file, please create one.")) diff --git a/sbcl.sh b/sbcl.sh new file mode 100755 index 0000000..6454003 --- /dev/null +++ b/sbcl.sh @@ -0,0 +1,67 @@ +#!/bin/sh + +if [ ! -f /usr/share/common-lisp/source/common-lisp-controller/common-lisp-controller.lisp ] ; then + cat < /dev/null + mv sbcl-new.core sbcl.core || (echo FAILED ; cp sbcl-dist.core sbcl.core ) ) + ;; + remove-clc) + echo $0 removing clc-enabled image + cp /usr/lib/sbcl/sbcl-dist.core /usr/lib/sbcl/sbcl.core + ;; + rebuild) + echo $0 rebuilding... + shift + echo rebuilding $1 + /usr/bin/sbcl --noinform --sysinit ${RCFILE} --userinit /dev/null \ + --disable-debugger \ + --eval \ +"(handler-case + (progn + (asdf:operate 'asdf:compile-op (quote $1)) + (sb-unix:unix-exit 0)) + (error (e) + (ignore-errors (format t \"~&Build error: ~A~%\" e)) + (finish-output) + (sb-unix:unix-exit 1)))" || build_error + ;; + remove) + echo $0 removing packages... + shift + while [ ! -z "$1" ] ; do +rm -rf "/var/cache/common-lisp-controller/*/sbcl/${1}" +shift + done + ;; + *) + echo $0 unkown command $1 + echo known commands: rebuild, remove, install-clc, and remove-clc + exit 1 + ;; +esac + +exit 0 diff --git a/sbcl.spec b/sbcl.spec index 770e648..6d5c6e7 100644 --- a/sbcl.spec +++ b/sbcl.spec @@ -13,7 +13,7 @@ Name: sbcl Summary: Steel Bank Common Lisp Version: 1.0.20 -Release: 1%{?dist} +Release: 2%{?dist} License: BSD Group: Development/Languages @@ -27,6 +27,9 @@ ExclusiveArch: i386 x86_64 sparc ExclusiveArch: i386 x86_64 ppc sparc %endif +BuildRequires: common-lisp-controller +Requires: common-lisp-controller + # Pre-generated html docs (not used) #Source1: http://downloads.sourceforge.net/sourceforge/sbcl/sbcl-%{version}-html.tar.bz2 Source2: customize-target-features.lisp @@ -71,6 +74,10 @@ BuildRequires: sbcl Source100: my_setarch.c +Source200: sbcl.sh +Source201: sbcl.rc +Source202: sbcl-install-clc.lisp + Patch1: sbcl-1.0.19-default-sbcl-home.patch Patch2: sbcl-0.9.5-personality.patch Patch3: sbcl-1.0.16-optflags.patch @@ -199,16 +206,22 @@ find %{buildroot} -name .cvsignore | xargs rm -f # 'test-passed' files from %%check find %{buildroot} -name 'test-passed' | xargs rm -vf +install -m 744 %{SOURCE200} %{buildroot}%{_libdir}/common-lisp/bin +install -m 644 %{SOURCE201} %{buildroot}%{_sysconfdir}/sbcl.rc +install -m 644 %{SOURCE202} %{buildroot}%{_libdir}/sbcl/install-clc.lisp +cp %{buildroot}%{_libdir}/sbcl/sbcl.core %{buildroot}%{_libdir}/sbcl/sbcl-dist.core %if "x%{?min_bootstrap}" == "x%{nil}" %post /sbin/install-info %{_infodir}/sbcl.info %{_infodir}/dir ||: /sbin/install-info %{_infodir}/asdf.info %{_infodir}/dir ||: +/usr/sbin/register-common-lisp-implementation sbcl > /dev/null 2>&1 ||: %preun if [ $1 -eq 0 ]; then /sbin/install-info --delete %{_infodir}/sbcl.info %{_infodir}/dir ||: /sbin/install-info --delete %{_infodir}/asdf.info %{_infodir}/dir ||: + /usr/sbin/unregister-common-lisp-implementation sbcl > /dev/null 2>&1 ||: fi %else %pre @@ -229,6 +242,8 @@ fi %doc doc/manual/sbcl %doc doc/manual/asdf %{_infodir}/* +%{_libdir}/common-lisp/bin/* +%{_sysconfdir}/* %endif @@ -237,6 +252,9 @@ rm -rf %{buildroot} %changelog +* Sun Sep 21 2008 Anthony Green - 1.0.20-2 +- Add common-lisp-controller bits. + * Tue Sep 02 2008 Rex Dieter - 1.0.20-1 - sbcl-1.0.20