e6a2505
# -fstack-protector leads to segfaults because GCL uses its own conflicting
e6a2505
# stack protection scheme.
e6a2505
%define __global_cflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
e6a2505
e6a2505
# Prerelease of 2.6.8
e6a2505
%define alphatag 20080902cvs
e6a2505
e6a2505
# If the emacs-el package has installed a pkgconfig file, use that to determine
e6a2505
# install locations and Emacs version at build time, otherwise set defaults.
e6a2505
%if %($(pkg-config emacs) ; echo $?)
e6a2505
%define emacs_version 22.2
e6a2505
%define emacs_lispdir %{_datadir}/emacs/site-lisp
e6a2505
%else
e6a2505
%define emacs_version %(pkg-config emacs --modversion)
e6a2505
%define emacs_lispdir %(pkg-config emacs --variable sitepkglispdir)
e6a2505
%endif
e6a2505
e6a2505
# If the xemacs-devel package has installed a pkgconfig file, use that to
e6a2505
# determine install locations and Emacs version at build time, otherwise set
e6a2505
# defaults.
e6a2505
%if %($(pkg-config xemacs) ; echo $?)
e6a2505
%define xemacs_version 21.5
e6a2505
%define xemacs_lispdir %{_datadir}/xemacs/site-packages/lisp
e6a2505
%else
e6a2505
%define xemacs_version %(pkg-config xemacs --modversion)
e6a2505
%define xemacs_lispdir %(pkg-config xemacs --variable sitepkglispdir)
e6a2505
%endif
e6a2505
48b950b
Name:           gcl
e6a2505
Version:        2.6.8
da98b75
Release:        0.1.%{alphatag}.2%{?dist}
48b950b
Summary:        GNU Common Lisp
48b950b
48b950b
Group:          Development/Languages
9b66ea7
License:        GPL+ and LGPLv2+
e6a2505
URL:            http://www.gnu.org/software/gcl/
e6a2505
# The source for this package was pulled from upstream's CVS repository.  Use
e6a2505
# the following commands to generate the tarball:
e6a2505
#   cvs -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/gcl export \
e6a2505
#     -r Version_2_6_8pre -D 2008-09-02 -d gcl-2.6.8 gcl
e6a2505
#   tar -cjvf gcl-2.6.8.tar.bz2 gcl-2.6.8
e6a2505
Source0:        gcl-%{version}.tar.bz2
e6a2505
Source1:        gcl.el
da98b75
# This is some info files that are needed for the DESCRIBE function to do
da98b75
# something useful.  These files are present in CVS HEAD (i.e., the upcoming
da98b75
# 2.7.0 release), but are missing in the 2.6 branch.
da98b75
Source2:        gcl-2.6.8-info.tar.bz2
e6a2505
# This patch was last sent upstream on 29 Dec 2008.  It makes GCL use the
e6a2505
# sigprocmask API instead of the deprecated sigblock API.
e6a2505
Patch0:         gcl-2.6.8-sigprocmask-linux.patch
e6a2505
# This patch was last sent upstream on 29 Dec 2008.  It fixes a file descriptor
e6a2505
# leak, as well as combining 4 system calls into only 2 on an exec().
e6a2505
Patch1:         gcl-2.6.8-fd-leak.patch
e6a2505
# This patch was last sent upstream on 29 Dec 2008.  It updates one source file
e6a2505
# from LaTeX 2.09 to LaTeX 2e, thereby eliminating LaTeX warnings about running
e6a2505
# in compatibility mode.
e6a2505
Patch2:         gcl-2.6.8-latex.patch
e6a2505
# This patch was last sent upstream on 29 Dec 2008.  It eliminates a few minor
e6a2505
# texinfo warnings.
e6a2505
Patch3:         gcl-2.6.8-texinfo.patch
e6a2505
# This patch was last sent upstream on 29 Dec 2008.  It fixes a large number of
e6a2505
# compile- and run-time problems with the Emacs interface code.
e6a2505
Patch4:         gcl-2.6.8-elisp.patch
0826d6b
# This patch was last sent upstream on 17 Jan 2009.  It adds support for
e6a2505
# compiling and running on an SELinux-enabled host.
e6a2505
Patch5:         gcl-2.6.8-selinux.patch
e6a2505
# This patch was last sent upstream on 29 Dec 2008.  It uses the rename()
e6a2505
# system call when it is available to avoid spawning a subshell and suffering a
e6a2505
# context switch just to rename a file.
e6a2505
Patch6:         gcl-2.6.8-rename.patch
e6a2505
# This patch was last sent upstream on 29 Dec 2008.  It eliminates a
e6a2505
# compilation problem due to the fact that, at high optimization levels,
e6a2505
# getcwd() is an inline function.
e6a2505
Patch7:         gcl-2.6.8-getcwd.patch
e6a2505
# This patch was last sent upstream on 29 Dec 2008.  It fixes a potential
e6a2505
# buffer overflow when accessing files whose names start with a tilde (i.e.,
e6a2505
# user home directories).
e6a2505
Patch8:         gcl-2.6.8-loginname.patch
e6a2505
# This patch was last sent upstream on 29 Dec 2008.  It updates the autoconf
e6a2505
# and libtool files to newer versions.  By itself, this patch accomplishes
e6a2505
# little of interest.  However, some of the later patches change configure.in.
e6a2505
# Without this patch, autoconf appears to run successfully, but generates a
e6a2505
# configure script that contains invalid shell script syntax.
e6a2505
Patch9:         gcl-2.6.8-infrastructure.patch
e6a2505
# This patch was last sent upstream on 29 Dec 2008.  It simplifies the handling
e6a2505
# of alloca() detection in the configure script.
e6a2505
Patch10:        gcl-2.6.8-alloca.patch
e6a2505
# This patch was last sent upstream on 29 Dec 2008.  It rationalizes the
e6a2505
# handling of system extensions.  For example, on glibc-based systems, some
e6a2505
# functionality is available only when _GNU_SOURCE is defined.
e6a2505
Patch11:        gcl-2.6.8-extension.patch
e6a2505
# This patch was last sent upstream on 29 Dec 2008.  It fixes a compilation
e6a2505
# error on newer GCC systems due to an include inside a function.  This affects
e6a2505
# the "unrandomize" sbrk() functionality, hence the name of the patch.
e6a2505
Patch12:        gcl-2.6.8-unrandomize.patch
0826d6b
# This patch was last sent upstream on 17 Jan 2009.  It fixes compilation with
e6a2505
# a system BFD library that comes from a newer binutils distribution.  It also
e6a2505
# updates o/unexelf.c from Emacs 22.2, the last version of Emacs released under
e6a2505
# the GPL version 2.
e6a2505
Patch13:        gcl-2.6.8-bfd.patch
e6a2505
# This is a Fedora-specific patch.  Do not delete C files produced from D files
e6a2505
# so they can be pulled into the debuginfo package.
e6a2505
Patch14:        gcl-2.6.8-debuginfo.patch
48b950b
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
e6a2505
BuildRequires:  libSM-devel
e6a2505
BuildRequires:  libXext-devel
e6a2505
BuildRequires:  libXaw-devel
33d6a89
BuildRequires:  readline-devel
0da6bf5
BuildRequires:  binutils-devel
e6a2505
BuildRequires:  tk-devel
e6a2505
BuildRequires:  tcl-devel
33d6a89
BuildRequires:  gmp-devel
0ffee2e
BuildRequires:  texlive, texlive-latex
0da6bf5
BuildRequires:  texinfo
e6a2505
BuildRequires:  emacs, emacs-el
5290d91
BuildRequires:  xemacs, xemacs-devel, xemacs-packages-extra
e6a2505
BuildRequires:  selinux-policy
c6aff9f
Requires(post): /sbin/install-info, policycoreutils
c6aff9f
Requires(postun): /sbin/install-info, policycoreutils
48b950b
0826d6b
# GCL currently fails to build on PPC64 platforms.  See bugzilla #480519.
0826d6b
ExcludeArch: ppc64
48b950b
48b950b
%description
e6a2505
GCL is a Common Lisp currently compliant with the ANSI standard.  Lisp
48b950b
compilation produces native code through the intermediary of the
48b950b
system's C compiler, from which GCL derives efficient performance and
48b950b
facile portability. Currently uses TCL/Tk as GUI.
48b950b
48b950b
e6a2505
%package emacs
e6a2505
Group:          Development/Languages
e6a2505
Summary:        Emacs mode for interacting with GCL
e6a2505
Requires:       %{name} = %{version}-%{release}, emacs(bin) >= %{emacs_version}
e6a2505
e6a2505
%description emacs
e6a2505
Emacs mode for interacting with GCL
e6a2505
e6a2505
%package emacs-el
e6a2505
Group:          Development/Languages
e6a2505
Summary:        Source for Emacs mode for interacting with GCL
e6a2505
Requires:       %{name}-emacs = %{version}-%{release}
e6a2505
e6a2505
%description emacs-el
e6a2505
Source Elisp code for Emacs mode for interacting with GCL
e6a2505
e6a2505
e6a2505
%package xemacs
e6a2505
Group:          Development/Languages
e6a2505
Summary:        XEmacs mode for interacting with GCL
d2a3eed
Requires:       %{name} = %{version}-%{release}
d2a3eed
Requires:       xemacs(bin) >= %{xemacs_version}, xemacs-packages-extra
e6a2505
e6a2505
%description xemacs
e6a2505
XEmacs mode for interacting with GCL
e6a2505
e6a2505
%package xemacs-el
e6a2505
Group:          Development/Languages
e6a2505
Summary:        Source for XEmacs mode for interacting with GCL
e6a2505
Requires:       %{name}-xemacs = %{version}-%{release}
e6a2505
e6a2505
%description xemacs-el
e6a2505
Source Elisp code for XEmacs mode for interacting with GCL
e6a2505
e6a2505
48b950b
%prep
48b950b
%setup -q
da98b75
%setup -q -T -D -a 2
9a763fb
%patch0 -p1
2887538
%patch1 -p1
e6a2505
%patch2 -p1
e6a2505
%patch3 -p1
e6a2505
%patch4 -p1
e6a2505
%patch5 -p1
e6a2505
%patch6 -p1
e6a2505
%patch7 -p1
e6a2505
%patch8 -p1
e6a2505
%patch9 -p1
e6a2505
%patch10 -p1
e6a2505
%patch11 -p1
e6a2505
%patch12 -p1
e6a2505
%patch13 -p1
e6a2505
%patch14 -p1
e6a2505
e6a2505
# Don't let the configure script add compiler flags we don't want
e6a2505
sed -i -e 's/-fomit-frame-pointer//' -e 's/-O3/-O2/g' configure
e6a2505
e6a2505
# Fix a path in the launch script
e6a2505
sed -i -e 's|/usr/lib/tk|%{_datadir}/tk|' debian/gcl.sh
e6a2505
e6a2505
# The archive is so full of spurious executable bits that we just remove them
e6a2505
# all here, then add back the ones that should exist
e6a2505
find . -type f -perm /0111 | xargs chmod a-x
e6a2505
chmod a+x add-defs add-defs1 config.guess config.sub configure install.sh
e6a2505
chmod a+x ltconfig bin/info bin/info1 gcl-tk/gcltksrv.in gcl-tk/ngcltksrv
e6a2505
chmod a+x mp/gcclab o/egrep-def utils/replace xbin/*
48b950b
48b950b
48b950b
%build
e6a2505
%configure --enable-readline --enable-ansi --enable-dynsysgmp --enable-xgcl \
e6a2505
  --enable-tclconfig=%{_libdir} --enable-tkconfig=%{_libdir} \
e6a2505
  --disable-statsysbfd --enable-dynsysbfd
e6a2505
# FIXME: %%{?_smp_mflags} breaks the build
48b950b
make 
48b950b
da98b75
# Build gcl.info, which is needed for DESCRIBE to work properly
da98b75
make -C info gcl.info
da98b75
e6a2505
# dwdoc needs one extra LaTeX run to resolve references
e6a2505
cd xgcl-2
e6a2505
pdflatex dwdoc.tex
e6a2505
e6a2505
# Build the SELinux policy
e6a2505
cd ../selinux
e6a2505
make -f %{_datadir}/selinux/devel/Makefile
e6a2505
48b950b
48b950b
%install
48b950b
rm -rf $RPM_BUILD_ROOT
48b950b
make install DESTDIR=$RPM_BUILD_ROOT
e6a2505
e6a2505
# Get rid of the parts that we don't want
48b950b
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
48b950b
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc
48b950b
rm -rf $RPM_BUILD_ROOT%{_datadir}/emacs
9a763fb
rm -rf $RPM_BUILD_ROOT%{_prefix}/lib/gcl-*/info
e6a2505
e6a2505
# Install the man page
48b950b
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
e6a2505
cp -pf man/man1/* $RPM_BUILD_ROOT%{_mandir}/man1
e6a2505
e6a2505
# Install the HTML documentation
48b950b
mkdir -p html
e6a2505
cp -pfr info/gcl-si info/gcl-tk html
e6a2505
e6a2505
# Install and compile the Emacs code
e6a2505
mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir}/gcl
e6a2505
cp -pfr elisp/* $RPM_BUILD_ROOT%{emacs_lispdir}/gcl
e6a2505
rm -f $RPM_BUILD_ROOT%{emacs_lispdir}/gcl/makefile
e6a2505
rm -f $RPM_BUILD_ROOT%{emacs_lispdir}/gcl/readme
e6a2505
mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir}/site-start.d
e6a2505
sed -e "s|%LISP_DIR%|%{emacs_lispdir}|" %{SOURCE1} > $RPM_BUILD_ROOT%{emacs_lispdir}/site-start.d/gcl.el
e6a2505
pushd $RPM_BUILD_ROOT%{emacs_lispdir}/gcl
e6a2505
emacs -batch -no-site-file --eval "(push \"`pwd`\" load-path)" \
e6a2505
  -f batch-byte-compile *.el
e6a2505
popd
e6a2505
e6a2505
# Install and compile the XEmacs code
e6a2505
mkdir -p $RPM_BUILD_ROOT%{xemacs_lispdir}/gcl
e6a2505
cp -fr elisp/* $RPM_BUILD_ROOT%{xemacs_lispdir}/gcl
e6a2505
rm -f $RPM_BUILD_ROOT%{xemacs_lispdir}/gcl/makefile
e6a2505
rm -f $RPM_BUILD_ROOT%{xemacs_lispdir}/gcl/readme
e6a2505
mkdir -p $RPM_BUILD_ROOT%{xemacs_lispdir}/site-start.d
e6a2505
sed -e "s|%LISP_DIR%|%{xemacs_lispdir}|" %{SOURCE1} > $RPM_BUILD_ROOT%{xemacs_lispdir}/site-start.d/gcl.el
e6a2505
pushd $RPM_BUILD_ROOT%{xemacs_lispdir}/gcl
e6a2505
xemacs -batch -no-site-file -eval "(push \"`pwd`\" load-path)" \
e6a2505
  -f batch-byte-compile *.el
e6a2505
popd
e6a2505
e6a2505
# Save the policy file away for later installation
e6a2505
mkdir -p $RPM_BUILD_ROOT%{_datadir}/selinux/packages/gcl
e6a2505
cp -p selinux/gcl.pp $RPM_BUILD_ROOT%{_datadir}/selinux/packages/gcl
48b950b
d2a3eed
# The image has garbage strings containing RPM_BUILD_ROOT
d2a3eed
export QA_SKIP_BUILD_ROOT=1
d2a3eed
48b950b
48b950b
%clean
48b950b
rm -rf $RPM_BUILD_ROOT
e6a2505
rm -f /tmp/gazonk_* /tmp/gcl_*
48b950b
48b950b
48b950b
%post
da98b75
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir \
da98b75
  --entry="* gcl: (gcl).	GNU Common Lisp Manual." \
da98b75
  2>/dev/null || :
da98b75
/sbin/install-info %{_infodir}/%{name}-si.info %{_infodir}/dir \
da98b75
  --entry="* gcl-si: (gcl-si).	GNU Common Lisp System Internals." \
da98b75
  2>/dev/null || :
da98b75
/sbin/install-info %{_infodir}/%{name}-tk.info %{_infodir}/dir \
da98b75
  --entry="* gcl-tk: (gcl-tk).	GNU Common Lisp Tk Manual." \
da98b75
  2>/dev/null || :
e6a2505
/usr/sbin/semodule -i %{_datadir}/selinux/packages/gcl/gcl.pp || :
e6a2505
/sbin/fixfiles -R gcl restore || :
48b950b
48b950b
48b950b
%postun
48b950b
if [ $1 = 0 ]; then
e6a2505
    /sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir 2>/dev/null || :
c6aff9f
    /sbin/install-info --delete %{_infodir}/%{name}-si.info %{_infodir}/dir 2>/dev/null || :
c6aff9f
    /sbin/install-info --delete %{_infodir}/%{name}-tk.info %{_infodir}/dir 2>/dev/null || :
e6a2505
    /usr/sbin/semodule -r gcl || :
48b950b
fi
48b950b
48b950b
48b950b
%files
48b950b
%defattr(-,root,root,-)
e6a2505
%{_bindir}/gcl
9a763fb
%{_prefix}/lib/gcl*
48b950b
%{_infodir}/*
48b950b
%{_mandir}/man*/*
e6a2505
%{_datadir}/selinux/packages/gcl
e6a2505
%doc COPYING* readme readme.xgcl RELEASE* ChangeLog* faq doc
e6a2505
%doc gcl*.jpg gcl.ico gcl.png
48b950b
%doc --parent html
48b950b
e6a2505
%files emacs
e6a2505
%defattr(-,root,root,-)
e6a2505
%doc elisp/readme
e6a2505
%dir %{emacs_lispdir}/gcl
e6a2505
%{emacs_lispdir}/gcl/*.elc
e6a2505
%{emacs_lispdir}/site-start.d/*
e6a2505
e6a2505
%files emacs-el
e6a2505
%defattr(-,root,root,-)
e6a2505
%{emacs_lispdir}/gcl/*.el
e6a2505
e6a2505
%files xemacs
e6a2505
%defattr(-,root,root,-)
e6a2505
%doc elisp/readme
e6a2505
%dir %{xemacs_lispdir}/gcl
e6a2505
%{xemacs_lispdir}/gcl/*.elc
e6a2505
%{xemacs_lispdir}/site-start.d/*
e6a2505
e6a2505
%files xemacs-el
e6a2505
%defattr(-,root,root,-)
e6a2505
%{xemacs_lispdir}/gcl/*.el
e6a2505
e6a2505
48b950b
%changelog
da98b75
* Mon Jan 26 2009 Jerry James <loganjerry@gmail.com> - 2.6.8-0.1.20080902cvs.2
da98b75
- Add missing files required to build gcl.info, which is needed for the
da98b75
  DESCRIBE function to work properly.
da98b75
- Specify the info entries explicitly, else a mangled version is written.
da98b75
0826d6b
* Sat Jan 17 2009 Jerry James <loganjerry@gmail.com> - 2.6.8-0.1.20080902cvs.1
0826d6b
- ExcludeArch ppc64 for now until I can figure out why it doesn't build
0826d6b
e6a2505
* Fri Jan  9 2009 Jerry James <loganjerry@gmail.com> - 2.6.8-0.1.20080902cvs
e6a2505
- Update from CVS to fix many build problems
e6a2505
- Fix SELinux and BFD problems that blocked the build
e6a2505
- Add patches to address various build and runtime problems
e6a2505
- Drop old patches that are obsoleted by the update from CVS
e6a2505
- Split out emacs and xemacs subpackages
e6a2505
9b66ea7
* Mon Jul 21 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.6.7-19
9b66ea7
- fix license tag
9b66ea7
2567ff2
* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.6.7-18
2567ff2
- Autorebuild for GCC 4.3
2567ff2
b044d15
* Mon Jan 14 2008 Gerard Milmeister <gemi@bluewin.ch> - 2.6.7-17
b044d15
- exclude arch x86_64 for now
b044d15
8039f88
* Thu Jan 03 2008 Alex Lancaster <alexlan at fedoraproject.org> - 2.6.7-16
8039f88
- Rebuild for new Tcl (8.5)
8039f88
e32f63f
* Tue Aug 14 2007 Gerard Milmeister <gemi@bluewin.ch> - 2.6.7-15
e32f63f
- Fix post-install script path on x64_64
e32f63f
3712adc
* Wed Dec 27 2006 Gerard Milmeister <gemi@bluewin.ch> - 2.6.7-14
3712adc
- added req ncurses-devel
3712adc
0da6bf5
* Thu Dec 21 2006 Gerard Milmeister <gemi@bluewin.ch> - 2.6.7-13
0da6bf5
- Fix for compiling with readline library
0da6bf5
0bb07a1
* Mon Aug 28 2006 Gerard Milmeister <gemi@bluewin.ch> - 2.6.7-12
0bb07a1
- Rebuild for FE6
0bb07a1
c6aff9f
* Sat May  6 2006 Gerard Milmeister <gemi@bluewin.ch> - 2.6.7-11
c6aff9f
- fixed summary text (CLtL1 -> ANSI)
c6aff9f
- configure: readine -> readline
c6aff9f
c6aff9f
* Fri Apr 14 2006 Gerard Milmeister <gemi@bluewin.ch> - 2.6.7-10
c6aff9f
- added changes to SELinux policy
c6aff9f
33d6a89
* Wed Mar  8 2006 Gerard Milmeister <gemi@bluewin.ch> - 2.6.7-7
33d6a89
- Patch gcl-bash.patch for configure
33d6a89
4465c97
* Sat Feb 18 2006 Gerard Milmeister <gemi@bluewin.ch> - 2.6.7-6
4465c97
- Rebuild for Fedora Extras 5
4465c97
9a763fb
* Fri Sep  9 2005 Gerard Milmeister <gemi@bluewin.ch> - 2.6.7-1
9a763fb
- New Version 2.6.7
9a763fb
c9c474f
* Sun Apr 17 2005 Gerard Milmeister <gemi@bluewin.ch> - 2.6.6-2
c9c474f
- Added buildreq tetex and texinfo
c9c474f
48b950b
* Wed Apr  6 2005 Gerard Milmeister <gemi@bluewin.ch> - 2.6.6-1
48b950b
- New Version 2.6.6
48b950b
48b950b
* Fri Feb 18 2005 Gerard Milmeister <gemi@bluewin.ch> - 0:2.6.5-1
48b950b
- First Fedora release