auto-import changelog data from emacs-21.3-9.src.rpm

Sat Jan 24 2004 Jens Petersen <petersen@redhat.com> - 21.3-9
- base emacs package now only contains emacs binary built with X support
- bring back emacs-nox subpackage (emacs built without X support) (#113001)
    [suggested by Frank Kruchio]
- all the common files required by emacs and emacs-nox are now in
    emacs-common
- emacs no longer obsoletes emacs-nox
- update php-mode.el to 1.0.5
- add missing rfc1345.el leim input method
- update po-compat.el to version in gettext-0.13.1
- update base package summary
- add url for python-mode.el and php-mode.el
- gctags is now a symlink to ctags.emacs
Wed Jan 14 2004 Jens Petersen <petersen@redhat.com> - 21.3-8
- comment out setting transient-mark-mode in skel .emacs (#102441,#90193)
    [reported by mal@gromco.com, Jonathan Kamens]
- improve lang-coding-systems-init.el to set-language-environment for CJK
    utf-8 locale too and use utf-8 for default-coding-systems and
    terminal-coding-system (#111172) [Yoshinori Kuniga]
- update rpm-spec-mode.el to newer one in xemacs package cvs (#105888)
    [Dams]
- rename etags to etags.emacs and make etags a symlink to it at install
    time if it doesn't exist (#92256) [marc_soft@merlins.org]
- apply editfns.c-Fformat-multibyte-davej.patch to fix multibyte code typo
    in Fformat [patch from Dave Jones]
- add runtime requirements for XFree86-libs, image libraries, ncurses and
    zlib
- improve -el and -leim package summaries
- no longer configure build with redundant --with-gcc
Tue Nov 25 2003 Jens Petersen <petersen@redhat.com>
- buildrequire autoconf213 (#110741) [reported by mvd@mylinux.com.ua]
This commit is contained in:
cvsdist 2004-09-09 04:36:23 +00:00
parent 1a2924eb42
commit 45b61eda1d
4 changed files with 348 additions and 155 deletions

View File

@ -7,4 +7,4 @@
(global-font-lock-mode t) (global-font-lock-mode t)
;; enable visual feedback on selections ;; enable visual feedback on selections
(setq transient-mark-mode t) ;(setq transient-mark-mode t)

View File

@ -2,10 +2,10 @@
%define muleucs_ver current %define muleucs_ver current
Summary: The libraries needed to run the GNU Emacs text editor. Summary: GNU Emacs text editor
Name: emacs Name: emacs
Version: 21.3 Version: 21.3
Release: 7 Release: 9
License: GPL License: GPL
URL: http://www.gnu.org/software/emacs/ URL: http://www.gnu.org/software/emacs/
Group: Applications/Editors Group: Applications/Editors
@ -15,12 +15,11 @@ Source3: emacs.desktop
Source4: emacs.png Source4: emacs.png
Source5: dotemacs.el Source5: dotemacs.el
Source6: site-start.el Source6: site-start.el
Source7: python-mode.el Source7: http://www.python.org/emacs/python-mode/python-mode.el
Source8: http://www.tihlde.org/~stigb/rpm-spec-mode.el Source8: http://cvs.xemacs.org/viewcvs.cgi/XEmacs/packages/xemacs-packages/prog-modes/rpm-spec-mode.el
#Source9: emacs-asian-0.2.tar.bz2
Source10: ftp://ftp.gnu.org/gnu/emacs/elisp-manual-21-2.8.tar.bz2 Source10: ftp://ftp.gnu.org/gnu/emacs/elisp-manual-21-2.8.tar.bz2
# 1.0.2 - http://prdownloads.sourceforge.net/php-mode/php-mode-102.el # 1.0.2 - http://prdownloads.sourceforge.net/php-mode/php-mode-102.el
Source11: php-mode.el Source11: http://prdownloads.sourceforge.net/php-mode/php-mode.el
Source12: php-mode-init.el Source12: php-mode-init.el
Source13: ssl.el Source13: ssl.el
Source16: python-mode-init.el Source16: python-mode-init.el
@ -33,7 +32,7 @@ Source23: po-mode-auto-replace-date-71264.patch
Source24: ftp://ftp.m17n.org/pub/mule/Mule-UCS/test/Mule-UCS-%{muleucs_ver}.tar.gz Source24: ftp://ftp.m17n.org/pub/mule/Mule-UCS/test/Mule-UCS-%{muleucs_ver}.tar.gz
Source25: lang-coding-systems-init.el Source25: lang-coding-systems-init.el
Source26: default.el Source26: default.el
#Patch1: emacs-21.2-pop.patch Source27: rfc1345.el
Patch2: emacs-21.2-s390.patch Patch2: emacs-21.2-s390.patch
Patch3: emacs-21.2-x86_64.patch Patch3: emacs-21.2-x86_64.patch
Patch4: emacs-21.2-sticky-bit-80049.patch Patch4: emacs-21.2-sticky-bit-80049.patch
@ -42,13 +41,18 @@ Patch6: emacs-21.2-menubar-games.patch
Patch7: emacs-21.2-alloc-blockinput-83600.patch Patch7: emacs-21.2-alloc-blockinput-83600.patch
Patch8: browse-url-htmlview-84262.patch Patch8: browse-url-htmlview-84262.patch
Patch9: emacs-21.3-ppc64.patch Patch9: emacs-21.3-ppc64.patch
Patch10: editfns.c-Fformat-multibyte-davej.patch
Buildroot: %{_tmppath}/%{name}-%{version}-root Buildroot: %{_tmppath}/%{name}-%{version}-root
Prereq: /sbin/install-info, dev Prereq: /sbin/install-info, dev
BuildRequires: glibc-devel, gcc, XFree86-devel, bzip2, ncurses-devel, zlib-devel, libpng-devel, libjpeg-devel, libungif-devel, libtiff-devel BuildRequires: glibc-devel, gcc, bzip2, ncurses-devel, zlib-devel, autoconf213
Buildrequires: XFree86-devel, Xaw3d-devel, libpng-devel, libjpeg-devel, libungif-devel, libtiff-devel
Requires: ncurses, zlib
Requires: XFree86-libs, Xaw3d, libpng, libjpeg, libungif, libtiff
%ifarch %{ix86} %ifarch %{ix86}
BuildRequires: setarch BuildRequires: setarch
%endif %endif
Obsoletes: emacs-nox, emacs-X11 Requires: emacs-common = %{version}-%{release}
Obsoletes: emacs-X11
Conflicts: gettext < 0.10.40 Conflicts: gettext < 0.10.40
%description %description
@ -57,10 +61,39 @@ editor. Emacs contains special code editing features, a scripting
language (elisp), and the capability to read mail, news, and more language (elisp), and the capability to read mail, news, and more
without leaving the editor. without leaving the editor.
%package el This package provides an emacs binary with support for X windows.
Summary: The sources for elisp programs included with Emacs.
%package nox
Summary: GNU Emacs text editor without X support
Group: Applications/Editors Group: Applications/Editors
Requires: emacs Requires: ncurses, zlib
Requires: emacs-common = %{version}-%{release}
%description nox
Emacs is a powerful, customizable, self-documenting, modeless text
editor. Emacs contains special code editing features, a scripting
language (elisp), and the capability to read mail, news, and more
without leaving the editor.
This package provides an emacs binary with no X windows support for running
on a terminal.
%package common
Summary: Emacs common files
Group: Applications/Editors
%description common
Emacs is a powerful, customizable, self-documenting, modeless text
editor. Emacs contains special code editing features, a scripting
language (elisp), and the capability to read mail, news, and more
without leaving the editor.
This package contains all the common files needed by emacs or emacs-nox.
%package el
Summary: Emacs Lisp source files included with Emacs.
Group: Applications/Editors
Requires: emacs = %{version}
%description el %description el
Emacs-el contains the emacs-elisp sources for many of the elisp Emacs-el contains the emacs-elisp sources for many of the elisp
@ -70,9 +103,9 @@ You need to install emacs-el only if you intend to modify any of the
Emacs packages or see some elisp examples. Emacs packages or see some elisp examples.
%package leim %package leim
Summary: Emacs Lisp code for input methods for international characters. Summary: Emacs Lisp files for input methods for international characters.
Group: Applications/Editors Group: Applications/Editors
Requires: emacs Requires: emacs = %{version}
%description leim %description leim
The emacs-leim package contains Emacs Lisp code for input methods for The emacs-leim package contains Emacs Lisp code for input methods for
@ -92,6 +125,7 @@ sets are included in this package.
# block input in `allocate_vectorlike' (alloc.c) # block input in `allocate_vectorlike' (alloc.c)
%patch7 -p1 -b .block %patch7 -p1 -b .block
%patch9 -p1 -b .ppc64 %patch9 -p1 -b .ppc64
%patch10 -p1 -b .multibyte
## Lisp patches ## Lisp patches
# remove game we can't ship # remove game we can't ship
@ -102,9 +136,12 @@ rm lisp/finder-inf.el lisp/play/tetris.el*
# patches 2 and 3 touch configure.in # patches 2 and 3 touch configure.in
autoconf-2.13 autoconf-2.13
# add rfc1345 input method (default for UTF-8 lang env)
cp -pi %SOURCE27 leim/quail
%build %build
export CFLAGS="-DMAIL_USE_LOCKF $RPM_OPT_FLAGS" export CFLAGS="-DMAIL_USE_LOCKF $RPM_OPT_FLAGS"
%configure --with-gcc --with-pop --with-sound %configure --with-pop --with-sound
# workaround #101818 (vm/break dumper problem) # workaround #101818 (vm/break dumper problem)
%ifarch %{ix86} %ifarch %{ix86}
@ -114,23 +151,25 @@ export CFLAGS="-DMAIL_USE_LOCKF $RPM_OPT_FLAGS"
%__make %{?_smp_mflags} %__make %{?_smp_mflags}
# remove versioned file so that we end up with .1 suffix and only one DOC file # remove versioned file so that we end up with .1 suffix and only one DOC file
rm src/emacs-%{version}.* rm src/emacs-%{version}.*
TOPDIR=${PWD}
%define emacsbatch ${TOPDIR}/src/emacs -batch --no-init-file --no-site-file
# setup site-lisp files
cp %SOURCE7 %SOURCE8 %SOURCE11 %SOURCE13 %SOURCE20 %SOURCE21 site-lisp
# xemacs compat patch
patch -d site-lisp < %SOURCE18
# fix po-auto-replace-revision-date nil
patch -d site-lisp < %SOURCE23
# make sure patched lisp files get byte-compiled # make sure patched lisp files get byte-compiled
src/emacs -batch -f batch-byte-recompile-directory lisp %emacsbatch -f batch-byte-recompile-directory lisp
%emacsbatch -f batch-byte-compile leim/quail/rfc1345.el site-lisp/*.el
%__make %{?_smp_mflags} -C lisp updates %__make %{?_smp_mflags} -C lisp updates
%define emacsbatch src/emacs -batch --no-init-file --no-site-file
# bytecompile python-mode, ssl, php-mode and rpm-spec-mode
cp %SOURCE7 %SOURCE8 %SOURCE11 %SOURCE13 %SOURCE20 %SOURCE21 .
# xemacs compat patch
patch < %SOURCE18
# fix po-auto-replace-revision-date nil
patch < %SOURCE23
%{emacsbatch} -f batch-byte-compile *.el
( cd Mule-UCS-%{muleucs_ver} ( cd Mule-UCS-%{muleucs_ver}
../%{emacsbatch} -q --no-site-file -l mucs-comp.el ) %{emacsbatch} -l mucs-comp.el )
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
@ -142,20 +181,29 @@ rm -rf $RPM_BUILD_ROOT
%makeinstall %makeinstall
# rebuild without X support
%configure --without-x
%__make %{?_smp_mflags}
# install the emacs without X
install -m 0755 src/emacs $RPM_BUILD_ROOT%{_bindir}/emacs-nox
install -m 0755 src/emacs-%{version}.2 $RPM_BUILD_ROOT%{_bindir}/emacs-nox-%{version}
install -m 0644 etc/DOC-%{version}.2 $RPM_BUILD_ROOT%{_datadir}/emacs/%{version}/etc/
install -m 0644 lib-src/fns-%{version}.2.el $RPM_BUILD_ROOT%{_libexecdir}/emacs/%{version}/*/
# make sure movemail isn't setgid # make sure movemail isn't setgid
chmod 755 $RPM_BUILD_ROOT%{_libexecdir}/emacs/%{version}/*/movemail chmod 755 $RPM_BUILD_ROOT%{_libexecdir}/emacs/%{version}/*/movemail
# # install lisp files for Japanese and other Asian languages
# tar jxC $RPM_BUILD_ROOT -f %{SOURCE9}
rm -f $RPM_BUILD_ROOT%{_infodir}/dir rm -f $RPM_BUILD_ROOT%{_infodir}/dir
mkdir -p $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp mkdir -p $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
install -m 0644 %SOURCE6 $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/site-start.el install -m 0644 %SOURCE6 $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/site-start.el
install -m 0644 %SOURCE26 $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp install -m 0644 %SOURCE26 $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
mv $RPM_BUILD_ROOT%{_mandir}/man1/ctags.1 $RPM_BUILD_ROOT%{_mandir}/man1/gctags.1 mv $RPM_BUILD_ROOT%{_bindir}/{etags,etags.emacs}
mv $RPM_BUILD_ROOT%{_bindir}/ctags $RPM_BUILD_ROOT%{_bindir}/gctags mv $RPM_BUILD_ROOT%{_mandir}/man1/{ctags.1,gctags.1}
mv $RPM_BUILD_ROOT%{_bindir}/{ctags,ctags.emacs}
ln -s ctags.emacs $RPM_BUILD_ROOT%{_bindir}/gctags
# GNOME / KDE files # GNOME / KDE files
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
@ -164,7 +212,7 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -m 0644 %SOURCE4 $RPM_BUILD_ROOT%{_datadir}/pixmaps/ install -m 0644 %SOURCE4 $RPM_BUILD_ROOT%{_datadir}/pixmaps/
# install site-lisp files # install site-lisp files
install -m 0644 *.el *.elc $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/ install -m 0644 site-lisp/*.el{,c} $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/
mkdir -p $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/site-start.d mkdir -p $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/site-start.d
install -m 0644 $RPM_SOURCE_DIR/*-init.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/site-start.d install -m 0644 $RPM_SOURCE_DIR/*-init.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/site-start.d
@ -176,7 +224,7 @@ install -m 0644 %SOURCE5 $RPM_BUILD_ROOT%{_sysconfdir}/skel/.emacs
# elisp reference manual # elisp reference manual
tar jxf %{SOURCE10} tar jxf %{SOURCE10}
( cd elisp-manual-21-2.8 ( cd elisp-manual-21-2.8
install -m 644 elisp elisp-? elisp-?? $RPM_BUILD_ROOT%{_infodir} ) install -m 644 elisp elisp-* $RPM_BUILD_ROOT%{_infodir} )
( cd Mule-UCS-%{muleucs_ver}/lisp ( cd Mule-UCS-%{muleucs_ver}/lisp
mkdir %buildroot%{_datadir}/emacs/site-lisp/Mule-UCS mkdir %buildroot%{_datadir}/emacs/site-lisp/Mule-UCS
@ -185,19 +233,18 @@ tar jxf %{SOURCE10}
# #
# create file lists # create file lists
# #
SRC_TOP=$PWD rm -f *-filelist {common,el,leim}-*-files
rm -f *-filelist {base,el,leim}-*-files ( TOPDIR=${PWD}
pushd $RPM_BUILD_ROOT cd $RPM_BUILD_ROOT
find .%{_datadir}/emacs/%{version}/lisp .%{_datadir}/emacs/site-lisp \( -type f -not -name '*.el' -fprint $SRC_TOP/base-lisp-none-elc-files \) -o \( -type d -fprintf $SRC_TOP/base-lisp-dir-files "%%%%dir %%p\n" \) -o \( -name '*.el' \( -exec test -e '{}'c \; -fprint $SRC_TOP/el-bytecomped-files -o -fprint $SRC_TOP/base-not-comped-files \) \) find .%{_datadir}/emacs/%{version}/lisp .%{_datadir}/emacs/site-lisp \( -type f -not -name '*.el' -fprint $TOPDIR/common-lisp-none-elc-files \) -o \( -type d -fprintf $TOPDIR/common-lisp-dir-files "%%%%dir %%p\n" \) -o \( -name '*.el' ! -name site-start.el \( -exec test -e '{}'c \; -fprint $TOPDIR/el-bytecomped-files -o -fprint $TOPDIR/common-not-comped-files \) \)
find .%{_datadir}/emacs/%{version}/leim \( -name '*.elc' -fprint $SRC_TOP/leim-elc-files \) -o \( -type d -fprintf $SRC_TOP/leim-dir-files "%%%%dir %%p\n" -fprintf $SRC_TOP/el-leim-dir-files "%%%%dir %%p\n" \) -o \( -name '*.el' \( -exec test -e '{}'c \; -fprint $SRC_TOP/el-leim-bytecomped-files -o -fprint $SRC_TOP/leim-not-comped-files \) \) find .%{_datadir}/emacs/%{version}/leim \( -name '*.elc' -fprint $TOPDIR/leim-elc-files \) -o \( -type d -fprintf $TOPDIR/leim-dir-files "%%%%dir %%p\n" -fprintf $TOPDIR/el-leim-dir-files "%%%%dir %%p\n" \) -o \( -name '*.el' \( -exec test -e '{}'c \; -fprint $TOPDIR/el-leim-bytecomped-files -o -fprint $TOPDIR/leim-not-comped-files \) \)
)
popd
# put the lists together after filtering ./usr to /usr # put the lists together after filtering ./usr to /usr
perl -pi -e "s|\.%{_prefix}|%{_prefix}|" *-files perl -pi -e "s|\.%{_prefix}|%{_prefix}|" *-files
cat base-*-files > base-filelist cat common-*-files > common-filelist
cat el-*-files > el-filelist cat el-*-files > el-filelist
cat leim-*-files > leim-filelist cat leim-*-files > leim-filelist
@ -205,12 +252,15 @@ cat leim-*-files > leim-filelist
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%define info_files ccmode cl dired-x ediff emacs forms gnus info message mh-e reftex sc vip viper widget elisp %define info_files ccmode cl dired-x ediff emacs forms gnus info message mh-e reftex sc vip viper widget elisp
%post %post common
for f in %{info_files}; do for f in %{info_files}; do
/sbin/install-info %{_infodir}/$f.gz %{_infodir}/dir --section="GNU Emacs" 2> /dev/null || : /sbin/install-info %{_infodir}/$f.gz %{_infodir}/dir --section="GNU Emacs" 2> /dev/null || :
done done
%preun # make etags a symlink to etags.emacs if etags doesn't exist
[ -e %{_bindir}/etags ] || ln -s etags.emacs %{_bindir}/etags
%preun common
if [ "$1" = 0 ]; then if [ "$1" = 0 ]; then
for f in %{info_files}; do for f in %{info_files}; do
/sbin/install-info --delete %{_infodir}/$f.gz %{_infodir}/dir \ /sbin/install-info --delete %{_infodir}/$f.gz %{_infodir}/dir \
@ -218,30 +268,44 @@ for f in %{info_files}; do
done done
fi fi
%files
%defattr(-,root,root)
%{_bindir}/emacs
%{_bindir}/emacs-%{version}
%dir %{_datadir}/emacs/%{version}/etc
%{_datadir}/emacs/%{version}/etc/DOC-%{version}.1
%dir %{_libexecdir}/emacs/%{version}/*
%{_libexecdir}/emacs/%{version}/*/fns-%{version}.1.el
%files -f base-filelist %files nox
%defattr(-,root,root)
%{_bindir}/emacs-nox
%{_bindir}/emacs-nox-%{version}
%dir %{_datadir}/emacs/%{version}/etc
%{_datadir}/emacs/%{version}/etc/DOC-%{version}.2
%dir %{_libexecdir}/emacs/%{version}/*
%{_libexecdir}/emacs/%{version}/*/fns-%{version}.2.el
%files -f common-filelist common
%defattr(-,root,root) %defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/skel/.emacs %config(noreplace) %{_sysconfdir}/skel/.emacs
%doc etc/NEWS BUGS README %doc etc/NEWS BUGS README
%exclude %{_bindir}/emacs
%exclude %{_bindir}/emacs-%{version}
%exclude %{_bindir}/emacs-nox
%exclude %{_bindir}/emacs-nox-%{version}
%{_bindir}/* %{_bindir}/*
%{_mandir}/*/* %{_mandir}/*/*
%{_infodir}/* %{_infodir}/*
%dir %{_datadir}/emacs %dir %{_datadir}/emacs
# %dir %{_datadir}/emacs/site-lisp
# %{_datadir}/emacs/site-lisp/python-mode.elc
# %{_datadir}/emacs/site-lisp/php-mode.elc
# %{_datadir}/emacs/site-lisp/po-*.elc
# %{_datadir}/emacs/site-lisp/rpm-spec-mode.elc
# %{_datadir}/emacs/site-lisp/ssl.elc
# %{_datadir}/emacs/site-lisp/subdirs.el
# %{_datadir}/emacs/site-lisp/site-start.d/*.el
# %{_datadir}/emacs/site-lisp/lang
%dir %{_datadir}/emacs/%{version} %dir %{_datadir}/emacs/%{version}
%{_datadir}/emacs/%{version}/etc %{_datadir}/emacs/%{version}/etc
%exclude %{_datadir}/emacs/%{version}/etc/DOC-%{version}.*
# quieten startup when -leim and -el aren't installed # quieten startup when -leim and -el aren't installed
%dir %{_datadir}/emacs/%{version}/leim %dir %{_datadir}/emacs/%{version}/leim
%{_datadir}/emacs/%{version}/site-lisp %{_datadir}/emacs/%{version}/site-lisp
%{_libexecdir}/emacs %{_libexecdir}/emacs
%exclude %{_libexecdir}/emacs/%{version}/*/fns-%{version}.*.el
%attr(0644,root,root) %config %{_datadir}/emacs/site-lisp/site-start.el %attr(0644,root,root) %config %{_datadir}/emacs/site-lisp/site-start.el
# %dir %{_datadir}/emacs/site-lisp/site-start.d # %dir %{_datadir}/emacs/site-lisp/site-start.d
%{_datadir}/applications/gnu-emacs.desktop %{_datadir}/applications/gnu-emacs.desktop
@ -249,16 +313,42 @@ fi
%files -f el-filelist el %files -f el-filelist el
%defattr(-,root,root) %defattr(-,root,root)
# %{_datadir}/emacs/site-lisp/python-mode.el
# %{_datadir}/emacs/site-lisp/php-mode.el
# %{_datadir}/emacs/site-lisp/po-*.el
# %{_datadir}/emacs/site-lisp/ssl.el
# %{_datadir}/emacs/site-lisp/rpm-spec-mode.el
%files -f leim-filelist leim %files -f leim-filelist leim
%defattr(-,root,root) %defattr(-,root,root)
%changelog %changelog
* Sat Jan 24 2004 Jens Petersen <petersen@redhat.com> - 21.3-9
- base emacs package now only contains emacs binary built with X support
- bring back emacs-nox subpackage (emacs built without X support) (#113001)
[suggested by Frank Kruchio]
- all the common files required by emacs and emacs-nox are now in emacs-common
- emacs no longer obsoletes emacs-nox
- update php-mode.el to 1.0.5
- add missing rfc1345.el leim input method
- update po-compat.el to version in gettext-0.13.1
- update base package summary
- add url for python-mode.el and php-mode.el
- gctags is now a symlink to ctags.emacs
* Wed Jan 14 2004 Jens Petersen <petersen@redhat.com> - 21.3-8
- comment out setting transient-mark-mode in skel .emacs (#102441,#90193)
[reported by mal@gromco.com, Jonathan Kamens]
- improve lang-coding-systems-init.el to set-language-environment for CJK
utf-8 locale too and use utf-8 for default-coding-systems and
terminal-coding-system (#111172) [Yoshinori Kuniga]
- update rpm-spec-mode.el to newer one in xemacs package cvs (#105888) [Dams]
- rename etags to etags.emacs and make etags a symlink to it at install time
if it doesn't exist (#92256) [marc_soft@merlins.org]
- apply editfns.c-Fformat-multibyte-davej.patch to fix multibyte code typo
in Fformat [patch from Dave Jones]
- add runtime requirements for XFree86-libs, image libraries, ncurses and zlib
- improve -el and -leim package summaries
- no longer configure build with redundant --with-gcc
* Tue Nov 25 2003 Jens Petersen <petersen@redhat.com>
- buildrequire autoconf213 (#110741) [reported by mvd@mylinux.com.ua]
* Mon Oct 27 2003 Jens Petersen <petersen@redhat.com> - 21.3-7 * Mon Oct 27 2003 Jens Petersen <petersen@redhat.com> - 21.3-7
- use "setarch i386" to build on ix86 (#101818) [reported by Michael Redinger] - use "setarch i386" to build on ix86 (#101818) [reported by Michael Redinger]
- use __make to %%build and %%install - use __make to %%build and %%install

BIN
rfc1345.el Normal file

Binary file not shown.

View File

@ -3,7 +3,7 @@
;; Copyright (C) 1997-2002 Stig Bjørlykke, <stigb@tihlde.org> ;; Copyright (C) 1997-2002 Stig Bjørlykke, <stigb@tihlde.org>
;; Author: Stig Bjørlykke, <stigb@tihlde.org> ;; Author: Stig Bjørlykke, <stigb@tihlde.org>
;; Keywords: unix, languages ;; Keywords: unix, languages, rpm
;; Version: 0.12 ;; Version: 0.12
;; This file is part of XEmacs. ;; This file is part of XEmacs.
@ -33,6 +33,7 @@
;; Tim Powers <timp@redhat.com> and Trond Eivind Glomsrød ;; Tim Powers <timp@redhat.com> and Trond Eivind Glomsrød
;; <teg@redhat.com> for Red Hat adaptions and some fixes. ;; <teg@redhat.com> for Red Hat adaptions and some fixes.
;; Chmouel Boudjnah <chmouel@mandrakesoft.com> for Mandrake fixes. ;; Chmouel Boudjnah <chmouel@mandrakesoft.com> for Mandrake fixes.
;; Ville Skyttä <scop@xemacs.org> for some fixes.
;;; ToDo: ;;; ToDo:
@ -69,11 +70,6 @@
:prefix "rpm-spec-" :prefix "rpm-spec-"
:group 'languages) :group 'languages)
(defcustom rpm-spec-build-command "rpmbuild"
"Command for building a RPM package."
:type 'string
:group 'rpm-spec)
(defcustom rpm-spec-add-attr nil (defcustom rpm-spec-add-attr nil
"Add \"%attr\" entry for file listings or not." "Add \"%attr\" entry for file listings or not."
:type 'boolean :type 'boolean
@ -95,7 +91,7 @@ timecheck age."
:group 'rpm-spec) :group 'rpm-spec)
(defcustom rpm-spec-buildroot "" (defcustom rpm-spec-buildroot ""
"Override the BuildRoot tag with directory <dir>." "When building, override the BuildRoot tag with directory <dir>."
:type 'string :type 'string
:group 'rpm-spec) :group 'rpm-spec)
@ -125,11 +121,20 @@ This is used during Tempo template completion."
:type 'boolean :type 'boolean
:group 'rpm-spec) :group 'rpm-spec)
(define-obsolete-variable-alias
'rpm-spec-test 'rpm-spec-nobuild)
(defcustom rpm-spec-nobuild nil (defcustom rpm-spec-nobuild nil
"Do not execute any build stages. Useful for testing out spec files." "Do not execute any build stages. Useful for testing out spec files."
:type 'boolean :type 'boolean
:group 'rpm-spec) :group 'rpm-spec)
(defcustom rpm-spec-quiet nil
"Print as little as possible.
Normally only error messages will be displayed."
:type 'boolean
:group 'rpm-spec)
(defcustom rpm-spec-sign-gpg nil (defcustom rpm-spec-sign-gpg nil
"Embed a GPG signature in the package. "Embed a GPG signature in the package.
This signature can be used to verify the integrity and the origin of This signature can be used to verify the integrity and the origin of
@ -142,11 +147,6 @@ the package."
:type 'boolean :type 'boolean
:group 'rpm-spec) :group 'rpm-spec)
(defcustom rpm-spec-old-rpm nil
"Set if using `rpm' as command for building packages."
:type 'boolean
:group 'rpm-spec)
(define-obsolete-variable-alias (define-obsolete-variable-alias
'rpm-initialize-sections 'rpm-spec-initialize-sections) 'rpm-initialize-sections 'rpm-spec-initialize-sections)
@ -179,8 +179,50 @@ value returned by function `user-mail-address'."
string) string)
:group 'rpm-spec) :group 'rpm-spec)
(defcustom rpm-spec-indent-heading-values nil
"*Indent values for all tags in the \"heading\" of the spec file."
:type 'boolean
:group 'rpm-spec)
(defcustom rpm-spec-use-compilation-mode t
"*If non-nil, build in `compilation-mode' if it's available."
:type 'boolean
:group 'rpm-spec)
(defcustom rpm-spec-default-release "1"
"*Default value for the Release tag in new spec files."
:type 'string
:group 'rpm-spec)
(defcustom rpm-spec-default-epoch nil
"*If non-nil, default value for the Epoch tag in new spec files."
:type '(choice (const :tag "No Epoch" nil) integer)
:group 'rpm-spec)
(defcustom rpm-spec-default-buildroot
"%{_tmppath}/%{name}-%{version}-%{release}-root"
"*Default value for the BuildRoot tag in new spec files."
:type 'integer
:group 'rpm-spec)
(defcustom rpm-spec-default-build-section ""
"*Default %build section in new spec files."
:type 'string
:group 'rpm-spec)
(defcustom rpm-spec-default-install-section "rm -rf $RPM_BUILD_ROOT\n"
"*Default %install section in new spec files."
:type 'string
:group 'rpm-spec)
(defcustom rpm-spec-default-clean-section "rm -rf $RPM_BUILD_ROOT\n"
"*Default %clean section in new spec files."
:type 'string
:group 'rpm-spec)
(defgroup rpm-spec-faces nil (defgroup rpm-spec-faces nil
"Font lock faces for `rpm-spec-mode'." "Font lock faces for `rpm-spec-mode'."
:prefix "rpm-spec-"
:group 'rpm-spec :group 'rpm-spec
:group 'faces) :group 'faces)
@ -188,12 +230,12 @@ value returned by function `user-mail-address'."
;; variables used by navigation functions. ;; variables used by navigation functions.
(defconst rpm-sections (defconst rpm-sections
'("preamble" "description" "prep" "setup" "build" "install" "clean" '("preamble" "description" "prep" "setup" "build" "install" "check" "clean"
"changelog" "files") "changelog" "files")
"Partial list of section names.") "Partial list of section names.")
(defvar rpm-section-list (defvar rpm-section-list
'(("preamble") ("description") ("prep") ("setup") ("build") ("install") '(("preamble") ("description") ("prep") ("setup") ("build") ("install")
("clean") ("changelog") ("files")) ("check") ("clean") ("changelog") ("files"))
"Partial list of section names.") "Partial list of section names.")
(defconst rpm-scripts (defconst rpm-scripts
'("pre" "post" "preun" "postun" '("pre" "post" "preun" "postun"
@ -204,60 +246,67 @@ value returned by function `user-mail-address'."
(eval-when-compile (eval-when-compile
(concat "^%" (concat "^%"
(regexp-opt (regexp-opt
;; From RPM 4.1 sources, file build/parseSpec.c: partList[]. ;; From RPM 4.2 sources, file build/parseSpec.c: partList[].
'("build" "changelog" "clean" "description" "files" "install" '("build" "changelog" "check" "clean" "description" "files"
"package" "post" "postun" "pre" "prep" "preun" "trigger" "install" "package" "post" "postun" "pre" "prep" "preun"
"triggerin" "triggerpostun" "triggerun" "verifyscript") t) "trigger" "triggerin" "triggerpostun" "triggerun"
"verifyscript") t)
"\\b")) "\\b"))
"Regular expression to match beginning of a section.") "Regular expression to match beginning of a section.")
;;------------------------------------------------------------ ;;------------------------------------------------------------
(defface rpm-spec-tag-face (defface rpm-spec-tag-face
'(( ((class color) (background light)) (:foreground "blue") ) '(( ((class color) (background light)) (:foreground "blue3") )
( ((class color) (background dark)) (:foreground "blue") )) ( ((class color) (background dark)) (:foreground "blue") ))
"*The face used for tags." "*Face for tags."
:group 'rpm-spec-faces) :group 'rpm-spec-faces)
(defface rpm-spec-macro-face (defface rpm-spec-macro-face
'(( ((class color) (background light)) (:foreground "purple") ) '(( ((class color) (background light)) (:foreground "purple") )
( ((class color) (background dark)) (:foreground "yellow") )) ( ((class color) (background dark)) (:foreground "yellow") ))
"*The face used for macros." "*Face for RPM macros and variables."
:group 'rpm-spec-faces) :group 'rpm-spec-faces)
(defface rpm-spec-var-face (defface rpm-spec-var-face
'(( ((class color) (background light)) (:foreground "maroon") ) '(( ((class color) (background light)) (:foreground "maroon") )
( ((class color) (background dark)) (:foreground "maroon") )) ( ((class color) (background dark)) (:foreground "maroon") ))
"*The face used for environment variables." "*Face for environment variables."
:group 'rpm-spec-faces) :group 'rpm-spec-faces)
(defface rpm-spec-doc-face (defface rpm-spec-doc-face
'(( ((class color) (background light)) (:foreground "magenta") ) '(( ((class color) (background light)) (:foreground "magenta3") )
( ((class color) (background dark)) (:foreground "magenta") )) ( ((class color) (background dark)) (:foreground "magenta") ))
"*The face used for document files." "*Face for %doc entries in %files."
:group 'rpm-spec-faces) :group 'rpm-spec-faces)
(defface rpm-spec-dir-face (defface rpm-spec-dir-face
'(( ((class color) (background light)) (:foreground "green") ) '(( ((class color) (background light)) (:foreground "green4") )
( ((class color) (background dark)) (:foreground "green") )) ( ((class color) (background dark)) (:foreground "green") ))
"*The face used for directories." "*Face for %dir entries in %files."
:group 'rpm-spec-faces) :group 'rpm-spec-faces)
(defface rpm-spec-package-face (defface rpm-spec-package-face
'(( ((class color) (background light)) (:foreground "red") ) '(( ((class color) (background light)) (:foreground "red3") )
( ((class color) (background dark)) (:foreground "red") )) ( ((class color) (background dark)) (:foreground "red") ))
"*The face used for files." "*Face for package tag."
:group 'rpm-spec-faces) :group 'rpm-spec-faces)
(defface rpm-spec-ghost-face (defface rpm-spec-ghost-face
'(( ((class color) (background light)) (:foreground "red") ) '(( ((class color) (background light)) (:foreground "gray50") )
( ((class color) (background dark)) (:foreground "red") )) ( ((class color) (background dark)) (:foreground "red") ))
"*The face used for ghost tags." "*Face for %ghost and %config entries in %files."
:group 'rpm-spec-faces)
(defface rpm-spec-section-face
'(( ((class color) (background light)) (:foreground "purple" :underline t) )
( ((class color) (background dark)) (:foreground "yellow" :underline t) ))
"*Face for section markers."
:group 'rpm-spec-faces) :group 'rpm-spec-faces)
;;; GNU emacs font-lock needs these... ;;; GNU emacs font-lock needs these...
(defvar rpm-spec-macro-face (defvar rpm-spec-macro-face
'rpm-spec-macro-face "*Face for macros.") 'rpm-spec-macro-face "*Face for RPM macros and variables.")
(defvar rpm-spec-var-face (defvar rpm-spec-var-face
'rpm-spec-var-face "*Face for environment variables.") 'rpm-spec-var-face "*Face for environment variables.")
(defvar rpm-spec-tag-face (defvar rpm-spec-tag-face
@ -265,11 +314,13 @@ value returned by function `user-mail-address'."
(defvar rpm-spec-package-face (defvar rpm-spec-package-face
'rpm-spec-package-face "*Face for package tag.") 'rpm-spec-package-face "*Face for package tag.")
(defvar rpm-spec-dir-face (defvar rpm-spec-dir-face
'rpm-spec-dir-face "*Face for directory entries.") 'rpm-spec-dir-face "*Face for %dir entries in %files.")
(defvar rpm-spec-doc-face (defvar rpm-spec-doc-face
'rpm-spec-doc-face "*Face for documentation entries.") 'rpm-spec-doc-face "*Face for %doc entries in %files.")
(defvar rpm-spec-ghost-face (defvar rpm-spec-ghost-face
'rpm-spec-ghost-face "*Face for \"%ghost\" files.") 'rpm-spec-ghost-face "*Face for %ghost and %config entries in %files.")
(defvar rpm-spec-section-face
'rpm-spec-section-face "*Face for section markers.")
(defvar rpm-default-umask "-" (defvar rpm-default-umask "-"
"*Default umask for files, specified with \"%attr\".") "*Default umask for files, specified with \"%attr\".")
@ -281,9 +332,11 @@ value returned by function `user-mail-address'."
;;------------------------------------------------------------ ;;------------------------------------------------------------
(defvar rpm-no-gpg nil "Tell rpm not to sign package.") (defvar rpm-no-gpg nil "Tell rpm not to sign package.")
(defvar rpm-spec-build-command "rpmbuild" "Command to build rpms.")
(defvar rpm-spec-nobuild-option "--nobuild" "Option for no build.")
(defvar rpm-tags-list (defvar rpm-tags-list
;; From RPM 4.1 sources, file build/parsePreamble.c: preambleList[].") ;; From RPM 4.2 sources, file build/parsePreamble.c: preambleList[].")
'(("AutoProv") '(("AutoProv")
("AutoReq") ("AutoReq")
("AutoReqProv") ("AutoReqProv")
@ -332,7 +385,7 @@ value returned by function `user-mail-address'."
"List of elements that are valid tags.") "List of elements that are valid tags.")
(defvar rpm-group-tags-list (defvar rpm-group-tags-list
;; From RPM 4.1 sources, file GROUPS. ;; From RPM 4.2 sources, file GROUPS.
'(("Amusements/Games") '(("Amusements/Games")
("Amusements/Graphics") ("Amusements/Graphics")
("Applications/Archiving") ("Applications/Archiving")
@ -421,9 +474,10 @@ value returned by function `user-mail-address'."
(define-key rpm-spec-mode-map "\C-c\C-xi" 'rpm-change-timecheck-option) (define-key rpm-spec-mode-map "\C-c\C-xi" 'rpm-change-timecheck-option)
(define-key rpm-spec-mode-map "\C-c\C-xn" 'rpm-toggle-nobuild) (define-key rpm-spec-mode-map "\C-c\C-xn" 'rpm-toggle-nobuild)
(define-key rpm-spec-mode-map "\C-c\C-xo" 'rpm-files-owner) (define-key rpm-spec-mode-map "\C-c\C-xo" 'rpm-files-owner)
(define-key rpm-spec-mode-map "\C-c\C-xp" 'rpm-change-target-option)
(define-key rpm-spec-mode-map "\C-c\C-xr" 'rpm-toggle-rmsource) (define-key rpm-spec-mode-map "\C-c\C-xr" 'rpm-toggle-rmsource)
(define-key rpm-spec-mode-map "\C-c\C-xq" 'rpm-toggle-quiet)
(define-key rpm-spec-mode-map "\C-c\C-xs" 'rpm-toggle-short-circuit) (define-key rpm-spec-mode-map "\C-c\C-xs" 'rpm-toggle-short-circuit)
(define-key rpm-spec-mode-map "\C-c\C-xt" 'rpm-change-target-option)
(define-key rpm-spec-mode-map "\C-c\C-xu" 'rpm-files-umask) (define-key rpm-spec-mode-map "\C-c\C-xu" 'rpm-files-umask)
;;(define-key rpm-spec-mode-map "\C-q" 'indent-spec-exp) ;;(define-key rpm-spec-mode-map "\C-q" 'indent-spec-exp)
;;(define-key rpm-spec-mode-map "\t" 'sh-indent-line) ;;(define-key rpm-spec-mode-map "\t" 'sh-indent-line)
@ -466,6 +520,8 @@ value returned by function `user-mail-address'."
:style toggle :selected rpm-spec-clean] :style toggle :selected rpm-spec-clean]
["No build" rpm-toggle-nobuild ["No build" rpm-toggle-nobuild
:style toggle :selected rpm-spec-nobuild] :style toggle :selected rpm-spec-nobuild]
["Quiet" rpm-toggle-quiet
:style toggle :selected rpm-spec-quiet]
["GPG sign" rpm-toggle-sign-gpg ["GPG sign" rpm-toggle-sign-gpg
:style toggle :selected rpm-spec-sign-gpg] :style toggle :selected rpm-spec-sign-gpg]
["Ignore dependencies" rpm-toggle-nodeps ["Ignore dependencies" rpm-toggle-nodeps
@ -488,32 +544,34 @@ value returned by function `user-mail-address'."
))) )))
(defvar rpm-spec-font-lock-keywords (defvar rpm-spec-font-lock-keywords
'( (list
("%[a-zA-Z0-9_]+" 0 rpm-spec-macro-face) (cons rpm-section-regexp rpm-spec-section-face)
("^\\([a-zA-Z0-9]+\\)\\(\([a-zA-Z0-9,]+\)\\):" '("%[a-zA-Z0-9_]+" 0 rpm-spec-macro-face)
'("^\\([a-zA-Z0-9]+\\)\\(\([a-zA-Z0-9,_]+\)\\):"
(1 rpm-spec-tag-face) (1 rpm-spec-tag-face)
(2 rpm-spec-ghost-face)) (2 rpm-spec-ghost-face))
("^\\([a-zA-Z0-9]+\\):" 1 rpm-spec-tag-face) '("^\\([a-zA-Z0-9]+\\):" 1 rpm-spec-tag-face)
("%\\(de\\(fine\\|scription\\)\\|files\\|package\\)[ \t]+\\([^-][^ \t\n]*\\)" '("%\\(de\\(fine\\|scription\\)\\|files\\|package\\)[ \t]+\\([^-][^ \t\n]*\\)"
(3 rpm-spec-package-face)) (3 rpm-spec-package-face))
("%p\\(ost\\|re\\)\\(un\\)?[ \t]+\\([^-][^ \t\n]*\\)" '("%p\\(ost\\|re\\)\\(un\\)?[ \t]+\\([^-][^ \t\n]*\\)"
(3 rpm-spec-package-face)) (3 rpm-spec-package-face))
("%configure " 0 rpm-spec-macro-face) '("%configure " 0 rpm-spec-macro-face)
("%dir[ \t]+\\([^ \t\n]+\\)[ \t]*" 1 rpm-spec-dir-face) '("%dir[ \t]+\\([^ \t\n]+\\)[ \t]*" 1 rpm-spec-dir-face)
("%doc\\(dir\\)?[ \t]+\\(.*\\)\n" 2 rpm-spec-doc-face) '("%doc\\(dir\\)?[ \t]+\\(.*\\)\n" 2 rpm-spec-doc-face)
("%\\(ghost\\|config\\)[ \t]+\\(.*\\)\n" 2 rpm-spec-ghost-face) '("%\\(ghost\\|config\\([ \t]*(.*)\\)?\\)[ \t]+\\(.*\\)\n"
("^%.+-[a-zA-Z][ \t]+\\([a-zA-Z0-9\.-]+\\)" 1 rpm-spec-doc-face) 3 rpm-spec-ghost-face)
("^\\(.+\\)(\\([a-zA-Z]\\{2,2\\}\\)):" '("^%.+-[a-zA-Z][ \t]+\\([a-zA-Z0-9\.-]+\\)" 1 rpm-spec-doc-face)
'("^\\(.+\\)(\\([a-zA-Z]\\{2,2\\}\\)):"
(1 rpm-spec-tag-face) (1 rpm-spec-tag-face)
(2 rpm-spec-doc-face)) (2 rpm-spec-doc-face))
("^\\*\\(.*[0-9] \\)\\(.*\\)\\(<.*>\\)\\(.*\\)\n" '("^\\*\\(.*[0-9] \\)\\(.*\\)<\\(.*\\)>\\(.*\\)\n"
(1 rpm-spec-dir-face) (1 rpm-spec-dir-face)
(2 rpm-spec-package-face) (2 rpm-spec-package-face)
(3 rpm-spec-tag-face) (3 rpm-spec-tag-face)
(4 font-lock-warning-face)) (4 rpm-spec-ghost-face))
("%{[^{}]*}" 0 rpm-spec-macro-face) '("%{[^{}]*}" 0 rpm-spec-macro-face)
("$[a-zA-Z0-9_]+" 0 rpm-spec-var-face) '("$[a-zA-Z0-9_]+" 0 rpm-spec-var-face)
("${[a-zA-Z0-9_]+}" 0 rpm-spec-var-face) '("${[a-zA-Z0-9_]+}" 0 rpm-spec-var-face)
) )
"Additional expressions to highlight in `rpm-spec-mode'.") "Additional expressions to highlight in `rpm-spec-mode'.")
@ -526,6 +584,8 @@ value returned by function `user-mail-address'."
;;------------------------------------------------------------ ;;------------------------------------------------------------
(add-hook 'rpm-spec-mode-new-file-hook 'rpm-spec-initialize)
;;;###autoload ;;;###autoload
(defun rpm-spec-mode () (defun rpm-spec-mode ()
"Major mode for editing RPM spec files. "Major mode for editing RPM spec files.
@ -553,13 +613,13 @@ with no args, if that value is non-nil."
"Post menu for `rpm-spec-mode'." rpm-spec-mode-menu) "Post menu for `rpm-spec-mode'." rpm-spec-mode-menu)
(easy-menu-add rpm-spec-mode-menu) (easy-menu-add rpm-spec-mode-menu)
(if (= (buffer-size) 0) (if (and (= (buffer-size) 0) rpm-spec-initialize-sections)
(rpm-spec-initialize)) (run-hooks 'rpm-spec-mode-new-file-hook))
(if (executable-find "rpmbuild") (if (not (executable-find "rpmbuild"))
(setq rpm-spec-build-command "rpmbuild") (progn
(setq rpm-spec-old-rpm t) (setq rpm-spec-build-command "rpm")
(setq rpm-spec-build-command "rpm")) (setq rpm-spec-nobuild-option "--test")))
(make-local-variable 'paragraph-start) (make-local-variable 'paragraph-start)
(setq paragraph-start (concat "$\\|" page-delimiter)) (setq paragraph-start (concat "$\\|" page-delimiter))
@ -608,7 +668,7 @@ with no args, if that value is non-nil."
(substring (current-time-string) -4) " " (substring (current-time-string) -4) " "
fullname " <" address ">" fullname " <" address ">"
(and rpm-spec-insert-changelog-version (and rpm-spec-insert-changelog-version
(concat " " (rpm-find-spec-version t)))))) (concat " - " (rpm-find-spec-version t))))))
(if (not (search-forward string nil t)) (if (not (search-forward string nil t))
(insert "\n" string "\n") (insert "\n" string "\n")
(forward-line 2)) (forward-line 2))
@ -878,6 +938,9 @@ leave point at previous location."
(defun rpm-build (buildoptions) (defun rpm-build (buildoptions)
"Build this RPM package." "Build this RPM package."
(if (and (buffer-modified-p)
(y-or-n-p (format "Buffer %s modified, save it? " (buffer-name))))
(save-buffer))
(setq rpm-buffer-name (setq rpm-buffer-name
(concat "*" rpm-spec-build-command " " buildoptions " " (concat "*" rpm-spec-build-command " " buildoptions " "
(file-name-nondirectory buffer-file-name) "*")) (file-name-nondirectory buffer-file-name) "*"))
@ -906,16 +969,21 @@ leave point at previous location."
(setq buildoptions (cons "--target" (cons rpm-spec-target (setq buildoptions (cons "--target" (cons rpm-spec-target
buildoptions)))) buildoptions))))
(if rpm-spec-nobuild (if rpm-spec-nobuild
(setq buildoptions (cons (if rpm-spec-old-rpm "--test" "--nobuild") (setq buildoptions (cons rpm-spec-nobuild-option buildoptions)))
buildoptions))) (if rpm-spec-quiet
(setq buildoptions (cons "--quiet" buildoptions)))
(if rpm-spec-nodeps (if rpm-spec-nodeps
(setq buildoptions (cons "--nodeps" buildoptions))) (setq buildoptions (cons "--nodeps" buildoptions)))
(if (and rpm-spec-sign-gpg (not rpm-no-gpg)) (if (and rpm-spec-sign-gpg (not rpm-no-gpg))
(setq buildoptions (cons "--sign" buildoptions))) (setq buildoptions (cons "--sign" buildoptions)))
(save-excursion (save-excursion
(set-buffer (get-buffer rpm-buffer-name)) (set-buffer (get-buffer rpm-buffer-name))
(and rpm-spec-use-compilation-mode
(fboundp 'compilation-mode)
(compilation-mode))
(goto-char (point-max))) (goto-char (point-max)))
(let ((process (let* ((process-environment (cons "EMACS=t" process-environment))
(process
(apply 'start-process rpm-spec-build-command rpm-buffer-name (apply 'start-process rpm-spec-build-command rpm-buffer-name
rpm-spec-build-command buildoptions))) rpm-spec-build-command buildoptions)))
(if (and rpm-spec-sign-gpg (not rpm-no-gpg)) (if (and rpm-spec-sign-gpg (not rpm-no-gpg))
@ -1022,9 +1090,17 @@ command."
(interactive "p") (interactive "p")
(setq rpm-spec-nobuild (not rpm-spec-nobuild)) (setq rpm-spec-nobuild (not rpm-spec-nobuild))
(rpm-update-mode-name) (rpm-update-mode-name)
(message (concat "Turned `" (if rpm-spec-old-rpm "--test" "--nobuild") "' " (message (concat "Turned `" rpm-spec-nobuild-option "' "
(if rpm-spec-nobuild "on" "off") "."))) (if rpm-spec-nobuild "on" "off") ".")))
(defun rpm-toggle-quiet (&optional arg)
"Toggle `rpm-spec-quiet'."
(interactive "p")
(setq rpm-spec-quiet (not rpm-spec-quiet))
(rpm-update-mode-name)
(message (concat "Turned `--quiet' "
(if rpm-spec-quiet "on" "off") ".")))
(defun rpm-toggle-sign-gpg (&optional arg) (defun rpm-toggle-sign-gpg (&optional arg)
"Toggle `rpm-spec-sign-gpg'." "Toggle `rpm-spec-sign-gpg'."
(interactive "p") (interactive "p")
@ -1059,6 +1135,7 @@ command."
(if rpm-spec-nobuild "N") (if rpm-spec-nobuild "N")
(if rpm-spec-rmsource "R") (if rpm-spec-rmsource "R")
(if rpm-spec-short-circuit "S") (if rpm-spec-short-circuit "S")
(if rpm-spec-quiet "Q")
)) ))
(if (not (equal modes "")) (if (not (equal modes ""))
(setq mode-name (concat mode-name ":" modes)))) (setq mode-name (concat mode-name ":" modes))))
@ -1128,14 +1205,19 @@ See `search-forward-regexp'."
(search-forward-regexp (concat (search-forward-regexp (concat
field ":[ \t]*\\(.*?\\)[ \t]*$") max) field ":[ \t]*\\(.*?\\)[ \t]*$") max)
(match-string 1)))) (match-string 1))))
(if (string-match "%{?\\([^}]*\\)}?$" str) (if (string-match "\\(%{?\\)\\([a-zA-Z0-9_]*\\)\\(}?\\)" str)
(let ((end-string (substring str (match-end 3))))
(concat (substring str 0 (match-beginning 1))
(progn (progn
(goto-char (point-min)) (goto-char (point-min))
(search-forward-regexp (search-forward-regexp
(concat "%define[ \t]+" (substring str (match-beginning 1) (concat "%define[ \t]+"
(match-end 1)) (substring str
(match-beginning 2)
(match-end 2))
"[ \t]+\\(.*\\)")) "[ \t]+\\(.*\\)"))
(match-string 1)) (match-string 1))
end-string))
str))))) str)))))
(defun rpm-find-spec-version (&optional with-epoch) (defun rpm-find-spec-version (&optional with-epoch)
@ -1182,7 +1264,7 @@ if one is present in the file."
(defun rpm-spec-initialize () (defun rpm-spec-initialize ()
"Create a default spec file if one does not exist or is empty." "Create a default spec file if one does not exist or is empty."
(let (file name version (release "1")) (let (file name version (release rpm-spec-default-release))
(setq file (if (buffer-file-name) (setq file (if (buffer-file-name)
(file-name-nondirectory (buffer-file-name)) (file-name-nondirectory (buffer-file-name))
(buffer-name))) (buffer-name)))
@ -1197,30 +1279,52 @@ if one is present in the file."
((eq (string-match "\\(.*\\).spec" file) 0) ((eq (string-match "\\(.*\\).spec" file) 0)
(setq name (match-string 1 file)))) (setq name (match-string 1 file))))
(if rpm-spec-indent-heading-values
(insert (insert
"Summary: " "Summary: "
"\nName: " (or name "") "\nName: " (or name "")
"\nVersion: " (or version "") "\nVersion: " (or version "")
"\nRelease: " (or release "") "\nRelease: " (or release "")
(if rpm-spec-default-epoch
(concat "\nEpoch: "
(int-to-string rpm-spec-default-epoch))
"")
"\nLicense: " "\nLicense: "
"\nGroup: " "\nGroup: "
"\nURL: " "\nURL: "
"\nSource0: %{name}-%{version}.tar.gz" "\nSource0: %{name}-%{version}.tar.gz"
"\nBuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot" "\nBuildRoot: " rpm-spec-default-buildroot)
(insert
"Summary: "
"\nName: " (or name "")
"\nVersion: " (or version "")
"\nRelease: " (or release "")
(if rpm-spec-default-epoch
(concat "\nEpoch: " (int-to-string rpm-spec-default-epoch))
"")
"\nLicense: "
"\nGroup: "
"\nURL: "
"\nSource0: %{name}-%{version}.tar.gz"
"\nBuildRoot: " rpm-spec-default-buildroot))
(insert
"\n\n%description\n" "\n\n%description\n"
"\n%prep" "\n%prep"
"\n%setup -q" "\n%setup -q"
"\n\n%build" "\n\n%build\n"
"\n\n%install" (or rpm-spec-default-build-section "")
"\nrm -rf $RPM_BUILD_ROOT" "\n%install\n"
"\n\n%clean" (or rpm-spec-default-install-section "")
"\nrm -rf $RPM_BUILD_ROOT" "\n%clean\n"
(or rpm-spec-default-clean-section "")
"\n\n%files" "\n\n%files"
"\n%defattr(-,root,root,-)" "\n%defattr(-,root,root,-)"
"\n%doc\n" "\n%doc\n"
"\n\n%changelog\n") "\n\n%changelog\n")
(rpm-add-change-log-entry "Initial build.\n"))) (end-of-line 1)
(rpm-add-change-log-entry "Initial build.")))
;;------------------------------------------------------------ ;;------------------------------------------------------------
@ -1232,8 +1336,7 @@ if one is present in the file."
rpm-spec-mode-version rpm-spec-mode-version
" by Stig Bjørlykke, <stigb@tihlde.org>"))) " by Stig Bjørlykke, <stigb@tihlde.org>")))
;;;###autoload ;;;###autoload(add-to-list 'auto-mode-alist '("\\.spec\\(\\.in\\)?$" . rpm-spec-mode))
(add-to-list 'auto-mode-alist '("\\.spec$" . rpm-spec-mode))
(provide 'rpm-spec-mode) (provide 'rpm-spec-mode)