%undefine _hardened_build # This file is encoded in UTF-8. -*- coding: utf-8 -*- Summary: GNU Emacs text editor Name: emacs Epoch: 1 Version: 28.1 Release: 1%{?dist} License: GPLv3+ URL: http://www.gnu.org/software/emacs/ Group: Applications/Editors Source0: ftp://ftp.gnu.org/gnu/emacs/emacs-%{version}.tar.xz BuildRequires: atk-devel BuildRequires: cairo-devel BuildRequires: freetype-devel BuildRequires: fontconfig-devel BuildRequires: dbus-devel BuildRequires: giflib-devel BuildRequires: glibc-devel BuildRequires: libpng-devel BuildRequires: libjpeg-devel BuildRequires: libtiff-devel BuildRequires: libX11-devel BuildRequires: libXau-devel BuildRequires: libXdmcp-devel BuildRequires: libXrender-devel BuildRequires: libXt-devel BuildRequires: libXpm-devel BuildRequires: ncurses-devel BuildRequires: xorg-x11-proto-devel BuildRequires: zlib-devel BuildRequires: gnutls-devel BuildRequires: librsvg2-devel BuildRequires: m17n-lib-devel BuildRequires: libotf-devel BuildRequires: ImageMagick-devel BuildRequires: libselinux-devel BuildRequires: GConf2-devel BuildRequires: alsa-lib-devel BuildRequires: gpm-devel BuildRequires: liblockfile-devel BuildRequires: libxml2-devel BuildRequires: bzip2 BuildRequires: cairo BuildRequires: texinfo BuildRequires: gzip BuildRequires: desktop-file-utils BuildRequires: gtk3-devel BuildRequires: python2-devel Requires: desktop-file-utils dejavu-sans-mono-fonts Requires(preun): %{_sbindir}/alternatives Requires(posttrans): %{_sbindir}/alternatives Requires: emacs-common = %{epoch}:%{version}-%{release} Provides: emacs(bin) = %{epoch}:%{version}-%{release} %define site_lisp %{_datadir}/emacs/site-lisp %define site_start_d %{site_lisp}/site-start.d %define bytecompargs -batch --no-init-file --no-site-file -f batch-byte-compile %define pkgconfig %{_datadir}/pkgconfig %define emacs_libexecdir %{_libexecdir}/emacs/%{version}/%{_host} %description 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 support for X windows. %package common Summary: Emacs common files # The entire source code is GPLv3+ except lib-src/etags.c which is # also BSD. Manual (info) is GFDL. License: GPLv3+ and GFDL and BSD Group: Applications/Editors Requires(preun): /sbin/install-info Requires(preun): %{_sbindir}/alternatives Requires(posttrans): %{_sbindir}/alternatives Requires(post): /sbin/install-info Requires: %{name}-filesystem %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: Lisp source files included with GNU Emacs Group: Applications/Editors Requires: %{name}-filesystem BuildArch: noarch %description el Emacs-el contains the emacs-elisp sources for many of the elisp programs included with the main Emacs text editor package. You need to install emacs-el only if you intend to modify any of the Emacs packages or see some elisp examples. %package filesystem Summary: Emacs filesystem layout Group: Applications/Editors BuildArch: noarch %description filesystem This package provides some directories which are required by other packages that add functionality to Emacs. %prep %setup -q info_files="auth autotype bovine calc ccmode cl dbus dired-x ebrowse ede ediff edt efaq-w32 efaq eieio eintr elisp emacs-gnutls emacs-mime emacs epa erc ert eshell eudc eww flymake forms gnus htmlfontify idlwave ido info mairix-el message mh-e modus-themes newsticker nxml-mode octave-mode org pcl-cvs pgg rcirc reftex remember sasl sc semantic ses sieve smtpmail speedbar srecode todo-mode tramp transient url vhdl-mode vip viper widget wisent woman" cd info for f in $(ls -1 *.info); do f=`echo $f | sed 's/\.info//g'` if [ ! -z "${info_files##*$f*}" ] ;then echo Please update info_files. $f is missing.>&2 exit 1 fi done cd .. # Avoid duplicating doc files in the common subpackage ln -s ../../%{name}/%{version}/etc/COPYING doc ln -s ../../%{name}/%{version}/etc/NEWS doc %build export CFLAGS="-DMAIL_USE_LOCKF $RPM_OPT_FLAGS" %configure --with-dbus --with-gif --with-jpeg --with-png --with-rsvg \ --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3 --with-gpm=no\ --with-modules --with-harfbuzz --with-cairo make bootstrap NATIVE_FULL_AOT=1 make %{?_smp_mflags} # Create pkgconfig file cat > emacs.pc << EOF sitepkglispdir=%{site_lisp} sitestartdir=%{site_start_d} Name: emacs Description: GNU Emacs text editor Version: %{epoch}:%{version} EOF # Create macros.emacs RPM macro file cat > macros.emacs << EOF %%_emacs_version %{version} %%_emacs_ev %{?epoch:%{epoch}:}%{version} %%_emacs_evr %{?epoch:%{epoch}:}%{version}-%{release} %%_emacs_sitelispdir %{site_lisp} %%_emacs_sitestartdir %{site_start_d} %%_emacs_bytecompile /usr/bin/emacs -batch --no-init-file --no-site-file --eval '(progn (setq load-path (cons "." load-path)))' -f batch-byte-compile EOF %install make install INSTALL="%{__install} -p" DESTDIR=%{buildroot} # Do not compress the files which implement compression itself (#484830) gunzip %{buildroot}%{_datadir}/emacs/%{version}/lisp/jka-compr.el.gz gunzip %{buildroot}%{_datadir}/emacs/%{version}/lisp/jka-cmpr-hook.el.gz # Make sure movemail isn't setgid chmod 755 %{buildroot}%{emacs_libexecdir}/movemail mv %{buildroot}%{_bindir}/{etags,etags.emacs} mv %{buildroot}%{_mandir}/man1/{ctags.1.gz,gctags.1.gz} mv %{buildroot}%{_mandir}/man1/{etags.1.gz,etags.emacs.1.gz} mv %{buildroot}%{_bindir}/{ctags,gctags} # BZ 927996 mv %{buildroot}%{_infodir}/{info.info.gz,info.gz} mkdir -p %{buildroot}%{site_lisp}/site-start.d # Install pkgconfig file mkdir -p %{buildroot}/%{pkgconfig} install -p -m 0644 emacs.pc %{buildroot}/%{pkgconfig} # Install rpm macro definition file mkdir -p %{buildroot}%{_sysconfdir}/rpm install -p -m 0644 macros.emacs %{buildroot}%{_sysconfdir}/rpm/ # After everything is installed, remove info dir rm -f %{buildroot}%{_infodir}/dir # # Create file lists # rm -f *-filelist {common,el}-*-files ( TOPDIR=${PWD} cd %{buildroot} find .%{_datadir}/emacs/%{version}/lisp \ \( -type f -name '*.elc' \ -fprint $TOPDIR/common-lisp-none-elc-files \) \ -o \( -type d -fprintf $TOPDIR/common-lisp-dir-files "%%%%dir %%p\n" \) \ -o \( -name '*.el.gz' -fprint $TOPDIR/el-bytecomped-files \ -o -fprint $TOPDIR/common-not-comped-files \) ) # Put the lists together after filtering ./usr to /usr sed -i -e "s|\.%{_prefix}|%{_prefix}|" *-files cat common-*-files > common-filelist cat el-*-files common-lisp-dir-files > el-filelist %post %preun %postun %posttrans %post common for f in %{info_files}; do /sbin/install-info %{_infodir}/$f.info.gz %{_infodir}/dir 2> /dev/null || : done %preun common if [ "$1" = 0 ]; then for f in %{info_files}; do /sbin/install-info --delete %{_infodir}/$f.info.gz %{_infodir}/dir 2> /dev/null || : done fi %posttrans common %files %{_bindir}/emacs-%{version} %{_datadir}/icons/hicolor/*/apps/emacs.png %{_datadir}/icons/hicolor/scalable/apps/emacs.svg %{_datadir}/icons/hicolor/scalable/apps/emacs.ico %{_datadir}/icons/hicolor/scalable/mimetypes/emacs-document.svg %{_datadir}/icons/hicolor/scalable/mimetypes/emacs-document23.svg %{_datadir}/metainfo/emacs.metainfo.xml %{_libdir}/systemd/user/emacs.service %{_datadir}/applications/emacs-mail.desktop %{_datadir}/applications/emacs.desktop %{_datadir}/applications/emacsclient-mail.desktop %{_datadir}/applications/emacsclient.desktop %files -f common-filelist common %{_sysconfdir}/rpm/macros.emacs %{_bindir}/emacs %{_includedir}/emacs-module.h %{_datadir}/emacs/site-lisp/subdirs.el %doc doc/NEWS BUGS README doc/COPYING %{_bindir}/ebrowse %{_bindir}/emacsclient %{_bindir}/etags.emacs %{_bindir}/gctags %{_mandir}/*/* %{_infodir}/* %dir %{_datadir}/emacs/%{version} %{_datadir}/emacs/%{version}/etc %{_datadir}/emacs/%{version}/site-lisp %{_libexecdir}/emacs %files -f el-filelist el %{pkgconfig}/emacs.pc %files filesystem %dir %{_datadir}/emacs %dir %{_datadir}/emacs/site-lisp %dir %{_datadir}/emacs/site-lisp/site-start.d %changelog