%define HAVE_EMACS %(type -p emacs >/dev/null 2>/dev/null && echo 1 || echo 0) %define HAVE_XEMACS %(test `rpm -q --qf %'{VERSION}' xemacs` '<' 21.4.17 && echo 0 || echo 1) %define FOR_SUSE %{?suse_version:1}%{!?suse_version:0} %define docu_type .dvi %define emacsstart %{emacssite}/site-start.d %if %{FOR_SUSE} %define distri .suse %define commongroup Productivity/Editors/Emacs %define emacsinfo %{_infodir} %define xemacsinfo %{_datadir}/xemacs/info %define xemacssite %{_datadir}/xemacs/xemacs-packages %define autodir /var/auctex %define startupfile %{_datadir}/emacs/site-lisp/suse-start-%{name}.el %else %define distri .fedora %define commongroup Applications/Editors %define emacsinfo %{_infodir} %define xemacsinfo %{_datadir}/xemacs/info %define xemacssite %{_datadir}/xemacs/site-packages %define autodir /usr/var/auctex %define startupfile %{_datadir}/emacs/site-lisp/site-start.d/%{name}-init.el %endif %define emacssite %{_datadir}/emacs/site-lisp %define doclist RELEASE COPYING INSTALL README TODO FAQ CHANGES Summary: Enhanced TeX modes for Emacsen Name: auctex Version: 11.53 Release: 5%{distri} License: GPL Group: %{commongroup} URL: http://www.gnu.org/software/auctex/ Source0: ftp://ftp.gnu.org/pub/gnu/auctex/%{name}-%{version}.tar.bz2 BuildArchitectures: noarch BuildRoot: %{_tmppath}/%{name}-root %description AUCTeX is an extensible package that supports writing and formatting TeX files for most variants of Emacs. AUCTeX supports many different TeX macro packages, including AMS-TeX, LaTeX, Texinfo and basic support for ConTeXt. Documentation can be found under %{_defaultdocdir}/%{name}-%{version}, e.g. the reference card (tex-ref.pdf) and the FAQ. The AUCTeX manual is available in Emacs info (C-h i d m AUCTeX RET). On the AUCTeX home page, manuals in various formats are provided. %package common Summary: Enhanced TeX mode for Emacsen (common files for GNU and X) Group: %{commongroup} Provides: auctex %description common AUCTeX is a comprehensive, customizable, integrated environment for writing, editing and processing input files for LaTeX using Emacs. AUCTeX supports many different TeX macro packages, including AMS-TeX, LaTeX, Texinfo and basic support for ConTeXt. Documentation can be found under %{_defaultdocdir}/%{name}-%{version}, e.g. the reference card (tex-ref.pdf) and the FAQ. The AUCTeX manual is available in Emacs info (C-h i d m AUCTeX RET). On the AUCTeX home page, manuals in various formats are provided. You have in addition to install the package %{name}-emacs or %{name}-xemacs %package emacs Summary: Enhanced TeX modes for GNU Emacs Group: %{commongroup} Obsoletes: ge_auc emacs-auctex Requires: emacs >= 21 Requires: %{name}-common %description emacs AUCTeX is an extensible package that supports writing and formatting TeX files for most variants of Emacs. AUCTeX supports many different TeX macro packages, including AMS-TeX, LaTeX, Texinfo and basic support for ConTeXt. Documentation can be found under %{_defaultdocdir}/%{name}-%{version}, e.g. the reference card (tex-ref.pdf) and the FAQ. The AUCTeX manual is available in Emacs info (C-h i d m AUCTeX RET). On the AUCTeX home page, manuals in various formats are provided. This package contains the files for GNU Emacs. This .rpm enables AUCTeX system-wide. If you do not want this, install/upgrade with 'rpm --nopre ...' (the activation is done in the preinstall script). %package emacs-el Summary: Enhanced TeX modes for GNU Emacs (.el source files) Group: %{commongroup} Requires: %{name}-emacs %description emacs-el AUCTeX is an extensible package that supports writing and formatting TeX files for most variants of Emacs. AUCTeX supports many different TeX macro packages, including AMS-TeX, LaTeX, Texinfo and basic support for ConTeXt. Documentation can be found under %{_defaultdocdir}/%{name}-%{version}, e.g. the reference card (tex-ref.pdf) and the FAQ. The AUCTeX manual is available in Emacs info (C-h i d m AUCTeX RET). On the AUCTeX home page, manuals in various formats are provided. This package contains the source .el-files for GNU Emacs. These files are not needed to run auctex. %package xemacs Summary: Enhanced TeX modes for XEmacs Group: %{commongroup} Requires: xemacs >= 21 Requires: %{name}-common %description xemacs AUCTeX is an extensible package that supports writing and formatting TeX files for most variants of Emacs. AUCTeX supports many different TeX macro packages, including AMS-TeX, LaTeX, Texinfo and basic support for ConTeXt. Documentation can be found under %{_defaultdocdir}/%{name}-%{version}, e.g. the reference card (tex-ref.pdf) and the FAQ. The AUCTeX manual is available in Emacs info (C-h i d m AUCTeX RET). On the AUCTeX home page, manuals in various formats are provided. This package contains the files for XEmacs. %package xemacs-el Summary: Enhanced TeX mode for XEmacs (.el source files) Group: %{commongroup} Requires: %{name}-xemacs %description xemacs-el AUCTeX is an extensible package that supports writing and formatting TeX files for most variants of Emacs. AUCTeX supports many different TeX macro packages, including AMS-TeX, LaTeX, Texinfo and basic support for ConTeXt. Documentation can be found under %{_defaultdocdir}/%{name}-%{version}, e.g. the reference card (tex-ref.pdf) and the FAQ. The AUCTeX manual is available in Emacs info (C-h i d m AUCTeX RET). On the AUCTeX home page, manuals in various formats are provided. This package contains the source .el-files for XEmacs. These files are not needed to run auctex. %prep umask 022 test -n '%{buildroot}' || { echo "Must use buildroot" ; exit 1 ; } %setup -c chmod -R u+w,a+rX,go-w * # This .spec should work no matter whether the path in the archive # starts with %{name}-%{version}/ or %{name}/ or ./: test -d %{name}-%{version} || mkdir %{name}-%{version} mv * %{name}-%{version} || true %if %{HAVE_EMACS} %if %{HAVE_XEMACS} cp -a %{name}-%{version} xemacs %endif mv %{name}-%{version} emacs %else %if %{HAVE_XEMACS} mv %{name}-%{version} xemacs %else echo "Cannot build: Neither Emacs nor Xemacs were found." ; exit 1 %endif %endif %build umask 022 cd "$RPM_BUILD_DIR"/%{name}-%{version} for i in *emacs; do pushd "$i" if [ "$i" = 'emacs' ]; then CURRINFO='%{emacsinfo}' CURRSITE='%{emacssite}' else CURRINFO='%{xemacsinfo}' CURRSITE='%{xemacssite}' fi # The below will make the package build from a tar straight from CVS # NOT RECOMMENDED, but useful for testing! test -f ./configure || ./autogen.sh # --with-texmf-dir overrides local docstrip configurations. %configure "--with-$i" '--with-texmf-dir=%{_datadir}/texmf' \ --with-packagedir="$CURRSITE" make pushd doc make auctex if [ ! -e '../../tex-ref%{docu_type}' ]; then make 'tex-ref%{docu_type}' mv 'tex-ref%{docu_type}' ../.. fi popd cp -a %doclist .. popd done %install umask 022 cd "$RPM_BUILD_DIR"/%{name}-%{version} test -n '%{buildroot}' test -d '%{buildroot}' && rm -rf '%{buildroot}' for i in *emacs; do pushd "$i" if [ "$i" = 'emacs' ]; then CURRINFO='%{emacsinfo}' CURRSITE='%{emacssite}' else CURRINFO='%{xemacsinfo}' CURRSITE='%{xemacssite}' fi mkdir -p "%{buildroot}$CURRSITE" mkdir -p "%{buildroot}$CURRINFO" %makeinstall install-contrib install-info # Let $i-el.lst be the list of all el-files in auctex # for which a corresponding elc-file exists. # Let $i.lst be the list of all remaining files and of all directories # (for directories add the dir-prefix). # Moreover, we start both files with defattr(-,root,root). pushd .. find "%{buildroot}/$CURRSITE/auctex" -type f | \ sed 's!^%{buildroot}!!' | sort > full grep '\.elc$' full | sed 's/c$//' > part { echo %'defattr(-,root,root)' ; comm -2 -3 full part ; } > "$i.lst" { echo %'defattr(-,root,root)' ; cat part ; } > "$i-el.lst" find "%{buildroot}/$CURRSITE/auctex" -type d | \ sed 's!^%{buildroot}!%'dir' !' >> "$i.lst" rm full part popd # Remove dir file that has been created by the makeinfo calls because this # file will not be included in the rpm distribution (make RPM 4.1+ happy) rm -f "%{buildroot}$CURRINFO"/dir # Compress infodir gzip -9f "%{buildroot}$CURRINFO"/* popd done %pre emacs echo "; Autoactivation of AUCTeX" > '%{startupfile}' echo "; Created by %{name}-%{version}-%{release}.noarch.rpm" >> \ '%{startupfile}' echo "(require 'tex-site)" >> '%{startupfile}' %post emacs /sbin/install-info --info-dir=%{emacsinfo} %{emacsinfo}/auctex.gz %preun emacs # $1 is the number of versions of this package installed # after this uninstallation if [ $1 -eq 0 ]; then /sbin/install-info --delete --info-dir='%{emacsinfo}' '%{emacsinfo}'/auctex.gz rm -f '%{startupfile}' fi %clean test -n '%{buildroot}' -a -d '%{buildroot}' && rm -rf '%{buildroot}' %files common %doc %doclist tex-ref%{docu_type} %if %{HAVE_EMACS} %files emacs -f emacs.lst %defattr(-,root,root) %dir %{emacssite}/auctex %{emacsinfo}/* %{autodir} %config %{emacssite}/tex-site.el %files emacs-el -f emacs-el.lst %defattr(-,root,root) %endif %if %{HAVE_XEMACS} %files xemacs -f xemacs.lst %defattr(-,root,root) %dir %{xemacssite}/auctex %{xemacsinfo}/* %{autodir} %files xemacs-el -f xemacs-el.lst %defattr(-,root,root) %endif %changelog * Sun Oct 03 2004 Martin Väth - Corrected startup-file. WARNING: If you used one of the previous versions of this .spec, the file /suse-start-auctex.el or /auctex-init.el was created which is neither used nor removed. Please remove this file manually. * Sun Aug 29 2004 Martin Väth - Update to 11.53 - Corrected wrong storage of directories * Fri Aug 20 2004 Martin Väth - Merge previous two changes * Thu Aug 19 2004 David Kastrup - Change tex-site.el to overwriting config file mode. New naming scheme. * Tue Aug 17 2004 Martin Väth - First attempt to include support for xemacs. - Output consists now of 3 (or 5) packages. * Mon Aug 16 2004 David Kastrup - Attempt a bit of SuSEism. Might work if we are lucky. * Sat Dec 7 2002 David Kastrup - Change addresses to fit move to Savannah. * Mon Apr 15 2002 Jan-Ake Larsson - Adjusted TeX-macro-global and put autoactivation in preinstall script so that it can be chosen at install time. * Tue Feb 19 2002 Jan-Ake Larsson - Added site-start.el support * Sat Feb 16 2002 Jan-Ake Larsson - Prerelease 11.11