(Sorry for cross-posting)
Hi there,
missing an "official" XEmacs RPM spec file , I wrote one based on Mandrake
and SuSE spec files. The aim was to have hassle-free, vendor-neutral
spec for XEmacs. I've tested it with 21.4.4 and packages of
2001-07-09. It builds xemacs without mule, xemacs-mule,
xemacs-gtk,xemacs-gtk-gnome, xemacs-el, xemacs-info, xemacs-extras
packages.
Two problems I had:
1) Makefile.in.in calls somewhere -l check-fetures with -batch but
without -vanilla. Building no-mule xemacs with some mule stuff in
.emacs doesn't work then.
2) I would gladly keep XEmacs info files separatly from other info
files at system. But they must be of course be available from XEmacs
info buffer. This can be achieved by modifing dir file in the usual
system info directory, so it shows to XEmacs info files. Or to put
XEmacs info file in separate directory(ies) and modify INFOPATH of
Info-directory-list. To my pity install-info doesn't let for any path
references. It just put entries to info files as they were in the
dir's directory!! Putting XEmacs info files into different directory
means that user has to modify INFOPATH or Info-directory-list. That
means that RPMs built this way are not directly usable after
installation. Any tips?
BTW: sample .Xdefaults is wrong about
! The following three are for Motif dialog boxes ...
Emacs*dialog*XmTextField*Background: WhiteSmoke
Emacs*dialog*XmText*Background: WhiteSmoke
Emacs*dialog*XmList*Background: WhiteSmoke
the right entry is:
Emacs*XmDialogShell*Background: WhiteSmoke
as one can also see later in sample .Xdefaults for text fonts.
8--------------cut here -------------------------->8
%define
version 21.4.4
%define rversion 21.4.4
%define mversion 21.4
%define sumodate 2001-07-09
Summary: An X Window System based version of GNU Emacs.
Name: xemacs
Version: %{version}
Release: 1
License: GPL
Group: Editors
Source0:
ftp://ftp.xemacs.org/pub/xemacs/xemacs-%{mversion}/xemacs-%{rversion}.tar...
Source1:
ftp://ftp.xemacs.org/pub/xemacs/packages/xemacs-mule-sumo-%{sumodate}.tar...
Source2:
ftp://ftp.xemacs.org/pub/xemacs/packages/xemacs-sumo-%{sumodate}.tar.bz2
Source5: site-start.el
Patch: xemacs-makefile.in.in.patch
Provides: xemacs-noX xemacs-static xemacs-X11
Obsoletes: xemacs-noX xemacs-static xemacs-X11
Url:
http://www.xemacs.org/
Buildroot: %{_tmppath}/xemacs-root
Requires: ctags
BuildRequires: compface libpng xdevel
%ifarch alpha
BuildConflicts: compat-Tru64
%endif
%description
XEmacs (and regular GNU Emacs, too) is a self-documenting, customizable,
extensible, real-time display editor. XEmacs is self-documenting because at any
time you can type in control-h to find out what your options are or to find out
what a command does. XEmacs is customizable because you can change the
definitions of XEmacs commands to anything you want. XEmacs is extensible
because you can write entirely new commands--programs in the Lisp language to
be run by Emacs' own Lisp interpreter. XEmacs includes a real-time display,
which means that the text being edited is visible on the screen and is updated
very frequently (usually after every character or pair of characters) as you
type.
To use XEmacs, you'll need to install the XEmacs binary. The xemacs package
includes the standard XEmacs binary that most people will use. The XEmacs
binary is dynamically linked, with both X11 and TTY (ncurses) support.
%package devel
Summary: header files for Xemacs
Group: Development/C
Requires: xemacs = %{version}
%description devel
Contains all the header files needed for xemacs development.
%package mule
Summary: The XEmacs binary with mule (MUlti-Lingual Emacs) support.
Group: Editors
Requires: xemacs = %{version}
%description mule
Xemacs-mule includes an XEmacs binary with support for
MUlti-Lingual Emacs and the Asian character set. Install xemacs-mule
(instead of xemacs) if you need to use Asian characters. Xemacs-mule is
compiled with X11 support only, so you won't be able to use it in a TTY
(ncurses) mode.
%package gtk
Summary: The XEmacs binary with GTK widgets.
Group: Editors
Requires: xemacs = %{version}
%description gtk
XEmacs (and regular GNU Emacs, too) is a self-documenting, customizable,
extensible, real-time display editor. XEmacs is self-documenting because at any
time you can type in control-h to find out what your options are or to find out
what a command does. XEmacs is customizable because you can change the
definitions of XEmacs commands to anything you want. XEmacs is extensible
because you can write entirely new commands--programs in the Lisp language to
be run by Emacs' own Lisp interpreter. XEmacs includes a real-time display,
which means that the text being edited is visible on the screen and is updated
very frequently (usually after every character or pair of characters) as you
type. This version used the GTK widgets.
%package gtk-gnome
Summary: The XEmacs binary with GTK widgets and the gnome interface.
Group: Editors
Requires: xemacs = %{version}
%description gtk-gnome
XEmacs (and regular GNU Emacs, too) is a self-documenting, customizable,
extensible, real-time display editor. XEmacs is self-documenting because at any
time you can type in control-h to find out what your options are or to find out
what a command does. XEmacs is customizable because you can change the
definitions of XEmacs commands to anything you want. XEmacs is extensible
because you can write entirely new commands--programs in the Lisp language to
be run by Emacs' own Lisp interpreter. XEmacs includes a real-time display,
which means that the text being edited is visible on the screen and is updated
very frequently (usually after every character or pair of characters) as you
type. This version used the GTK widgets and the gnome interface.
%package el
Summary: The .el source files for XEmacs.
Group: Editors
Requires: xemacs = %{version}
%description el
Xemacs-el is not necessary to run XEmacs. You'll only need to install
it if you're planning on incorporating some Lisp programming into your
XEmacs experience.
%package info
Summary: Information files for XEmacs.
Group: Editors
Requires: xemacs = %{version}
%description info
Install this package if you want the information files that are
distributed with the XEmacs text editor.
%package extras
Summary: Files that XEmacs has in common with GNU Emacs.
Group: Editors
Requires: xemacs = %{version}
Conflicts: ctags
%description extras
Xemacs-extras includes files which are used by both GNU Emacs
and XEmacs. If you don't have GNU Emacs installed, be sure to also
install this package when you install the XEmacs text editor.
%prep
%setup
%patch
%build
# standard: X11 and console support
rm -rf building && mkdir -p building && cd building
VERSION=%{version}
SHARE=/usr/share
# LIB=%{_libdir}
# SYS=${RPM_ARCH}-suse-linux/
%ifarch i386
LOOP='-m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2'
%endif
INFO=%{_infodir}
#LIBEXEC=${LIB}/xemacs/${VERSION}
#%define _archdir ${LIBEXEC}/${SYS}/
# ARCH=%{_archdir}
# DATA=${SHARE}
#%define _lispdir ${DATA}/xemacs/${VERSION}/lisp/
# LISP=%{lispdir}
#%define _etcdir ${DATA}/xemacs/${VERSION}/etc/
# ETC=%{_etcdir}
#%define _lockdir /var/state/xemacs/lock/
# LOCK=%{_lockdir}
%define _statedir /var/state/
%define _lockdir %_statedir/xemacs/lock
STATE=%{_statedir}
MAN=%{_mandir}/man1/
CFLAGS="${RPM_OPT_FLAGS}"" -Wall -Wno-switch -pipe ${LOOP}"
LDFLAGS="-s"
export CFLAGS LDFLAGS
#
#
PREFIX="--prefix=/usr \
--statedir=${STATE} \
--infodir=${INFO} \
--mandir=${MAN} \
"
# --lockdir=${LOCK} \
# --exec-prefix=/usr \
# --bindir=/usr/bin \
# --datadir=${SHARE} \
# --archlibdir=${ARCH} \
# --docdir=${ARCH} \
# --lispdir=${LISP} \
# --pkgdir=${LISP} \
# --etcdir=${ETC} \
#
# --with-sound=both requires NAS (Network Audio System)
#
# --with-socks and --with-term needs some nonexisting libs
# (maybe included in {g}libc)
# --with-tooltalk needs tt_c.h
# --with-canna needs X11 canna support
# --with-wnn needs X11 wnn support
#
# We need site-lisp because the long time (x)emacs users
# expect something like this.
#
%ifnarch s390
SPECIAL="--with-sound=native \
--with-tty=yes \
--with-site-lisp \
"
# --with-gpm \
%else
SPECIAL="--with-tty=yes \
--with-site-lisp \
"
%endif
#
# Graphics and X window system
# * --with-cde needs Motif
#
X11="--with-xpm \
--with-gif \
--with-tiff \
--with-jpeg \
--with-png \
--with-x \
--with-menubars=lucid \
--with-scrollbars=lucid \
--with-athena=3d \
--with-dialogs=yes \
"
#
# Mail
# * --mail-locking should be self detected
# * --with-xface requires compface library
# --with-ldap brings configure to not detect any function after cbrt?!
MAIL="--with-clash-detection \
--with-pop \
"
#
# Mule
#
# --with-xfs Compile with XFontSet support for bilingual menubar.
# Can't use this option with --with-xim=motif or xlib.
# And should have --with-menubars=lucid.
#
# (this is necessary to get German, French, Japanese
# and Romanian texts in the menus. It DOES work with
# --with-xim=xlib, the above comment from './configure --help'
# seems to be incorrect in that respect.)
#
MULE="--with-mule \
--with-xim=xlib \
--with-xfs \
"
#
# Compilation
# * --with-system-malloc only for libc.5.4.3x and higher
#
COMP="--with-gcc \
--rel-alloc \
--debug=no \
--error-checking=none \
"
# --cflags=\"${CFLAGS}\" \
# --ldflags=\"${LDFLAGS}\" \
{
rm -rf $RPM_ARCH-linux
mkdir $RPM_ARCH-linux
cd $RPM_ARCH-linux
../../configure $COMP $PREFIX $SPECIAL $X11 $MULE $MAIL --without-mule
cd ..
}
{
rm -rf $RPM_ARCH-linux-mule
mkdir $RPM_ARCH-linux-mule
cd $RPM_ARCH-linux-mule
../../configure $COMP $PREFIX $SPECIAL $X11 $MULE $MAIL
cd ..
}
{
rm -rf $RPM_ARCH-linux-gtk
mkdir $RPM_ARCH-linux-gtk
cd $RPM_ARCH-linux-gtk
../../configure $COMP $PREFIX $SPECIAL $X11 $MULE $MAIL \
--without-mule \
--with-gtk \
--with-dialogs=gtk \
--with-widgets=gtk
cd ..
}
{
rm -rf $RPM_ARCH-linux-gtk-gnome
mkdir $RPM_ARCH-linux-gtk-gnome
cd $RPM_ARCH-linux-gtk-gnome
../../configure $COMP $PREFIX $SPECIAL $X11 $MULE $MAIL \
--without-mule \
--with-gtk \
--with-gnome \
--with-dialogs=gtk \
--with-widgets=gtk
cd ..
}
{
pushd $RPM_ARCH-linux && make && popd
pushd $RPM_ARCH-linux-mule && make && popd
pushd $RPM_ARCH-linux-gtk && make && popd
pushd $RPM_ARCH-linux-gtk-gnome && make && popd
}
%install
rm -rf $RPM_BUILD_ROOT
pushd building/$RPM_ARCH-linux
make prefix=$RPM_BUILD_ROOT/usr infodir=$RPM_BUILD_ROOT/%{_infodir} \
lockdir=$RPM_BUILD_ROOT/%{_lockdir} statedir=$RPM_BUILD_ROOT/%{_statedir} \
mandir=$RPM_BUILD_ROOT/%{_mandir}/man1 install
#make DESTDIR=%{buildroot} datadir=$RPM_BUILD_ROOT/%{_libdir} \
# infodir=$RPM_BUILD_ROOT/%{_infodir}/xemacs mandir=$RPM_BUILD_ROOT/%{_mandir}/man1 \
# lockdir=$RPM_BUILD_ROOT/%{_lockdir} bindir=$RPM_BUILD_ROOT%{_bindir} \
# lispdir=$RPM_BUILD_ROOT/%{_lispdir} archlibdir=$RPM_BUILD_ROOT/%{_archdir} \
# docdir=$RPM_BUILD_ROOT/%{_archdir} pgkdir=$RPM_BUILD_ROOT/%{_lispdir} \
# statedir=$RPM_BUILD_ROOT/%{_statedir} etcdir=$RPM_BUILD_ROOT/%{_etcdir} install
#
popd
install -m 755 building/$RPM_ARCH-linux-mule/src/xemacs
$RPM_BUILD_ROOT%{_bindir}/xemacs-mule
install -m 755 building/$RPM_ARCH-linux-gtk/src/xemacs
$RPM_BUILD_ROOT%{_bindir}/xemacs-gtk
install -m 755 building/$RPM_ARCH-linux-gtk-gnome/src/xemacs
$RPM_BUILD_ROOT%{_bindir}/xemacs-gtk-gnome
bzcat %{SOURCE1} | tar -xf - -C $RPM_BUILD_ROOT/%{_libdir}/xemacs
bzcat %{SOURCE2} | tar -xf - -C $RPM_BUILD_ROOT/%{_libdir}/xemacs
# move info files manually : standard info
install -d $RPM_BUILD_ROOT/%{_infodir}/xemacs/
mv $RPM_BUILD_ROOT%{_libdir}/xemacs/xemacs-packages/info/*
$RPM_BUILD_ROOT/%{_infodir}/xemacs/
rmdir $RPM_BUILD_ROOT%{_libdir}/xemacs/xemacs-packages/info/
# .. and mule info
#mkdir $RPM_BUILD_ROOT/%{_infodir}/xemacs/mule
mv $RPM_BUILD_ROOT%{_libdir}/xemacs/mule-packages/info/*
$RPM_BUILD_ROOT/%{_infodir}/xemacs/
rmdir $RPM_BUILD_ROOT%{_libdir}/xemacs/mule-packages/info/
# replace local perl with standard perl
find $RPM_BUILD_ROOT%{_libdir}/xemacs/xemacs-packages -name \*.pl -exec \
perl -pi -e "s|/usr/local/bin/perl5|%{_bindir}/perl|g; \
s|/usr/local/bin/perl|%{_bindir}/perl|g;" {} \;
install -m644 %{SOURCE5} $RPM_BUILD_ROOT%{_libdir}/xemacs/site-lisp/site-start.el
install -d $RPM_BUILD_ROOT/%{_lockdir}
# Build file listings. (and make movemail setgid mail on RHL)
DIR="$RPM_BUILD_ROOT%{_libdir}/xemacs-%{version}"
DIR2="$RPM_BUILD_ROOT%{_libdir}/xemacs"
PACKAGES=$RPM_BUILD_ROOT%{_libdir}/xemacs/xemacs-packages
MULEDIR=$RPM_BUILD_ROOT%{_libdir}/xemacs/mule-packages
INFO="*.info*"
EL="*.el"
DEVEL="*.h"
# build file lists
find $DIR $DIR2 -type d | sed -e "s#^$RPM_BUILD_ROOT#%dir #g" > rpm-files
find $DIR $PACKAGES -not -name $INFO -not -name $DEVEL -not -name $EL -type f |
sed -e "
s#^$RPM_BUILD_ROOT\(.*movemail\)#%attr(2755, root, mail) \1#g
s#^$RPM_BUILD_ROOT##g
" >> rpm-files
find $DIR $PACKAGES -name $DEVEL -type f |
sed -e "s#^$RPM_BUILD_ROOT##g" > rpm-devel-files
find $DIR $PACKAGES $MULEDIR -name $EL -type f |
sed -e "s#^$RPM_BUILD_ROOT##g" >> rpm-el-files
find $MULEDIR -not -name $EL -not -name $DEVEL -type f |
sed -e "s#^$RPM_BUILD_ROOT#%attr(-, root, root) #g" > rpm-mule-files
%post info
for f in %{_infodir}/xemacs/*.info*; do
/sbin/install-info $f %{_infodir}/xemacs/dir
done
%preun info
if [ "$1" = 0 ]; then
for f in %{_infodir}/xemacs/*.info*; do
/sbin/install-info --delete $f %{_infodir}/xemacs/dir
done
%files -f rpm-files
%defattr(-,root, root)
%doc BUGS CHANGES-release ChangeLog README README.packages PROBLEMS COPYING
%config(noreplace) %{_libdir}/xemacs/site-lisp/site-start.el
#%{_libdir}/xemacs
#%{_libdir}/xemacs-%{version}
%dir %{_lockdir}
%dir %{_libdir}/xemacs/site-lisp
%{_bindir}/xemacs
%{_bindir}/xemacs-%{version}
%{_bindir}/gnuclient
%{_bindir}/gnuattach
%{_bindir}/ellcc
%{_bindir}/gnudoit
%{_mandir}/man1/xemacs.1*
%{_mandir}/man1/gnuserv.1*
%{_mandir}/man1/gnuclient.1*
%{_mandir}/man1/gnuattach.1*
%{_mandir}/man1/gnudoit.1*
%files devel -f rpm-devel-files
%defattr(-,root, root)
%files mule -f rpm-mule-files
%defattr(-,root, root)
%{_bindir}/xemacs-mule
%files gtk
%defattr(-,root, root)
%{_bindir}/xemacs-gtk
%files gtk-gnome
%defattr(-,root, root)
%{_bindir}/xemacs-gtk-gnome
%files el -f rpm-el-files
%defattr(-,root, root)
%files info
%defattr(-,root, root)
%{_infodir}/xemacs
%files extras
%defattr(-,root, root)
%{_bindir}/b2m
%{_bindir}/etags
%{_bindir}/ctags
%{_bindir}/ootags
%{_bindir}/rcs-checkin
%{_mandir}/man1/etags.1*
%{_mandir}/man1/ctags.1*
%clean
rm -rf $RPM_BUILD_ROOT
%changelog
* Sat Sep 15 2001 <malakhanov(a)gmx.de> 21.4.4
- combine & clean up SuSE and Mandrake spec for hassle-free
installation