Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1574578
 поиск   регистрация   авторизация 
 
Группа :: Редакторы
Пакет: emacs21

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

%define oldversion 20.7
%define shortname emacs
Name: emacs21
Version: 21.3
Release: alt11.M24.vla2

Packager: Ivan Zakharyaschev <imz at altlinux.ru>

Group: Editors
Summary: GNU Emacs text editor
License: GPL

URL: http://www.gnu.org/software/emacs/

%if "%imz__light_sources" == "1"
# "Light" versions (uncompressed for faster %prep)
Source0: rsync://ftp.gnu.org/gnu/%shortname/%shortname-%version.tar
Source1: rsync://ftp.gnu.org/gnu/%shortname/leim-%version.tar
%else
Source0: rsync://ftp.gnu.org/gnu/%shortname/%shortname-%version.tar.bz2
Source1: rsync://ftp.gnu.org/gnu/%shortname/leim-%version.tar.bz2
%endif
Source2: TUTORIAL.ru
Source3: smtpmail.el

Source7: README.KOI8-U

#Source110: http://prdownloads.sourceforge.net/php-mode/php-mode.el

#Source111: emacs-mode-php.site-start.el

Source12: gnu-mini.xpm
Source13: gnu-normal.xpm
Source14: gnu-large.xpm

# from Serhij Hlodin

Source16: CHANGES.ukr
Source17: INSTALL.ukr
Source18: README.UK

Source22: %name.menu
Source24: %name.alternatives

# Mdk's and ALT's global configs merged: the X resources

Source31: %shortname-21.2-alt14-xresources-ALT

# List of some large .elc files to be compressed:

#Source40: %shortname-21.2-el-to-compress.ls

Source41: emacs21-rus-win-keyboard-alt2.el

################### Patches  ##########################

# ALT's libtinfo; POSIX locks via fcntl convention:
Patch0: %shortname-21.2-alt-system.patch

# Try to load also bzipped2 .el/.elc files

# as well as with gzipped and uncompressed variants (supported before)
Patch1: %shortname-21.2-alt14-load-el_bz2.patch
# isn't applied (21.2-alt1): indicator is already disabled in the GNU release:
Patch2: %shortname-21.1-enc-kb-short-indicator.patch
Patch3: %shortname-21.3-alt3-clipboard.patch

# We don't want the whole pkg depend on rcs

# just because someone may want to use it:
Patch4: %shortname-21.2-hide-rcs-deps.patch
Patch5: %shortname-21.2-Meta-Alt-Ctrl-Hyper-super-discard-state.patch
# the freshest pc-select.el (from the HEAD of CVS)
Patch6: %shortname-21.2-HEAD-pc-select.diff
Patch7: %shortname-21.2-pc-select-private-mark.patch
Patch8: %shortname-21.2-ediff-diff-options-check-c.patch
Patch10: %shortname-21.2-face-font-selection-slant-important.patch
Patch11: %shortname-21.3-use-handler-for-load-of-absolute.patch
Patch12: %shortname-21.3-use-handler-for-load-of-suffixed.patch
Patch13: %shortname-21.3-vc-cvs-registered-autoload-parts.patch
Patch14: %shortname-21.3-rh-no_rpath.patch
Patch15: %shortname-21.2-x86_64.patch

# These two patches make the real work for ukrainisation:

Patch20: %shortname-21.3-alt4-uk.patch
Patch21: leim-21.1-uk.patch
Patch22: leim-20.6-belarusian.patch
# added belarussian and proprer russianw dictionary support
Patch23: %shortname-21.3-ispell-belarusian.patch
Patch24: %shortname-21.3-ispell-russianw.patch



Patch33: %shortname-21.3-alt1-more-cyrillic-support.patch
#Patch33: %shortname-21.2-alt10-cyrillic-cp-lang-envs.patch
Patch34: %shortname-21.1-lang-env-prereqs.patch

Patch35: %shortname-21.2-alt12-tutorial-ru.patch

# End of Patches #

##################

# We use awk for output parsing and error-msg detection:

BuildRequires(build): awk
# We use zme:
BuildRequires(install): bzip2-utils
# <term.h> is there since then:
BuildRequires(build): libtinfo >= 5.2.20020622-alt2

BuildRequires(build): autoconf_2.13
%set_autoconf_version 2.13

# %_configure_target must set --host= for a correct emacs build;

# added since then:
BuildRequires(build): rpm >= 4.0.4-alt12

# We need sendmail to properly dump emacs during bootstrap

BuildRequires(build): sendmail-common

# We need emacs-base

BuildPreReq: %shortname-base >= 0.0.4-alt1
BuildRequires(build): %shortname-base >= 0.0.4-alt1

# The %_altdir macro is there AFAIU.

BuildRequires(install): libalternatives-devel

# All emacs pkgs should be removed from the list.

# XFree86-devel or XFree86-devel-static?

# Strange build deps:

#BuildRequires: inews  postfix

# Automatically added by buildreq on Wed Mar 12 2003

BuildRequires: XFree86-devel XFree86-libs XFree86-locales libXaw3d-devel libalternatives-devel libjpeg-devel libncurses-devel libpng-devel libtiff-devel libtinfo-devel libungif-devel xpm-devel zlib-devel emacs-base

%description
Emacs is an extensible, customizable, self-documenting real-time
display editor.  Emacs contains special code editing features, an
extension language (Emacs Lisp), and the capability to read mail, news
and more without leaving the editor.

This package includes things you need to run the Emacs editor, so you
need to install this package if you intend to use Emacs.  You also
need to install the actual Emacs program package (%name-nox or
%name-X11).  Install %name-nox if you are not going to use the X
Window System; install %name-X11 if you will be using X.

%package common
Summary: Things needed to run the GNU Emacs text editor
Group: Editors
Obsoletes: %name
Obsoletes: %shortname-common
Provides: %shortname-common = %version-%release
# Common is useless without an Emacs binary:
Requires: %name = %version-%release
# We do not include speedbar from GNU's distro;
# so we require th external one.
# !!! Не забыть убрать при распиливании
#Requires: %shortname-speedbar
#alternatives must be installed before this package
PreReq: alternatives >= 0.0.6

Requires: emacs-base >= 0.0.4-alt1

Conflicts: etcskel < 2.0.2-alt1
Conflicts: emacs-prog-modes < 0.1-alt7
# ispell-uk 0.5 is broken, and can cause hang in flyspell mode
Conflicts: ispell-uk < 0.6-alt1

%description common
GNU Emacs is an extensible, customizable, self-documenting real-time
display editor.  Emacs contains special code editing features, an
extension language (Emacs Lisp), and the capability to read mail, news
and more without leaving the editor.

This package includes things you need to run the Emacs editor, so you
need to install this package if you intend to use Emacs.  You also
need to install the actual Emacs program package (%name-nox or
%name-X11).  Install %name-nox if you are not going to use the X
Window System; install %name-X11 if you will be using X.

%package el
Summary: The sources for Lisp programs included with GNU Emacs
Group: Development/Other
Requires: %name-common = %version-%release
Obsoletes: %shortname-el
Provides: %shortname-el = %version-%release

%description el
Emacs-el contains the Emacs Lisp sources for many of the programs
included with the main GNU Emacs text editor package.

You need to install %name-el only if you intend to modify any of the
Emacs packages or see some Lisp examples.

If you need the sources for %name-leim, install %name-leim-el.

%package leim
Summary: GNU Emacs Lisp code for input methods for internationalization
Group: Editors
Requires: %name-common = %version-%release
Obsoletes: %shortname-leim
Provides: %shortname-leim = %version-%release

%description leim
The Lisp code for input methods for various international scripts for GNU Emacs.

%package leim-el
Summary: The Emacs Lisp source code for input methods included in %name-leim
Group: Development/Other
Requires: %name-leim = %version-%release
Obsoletes: %shortname-leim-el
Provides: %shortname-leim-el = %version-%release

%description leim-el
Emacs-leim-el contains the Emacs Lisp sources for the Emacs Lisp code
for input methods for various international scripts of GNU Emacs.

You need to install %name-leim-el only if you intend to modify any of theses
GNU Emacs packages, see some Lisp examples or for reference for configuring your
localized input methods.

#

%package nox
Summary: The GNU Emacs text editor without support for the X Window System
Group: Editors
PreReq: %name-common = %version-%release
Provides: %name = %version-%release
Requires: emacs-base
Provides: emacsen
Provides: %shortname = %version-%release
Obsoletes: %shortname-nox
Provides: %shortname-nox = %version-%release

%description nox
Emacs-nox is the GNU Emacs text editor program without support for
the X Window System.

You need to install this package only if you plan on exclusively using
GNU Emacs without the X Window System (%name-X11 will work both in X and out
of X, but %name-nox will only work outside of X).  You will also need to
install the %name-common package in order to run GNU Emacs.

#

%package X11
Summary: The GNU Emacs text editor for the X Window System
Group: Editors
PreReq: %name-common = %version-%release
Provides: %name = %version-%release
Requires: emacs-base
Provides: emacsen
Provides: %shortname = %version-%release
Conflicts: app-defaults < 0.2.1-alt1
Obsoletes: %shortname-X11
Provides: %shortname-X11 = %version-%release

%description X11
Emacs-X11 includes the GNU Emacs text editor program for use with the X
Window System (it provides support for the mouse and other GUI
elements).  Emacs-X11 will also run GNU Emacs outside of X, but it has a
larger memory footprint than the 'non-X' GNU Emacs package (%name-nox).

Install %name-X11 if you are going to use Emacs with the X Window
System.  You should also install %name-X11 if you are going to run
GNU Emacs both with and without X (it will work fine both ways).  You will
also need to install the %name-common package in order to run Emacs.

%prep
%setup -q -b1 -n %shortname-%version

%patch0 -p1
%patch1 -p1
# The indicator turned off in GNU's 21.2 release, the patch no needed so far.
#%patch2 -p1
%patch3 -p1

%patch4 -p1
%patch5 -p1 -b .ctrl
%patch6 -p2
%patch7 -p1
%patch8 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1

# tutorial in Russian:

cp %SOURCE2 etc

cp %SOURCE3 lisp/mail/smtpmail.el

# Ukrainian docs:

cp %SOURCE16 .
cp %SOURCE17 .
cp %SOURCE18 .
cp %SOURCE7 .

%patch20 -p1
%patch21 -p1
%patch22 -p0
%patch23 -p1
%patch24 -p1

# add support for prereq-features of language-environment-info

%patch34 -p1
# add CP*-based lang-envs and font support:
%patch33 -p1

%patch35 -p1

# support for russianw ispell dictionary is moved to Patch24


perl -pi -e 's|(\.\./info/[[:alpha:]-]+)|$1.info|g' man/*
rm -f info/*

%define Substage printf 'Substage #%s. %s:\\n'

# We build two binaries (with X and without X support)

# in several symmetric substages.

%Substage 0 "Clear and create the both build directories"
[ -d build-nox ] && %__rm -rf build-nox; %__mkdir_p build-nox
[ -d build-withx ] && %__rm -rf build-withx; %__mkdir_p build-withx

%build
%__autoconf
# Try to detect errors and break on errors:
%define detect_elisp_errs 2>&1 | awk '/!! /{ r++; } END{ if (r) printf "There were %%d errors while recompiling Emacs Lisp modules.\\n", r; exit r; } /.*/'

# We do not want to use anything from an existing Emacs installation:

export EMACSLOADPATH="$(pwd)"/lisp

%Substage 1 "Configure"
%define _configure_script ../configure
pushd build-nox
%configure --sharedstatedir=/var --with-gcc --with-pop --with-x=no
popd
pushd build-withx
%configure --sharedstatedir=/var --with-gcc --with-pop --with-x-toolkit --with-png --with-jpeg --with-xpm --with-gif --with-tiff
popd

%Substage 2 "Initial make all"
#no SMP
pushd build-nox; make; popd
pushd build-withx; make; popd

%Substage 3 "Make supplementary (and important) things only once (asymmetricly)
(for possibly more capabilities -- in the X build)"
pushd build-withx
make -C man
{
   # Recompile so that the patches we have applied are effective:
   # The goal `updates' should update all the generated code
   # (autoloads, custom-deps etc.).
   # Also compile php-mode and the small new file for Cyrillic support.
   make -C lisp \
updates \
international/cyrillic-codepages-setup.elc \
recompile
# progmodes/php-mode.elc \
} %detect_elisp_errs
popd # build-withx

%Substage 4 "Final make all (now that we have all patched Lisp code compiled,
also a bit asymmetric), clean previous binaries"
#no SMP
pushd build-withx
 %__rm -f src/emacs src/emacs-*
 make
popd
pushd build-nox
 # Override some data with more complete from the X build
 # (exactly the X variant of the data will be included in the package,
 # so emacs-nox has to work correctly in this environment):
 %__rm -rf etc leim; %__ln_s -f ../build-withx/{etc,leim} .
 %__rm -f src/emacs src/emacs-*
 make
popd


%install
mkdir -p "$RPM_BUILD_ROOT"%prefix
%makeinstall -C build-withx INSTALL_INFO=%__install_info
install -p -m755 build-nox/src/%shortname "$RPM_BUILD_ROOT"%_bindir/%name-nox
mv $RPM_BUILD_ROOT%_bindir/%shortname-%version $RPM_BUILD_ROOT%_bindir/%name-X11
# remove the installed duplicate emacs binary
# -- it'll be a link managed by `alternatives':
%__rm -f "$RPM_BUILD_ROOT"%_bindir/%shortname


# All the install's below have nothing to do with the Source directory

# So we want to make the command arguments shorter
# by replacing "$RPM_BUILD_ROOT" with "."
pushd "$RPM_BUILD_ROOT" # there will be a popd below

# leim's Makefile doesn't ignore .orig; remnove them:

find .%_datadir/%shortname/%version/leim -type f -name '*.orig' -print0 \
| xargs -0 rm -f

# Compress some files:

#{
#    cat %SOURCE40 | sed -e 's:^:.%_datadir/%shortname/%version/:'
#    for o in .%_datadir/%shortname/%version/lisp/obsolete/*.elc; do echo "$o"; done  
#} | xargs gzip -9 -v 2>&1 | sed -e 's at :.*$ at .gz at ' | xargs zme

# Site start configuration:

# Link to a file provided by emacsen-startscripts pkg:
(cd .%_datadir/emacs/%version/lisp; ln -s ../../../../..%_sysconfdir/emacs/site-start.el)
# making start scripts
%__mkdir -p %buildroot%_sysconfdir/emacs/site-start.d/
%__install -p -m0644 %SOURCE41 %buildroot%_sysconfdir/emacs/site-start.d


#######################

# Various other stuff #
#######################

%__mkdir -p .%_libdir/%shortname/site-lisp

%__mv .%_mandir/man1/{,g}ctags.1
%__mv .%_bindir/{,g}ctags

# Exclude speedbar:

%__rm -f .{%_datadir/%shortname/%version/lisp,%_infodir}/speedbar*

# Exclude antlr-mode:

%__rm -f .%_datadir/%shortname/%version/lisp/progmodes/antlr-mode.el*

# Remove Gnus:

%__rm -f .%_datadir/%shortname/%version/lisp/gnus/format-spec*
%__rm -rf .%_datadir/%shortname/%version/lisp/gnus
%__rm -f .%_infodir/{gnus,emacs-mime,message}*
%__rm -rf .%_datadir/%shortname/%version/etc/gnus*

%__rm -f .%_infodir/info*


################

# Menu support #
################
%__install -d $RPM_BUILD_ROOT%_menudir
%__install -p -m644  %SOURCE22 $RPM_BUILD_ROOT%_menudir/%name-X11
%__install -p -m644 -D %SOURCE12 .%_miconsdir/%name.xpm
%__install -p -m644 -D %SOURCE13 .%_iconsdir/%name.xpm
%__install -p -m644 -D %SOURCE14 .%_liconsdir/%name.xpm

########################

# Alternatives support #
########################
%__install -d $RPM_BUILD_ROOT%_altdir
%__install -p -m644 %SOURCE24 $RPM_BUILD_ROOT%_altdir/%name

###############

# X resources #
###############
xrdir=%_sysconfdir/X11/app-defaults
%__mkdir_p ."$xrdir"
%__install -p -m0644 %SOURCE31 ."$xrdir/Emacs"
unset xrdir


popd # "$RPM_BUILD_ROOT"

#####################

# Create file lists #
#####################
# INFO
%define common_infos ada-mode,autotype,ccmode,cl,dired-x,ebrowse,ediff,efaq,%shortname,eshell,eudc,forms,idlwave,mh-e,pcl-cvs,reftex,sc,vip,viper,widget,woman
%define gnus_infos emacs-mime,gnus,message
%define gnus_infos_pattern gnus\\|emacs-mime\\|message

# source emacs pgktools (bash functions that call el-functions)

. %_libdir/%shortname/el-pkgutils.sh
EMACS_BIN="%name-nox"
EMACS_SEARCH_ROOT="$RPM_BUILD_ROOT"
EL_PKGUTILS_ROOT=""
# Clear the lists:
%__rm -f {main,leim}{,-el}.ls info.ls

# Generate them:

# INFO
common_infos=( $(ls "$RPM_BUILD_ROOT"%_infodir/*.info* \
| sed -e "s:^$RPM_BUILD_ROOT%_infodir/::" \
| sed -e 's:\.info.*$::' | sort -u \
| egrep -v %gnus_infos_pattern ) )

( # save IFS
IFS=,
if [[ '%common_infos' != "${common_infos[*]}" ]]; then
echo "common_infos lists do not match, correct them!"
exit 1
fi
) || false

fraction \
'(dirs "%_libdir/%shortname/%version" "%dir") "main.ls"' \
'(files "%_libdir/%shortname/%version"
   (lambda(f) (if (string-match "/movemail$" f) "%attr(-,root,mail)")) )
 "main.ls"' \
\
'(dirs "%_datadir/%shortname/%version/etc" "%dir") "main.ls"' \
'(files "%_datadir/%shortname/%version/etc"
   (lambda(f) (if (string-match "gnus" f) "#")) )
 "main.ls"'

standard_fraction_el_elc main "%_datadir/%shortname/%version/lisp"
standard_fraction_el_elc leim "%_datadir/%shortname/%version/leim"

# INFO

printf '%s\n' %_infodir/{%common_infos}'.info*' >> main.ls

# Prepare the trick for linking etc/ into docs:

%__ln_s %_datadir/%shortname/%version/etc etc/

# common

%post common
%register_alternatives %name -- emacs
%install_info {%common_infos}.info

%preun common
%unregister_alternatives %name
%uninstall_info {%common_infos}.info

# nox

%post nox
%update_alternatives
%preun nox
%remove_alternatives %_bindir/emacs21-nox

# X11

%post X11
%update_alternatives
%update_menus

%preun X11
%remove_alternatives %_bindir/emacs21-X11

%postun X11
%clean_menus

#

%files common -f main.ls
%doc AUTHORS BUGS README README.KOI8-U README.UK CHANGES.ukr INSTALL.ukr
# The trick for symlinking etc/:
%doc --no-dereference etc/etc

# %config(noreplace) %_sysconfdir/emacs/site-start.d/php.el


%_altdir/%name

%_bindir/*
%exclude %_bindir/%name-nox
%exclude %_bindir/%name-X11

%_mandir/man?/*

%dir %_libdir/%shortname/site-lisp

#%dir %_emacslispdir

%_emacslispdir/*.el*
%dir %_datadir/%shortname/%version
%dir %_datadir/%shortname/%version/site-lisp
%_datadir/%shortname/%version/site-lisp/*
%dir %_datadir/%shortname/%version/leim

# Some .el-files that have .elc-companions,

# but are still preferrable to have in the main
# package (for reference) may be listed here:
#%_datadir/%name/%version/lisp/bindings.el -- probably there is no need for this
#%_datadir/%name/%version/lisp/mail/sc.el
#%_datadir/%name/%version/lisp/term-nasty.el

# This should be a symlink

%_datadir/emacs/%version/lisp/site-start.el

%_sysconfdir/emacs/site-start.d/*

%files el -f main-el.ls

#

%files leim -f leim.ls

%files leim-el -f leim-el.ls

#

%files nox
%_bindir/%name-nox

#

%files X11
#%_bindir/%name-%version
%_bindir/%name-X11

%config(noreplace) %_sysconfdir/X11/app-defaults/*

%_menudir/%name-X11

%_iconsdir/%name.xpm
%_miconsdir/%name.xpm
%_liconsdir/%name.xpm

%changelog

Полный changelog можно просмотреть здесь

 
design & coding: Vladimir Lettiev aka crux © 2004-2005