%define pkg ess %define pkgname Emacs Speaks Statistics # If the emacs-el package has installed a pkgconfig file, use that to determine # install locations and Emacs version at build time, otherwise set defaults. %if %($(pkg-config emacs) ; echo $?) %define emacs_version 22.1 %define emacs_lispdir %{_datadir}/emacs/site-lisp %define emacs_startdir %{_datadir}/emacs/site-lisp/site-start.d %else %define emacs_version %(pkg-config emacs --modversion) %define emacs_lispdir %(pkg-config emacs --variable sitepkglispdir) %define emacs_startdir %(pkg-config emacs --variable sitestartdir) %endif # If the xemacs-devel package has installed a pkgconfig file, use that # to determine install locations and Emacs version at build time, # otherwise set defaults. %if %($(pkg-config xemacs) ; echo $?) %define xemacs_version 21.5 %define xemacs_lispdir %{_datadir}/xemacs/site-lisp %define xemacs_startdir %{_datadir}/xemacs/site-lisp/site-start.d %else %define xemacs_version %(pkg-config xemacs --modversion) %define xemacs_lispdir %(pkg-config xemacs --variable sitepkglispdir) %define xemacs_startdir %(pkg-config xemacs --variable sitestartdir) %endif Name: emacs-common-%{pkg} Version: 5.11 Release: 2%{?dist} Summary: %{pkgname} add-on package for Emacs Group: Applications/Editors License: GPLv2+ URL: http://ESS.R-project.org/ Source0: http://ESS.R-project.org/downloads/ess/ess-%{version}.tgz Patch0: emacs-ess-5.11-fix-site-start.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: emacs emacs-el BuildRequires: xemacs-devel xemacs-packages-extra BuildRequires: texinfo-tex BuildRequires: tex(latex) Requires(post): /sbin/install-info Requires(preun): /sbin/install-info %description %{pkgname} (ESS) is an add-on package for GNU Emacs and XEmacs. It provides Emacs-based front ends for popular statistics packages. ESS provides an intelligent, consistent interface between the user and the software. ESS interfaces with S-PLUS, R, SAS, BUGS and other statistical analysis packages under the Unix, Microsoft Windows, and Apple Mac OS operating systems. ESS is a package for the GNU Emacs and XEmacs text editors whose features ESS uses to streamline the creation and use of statistical software. ESS knows the syntax and grammar of statistical analysis packages and provides consistent display and editing features based on that knowledge. ESS assists in interactive and batch execution of statements written in these statistical analysis languages. This package contains the files common to both the GNU Emacs and XEmacs %{pkgname} packages. %package -n emacs-%{pkg} Summary: Compiled elisp files to run %{pkgname} under GNU Emacs Group: Applications/Editors Requires: emacs(bin) >= %{emacs_version} Requires: emacs-common-%{pkg} = %{version}-%{release} %description -n emacs-%{pkg} This package contains the byte compiled elisp packages to run %{pkgname} with GNU Emacs. %package -n emacs-%{pkg}-el Summary: Elisp source files for %{pkgname} under GNU Emacs Group: Applications/Editors Requires: emacs-%{pkg} = %{version}-%{release} %description -n emacs-%{pkg}-el This package contains the elisp source files for %{pkgname} under GNU Emacs. You do not need to install this package to run %{pkgname}. Install the emacs-%{pkg} package to use %{pkgname} with GNU Emacs. %package -n xemacs-%{pkg} Summary: Compiled elisp files to run %{pkgname} under XEmacs Group: Applications/Editors Requires: xemacs(bin) >= %{xemacs_version} Requires: emacs-common-%{pkg} = %{version}-%{release} %description -n xemacs-%{pkg} This package contains the byte compiled elisp packages to use %{pkgname} with XEmacs. %package -n xemacs-%{pkg}-el Summary: Elisp source files for %{pkgname} under XEmacs Group: Applications/Editors Requires: xemacs-%{pkg} = %{version}-%{release} %description -n xemacs-%{pkg}-el This package contains the elisp source files for %{pkgname} under XEmacs. You do not need to install this package to run %{pkgname}. Install the xemacs-%{pkg} package to use %{pkgname} with XEmacs. %prep %setup -q -n %{pkg}-%{version} %patch0 -p0 ( cd doc && chmod u+w html info ) # fix perms to ensure builddir can be deleted %build ## first build GNU Emacs for D in lisp etc do cd $D make cd - done ## build all docs cd doc make cd - # create an init file that is loaded when a user starts up emacs to # tell emacs to autoload our package's Emacs code when needed cat > %{name}-init.el <<"EOF" ;;; Set up %{name} for Emacs. ;;; ;;; This file is automatically loaded by emacs's site-start.el ;;; when you start a new emacs session. (require 'ess-site) EOF %install rm -rf $RPM_BUILD_ROOT ## now install GNU Emacs elisp INITDIR=${RPM_BUILD_ROOT}%{emacs_startdir} PKGLISP=${RPM_BUILD_ROOT}%{emacs_lispdir}/%{pkg} ETCDIR=${PKGLISP}/etc INFODIR=${RPM_BUILD_ROOT}%{_infodir} %{__install} -m 755 -d $INITDIR %{__install} -m 644 %{name}-init.el $INITDIR/%{pkg}-init.el %{__install} -m 755 -d $PKGLISP %{__install} -m 755 -d $INFODIR %{__make} install \ PREFIX=${RPM_BUILD_ROOT}%{_prefix} \ LISPDIR=$PKGLISP \ INFODIR=$INFODIR \ DOCDIR=${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version} \ ETCDIR=$ETCDIR \ ETCFILES="backbug? *.S ess-sas-sh-command config.guess" %{__rm} -f $INFODIR/dir # don't package but instead update in pre and post %{__mv} $PKGLISP/ChangeLog ChangeLog.lisp ## now build and XEmacs elisp make clean INITDIR=${RPM_BUILD_ROOT}%{xemacs_startdir} PKGLISP=${RPM_BUILD_ROOT}%{xemacs_lispdir}/%{pkg} ETCDIR=${PKGLISP}/etc INFODIR=${RPM_BUILD_ROOT}%{_infodir} for D in lisp etc do cd $D make EMACS=xemacs cd - done ## build all docs (again) cd doc make cd - %{__install} -m 755 -d $INITDIR %{__install} -m 644 %{name}-init.el $INITDIR/%{pkg}-init.el %{__install} -m 755 -d $PKGLISP %{__install} -m 755 -d $INFODIR %{__make} install \ PREFIX=${RPM_BUILD_ROOT}%{_prefix} \ LISPDIR=$PKGLISP \ INFODIR=$INFODIR \ DOCDIR=${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version} \ ETCDIR=$ETCDIR \ ETCFILES="backbug? *.S ess-sas-sh-command config.guess" %{__rm} -f $INFODIR/dir # don't package but instead update in pre and post ## remove ChangeLog in lisp subdir completely here (already packaged in -common) %{__rm} $PKGLISP/ChangeLog ## now fix permissions on doc files that aren't UTF-8 for i in ChangeLog ChangeLog.lisp doc/TODO do /usr/bin/iconv -f iso8859-1 -t utf-8 $i > $i.conv && /bin/mv -f $i.conv $i done %clean rm -rf $RPM_BUILD_ROOT %post /sbin/install-info %{_infodir}/ess.info.gz %{_infodir}/dir || : %preun if [ $1 = 0 ]; then /sbin/install-info --delete %{_infodir}/ess.info.gz \ %{_infodir}/dir || : fi %files %defattr(-,root,root,-) %doc README ANNOUNCE COPYING VERSION ChangeLog doc ChangeLog.lisp %doc fontlock-test %doc LDA %doc etc/sas-keys.* %doc etc/function-outline.S %doc etc/R-ESS-bugs.R %doc etc/other %doc %{_infodir}/*.gz %files -n emacs-%{pkg} %defattr(-,root,root,-) %{emacs_lispdir}/%{pkg}/*.elc %{emacs_lispdir}/%{pkg}/etc %{emacs_startdir}/*.el %dir %{emacs_lispdir}/%{pkg} %files -n emacs-%{pkg}-el %defattr(-,root,root,-) %{emacs_lispdir}/%{pkg}/*.el %files -n xemacs-%{pkg} %defattr(-,root,root,-) %{xemacs_lispdir}/%{pkg}/*.elc %{xemacs_lispdir}/%{pkg}/etc %{xemacs_startdir}/*.el %dir %{xemacs_lispdir}/%{pkg} %files -n xemacs-%{pkg}-el %defattr(-,root,root,-) %{xemacs_lispdir}/%{pkg}/*.el %changelog * Fri Oct 15 2010 Alex Lancaster <alexlan[AT]fedoraproject org> - 5.11-2 - Add patch to use ".r$" as regex in start start (workaround for problems with XEmacs misidentify Perl scripts as R scripts #631707) * Sun Jul 18 2010 Alex Lancaster <alexlan[AT]fedoraproject org> - 5.11-1 - Update to upstream 5.11 (#594669) * Sun May 16 2010 Alex Lancaster <alexlan[AT]fedoraproject org> - 5.8-1 - Update to upstream 5.8 (#544472). - Fixes problems with help() function in recent R releases. * Wed Nov 4 2009 Alex Lancaster <alexlan[AT]fedoraproject org> - 5.5-1 - Update to latest upstream (5.5) - Build all docs, PDF, DVI no longer distributed in tarball * Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.3.10-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.3.10-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sun Jan 18 2009 Alex Lancaster <alexlan[AT]fedoraproject org> - 5.3.10-1 - Update to latest upstream (5.3.10) - Add BR: texinfo-tex - Fix paths to installation of documentation * Mon Aug 4 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 5.3.8-1 - Update to latest upstream (5.3.8) * Tue Apr 29 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 5.3.7-1 - Update to new upstream release (5.3.7) * Sun Nov 18 2007 <alexlan@fedoraproject.org> - 5.3.6-2 - Moved all non-code related files in etc/ to documentation directory - Make sure all doc files are UTF-8 - Fix post, preun scriptlets and add Requires for installing info files * Tue Nov 13 2007 <alexlan@fedoraproject.org> - 5.3.6-1 - Initial packaging, borrowed some elements of package by Tom Moertel <tom-rpms@moertel.com>