%global _hardened_build 1 %bcond_with bootstrap %if "0%{?product_family}" != "0" %bcond_without bootstrap %endif Name: emacs Epoch: 1 Version: 29.4 Release: 1 Summary: An extensible GNU text editor License: GPL-3.0-or-later AND CC0-1.0 URL: https://www.gnu.org/software/emacs Source0: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz Source1: site-start.el Source2: default.el Source3: dotemacs.el Source4: emacs-terminal.sh Source5: emacs.service Source6: emacs.desktop Source7: emacs-terminal.desktop #patch from fedora #https://src.fedoraproject.org/rpms/emacs/blob/rawhide/f/emacs-spellchecker.patch Patch1001: emacs-spellchecker.patch #https://src.fedoraproject.org/rpms/emacs/blob/rawhide/f/emacs-system-crypto-policies.patch Patch1002: emacs-system-crypto-policies.patch Patch9000: emacs-deal-taboo-words.patch BuildRequires: make gcc BuildRequires: autoconf automake libtool BuildRequires: pkgconfig(MagickWand) >= 7 BuildRequires: pkgconfig(alsa) >= 1.0.0 BuildRequires: pkgconfig(cairo) >= 1.8.0 BuildRequires: pkgconfig(cairo-xcb) >= 1.8.0 BuildRequires: pkgconfig(dbus-1) >= 1.0 BuildRequires: pkgconfig(fontconfig) >= 2.2.0 BuildRequires: pkgconfig(freetype2) >= 2.5.0 BuildRequires: pkgconfig(gio-2.0) >= 2.26 BuildRequires: pkgconfig(glib-2.0) >= 2.37.5 BuildRequires: pkgconfig(gnutls) >= 2.12.2 BuildRequires: pkgconfig(gobject-2.0) >= 2.0 BuildRequires: pkgconfig(gtk+-3.0) >= 3.10 BuildRequires: pkgconfig(harfbuzz) >= 0.9.42 BuildRequires: pkgconfig(jansson) >= 2.7 BuildRequires: pkgconfig(lcms2) BuildRequires: pkgconfig(libotf) BuildRequires: pkgconfig(libpng) >= 1.0.0 BuildRequires: pkgconfig(librsvg-2.0) >= 2.14.0 BuildRequires: pkgconfig(libseccomp) >= 2.5.2 BuildRequires: pkgconfig(libsystemd) >= 222 BuildRequires: pkgconfig(libwebpdemux) >= 0.6.0 BuildRequires: pkgconfig(libxml-2.0) > 2.6.17 BuildRequires: pkgconfig(m17n-flt) BuildRequires: pkgconfig(webkit2gtk-4.1) >= 2.12 BuildRequires: pkgconfig(xfixes) >= 4.0.0 BuildRequires: pkgconfig(xft) >= 0.13.0 BuildRequires: pkgconfig(xi) BuildRequires: pkgconfig(xinerama) >= 1.0.2 BuildRequires: pkgconfig(xrandr) >= 1.2.2 BuildRequires: giflib-devel BuildRequires: gpm-devel BuildRequires: libacl-devel BuildRequires: libjpeg-devel BuildRequires: liblockfile-devel BuildRequires: libselinux-devel BuildRequires: libtiff-devel BuildRequires: ncurses-devel BuildRequires: sqlite-devel BuildRequires: zlib-devel BuildRequires: Xaw3d-devel BuildRequires: /usr/bin/makeinfo BuildRequires: /usr/bin/desktop-file-install %ifarch %{ix86} BuildRequires: util-linux %endif Requires: desktop-file-utils dejavu-sans-mono-fonts Requires: emacs-common = %{epoch}:%{version}-%{release} Requires(preun): %{_sbindir}/alternatives Requires(posttrans): %{_sbindir}/alternatives 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 the extensible, customizable, self-documenting real-time display editor. At its core is an interpreter for Emacs Lisp, a dialect of the Lisp programming language with extensions to support text editing. And it is an entire ecosystem of functionality beyond text editing, including a project planner, mail and news reader, debugger interface, calendar, and more. %package devel Summary: Development header files for emacs %description devel Development header files for emacs. %if !%{with bootstrap} %package lucid Summary: GNU Emacs text editor with LUCID toolkit X support Requires: emacs-common = %{epoch}:%{version}-%{release} Requires(preun): %{_sbindir}/alternatives Requires(posttrans): %{_sbindir}/alternatives Provides: emacs(bin) = %{epoch}:%{version}-%{release} %description lucid This package provides an emacs binary with support for X windows using LUCID toolkit. %endif %package nox Summary: GNU Emacs text editor without X support Requires: emacs-common = %{epoch}:%{version}-%{release} Requires(preun): %{_sbindir}/alternatives Requires(posttrans): %{_sbindir}/alternatives Provides: emacs(bin) = %{epoch}:%{version}-%{release} %description nox This package provides an emacs binary with no X windows support for running on a terminal %package common Summary: Emacs common files License: GPLv3+ and GFDL and BSD Requires: %{name}-filesystem = %{epoch}:%{version}-%{release} Requires(preun): /sbin/install-info Requires(preun): %{_sbindir}/alternatives Requires(posttrans): %{_sbindir}/alternatives Requires(post): /sbin/install-info Provides: %{name}-el = %{epoch}:%{version}-%{release} Obsoletes: emacs-el < 1:24.3-29 %description common This package contains all the common files needed by emacs, emacs-lucid or emacs-nox. %package terminal Summary: A desktop menu for GNU Emacs terminal. Requires: emacs = %{epoch}:%{version}-%{release} BuildArch: noarch %description terminal Install emacs-terminal if you need a terminal with Malayalam support. %package filesystem Summary: Emacs filesystem layout BuildArch: noarch %description filesystem Emacs filesystem layout %package_help %prep %autosetup -n %{name}-%{version} -p1 autoconf egrep -v "tetris.elc|pong.elc" lisp/Makefile.in > lisp/Makefile.in.new && mv lisp/Makefile.in.new lisp/Makefile.in rm -f lisp/play/tetris.el* lisp/play/pong.el* %define info_files ada-mode 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 newsticker nxml-mode octave-mode org pcl-cvs pgg rcirc reftex remember sasl sc semantic ses sieve smtpmail speedbar srecode todo-mode tramp url vhdl-mode vip viper widget wisent woman cd info fs=( $(ls *.info) ) is=( %info_files ) files=$(echo ${fs[*]} | sed 's/\.info//'g | sort | tr -d '\n') for i in $(seq 0 $(( ${#fs[*]} - 1 ))); do if test "${fs[$i]}" != "${is[$i]}.info"; then echo Please update %%info_files: ${fs[$i]} != ${is[$i]}.info >&2 break fi done cd .. %ifarch %{ix86} %define setarch setarch %{_arch} -R %else %define setarch %{nil} %endif ln -s ../../%{name}/%{version}/etc/COPYING doc ln -s ../../%{name}/%{version}/etc/NEWS doc %build %ifarch loongarch64 %_update_config_guess %_update_config_sub %endif export CFLAGS="-DMAIL_USE_LOCKF $RPM_OPT_FLAGS -fPIE" # Build GTK+ binary mkdir build-gtk && pushd build-gtk %global _configure ../configure %configure --with-dbus --with-gif --with-jpeg --with-png --with-rsvg --without-gconf \ --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3 --with-gpm=no \ --with-harfbuzz --with-cairo --with-json \ --with-xwidgets --with-modules %make_build bootstrap %{setarch} %make_build popd # Build Lucid binary %if !%{with bootstrap} mkdir build-lucid && pushd build-lucid %configure --with-dbus --with-gif --with-jpeg --with-png --with-rsvg --without-gconf \ --with-tiff --with-xft --with-xpm --with-x-toolkit=lucid --with-gpm=no \ --with-harfbuzz --with-cairo --with-json \ --with-modules %make_build bootstrap %{setarch} %make_build popd %endif # Build binary without X support mkdir build-nox && pushd build-nox %configure --with-x=no --with-modules --with-json --without-gconf %{setarch} %make_build popd # Generate pkgconfig file cat > emacs.pc << EOF sitepkglispdir=%{_datadir}/emacs/site-lisp sitestartdir=%{site_lisp}/site-start.d Name: emacs Description: GNU Emacs text editor Version: %{epoch}:%{version} EOF # Generate 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 %{_datadir}/emacs/site-lisp %%_emacs_sitestartdir %{site_lisp}/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 pushd build-gtk %make_install popd rm %{buildroot}%{_bindir}/emacs touch %{buildroot}%{_bindir}/emacs rm %{buildroot}%{emacs_libexecdir}/emacs-*.pdmp gunzip %{buildroot}%{_datadir}/emacs/%{version}/lisp/jka*.el.gz %if !%{with bootstrap} install -p -m 0755 build-lucid/src/emacs %{buildroot}%{_bindir}/emacs-%{version}-lucid %endif install -p -m 0755 build-nox/src/emacs %{buildroot}%{_bindir}/emacs-%{version}-nox chmod 755 %{buildroot}%{emacs_libexecdir}/movemail # Confirm movemail don't setgid mkdir -p %{buildroot}%{site_lisp} install -p -m 0644 %SOURCE1 %{buildroot}%{_datadir}/emacs/site-lisp/site-start.el install -p -m 0644 %SOURCE2 %{buildroot}%{_datadir}/emacs/site-lisp echo "(setq source-directory \"%{_datadir}/emacs/%{version}/\")" >> %{buildroot}%{_datadir}/emacs/site-lisp/site-start.el pushd %{buildroot}%{_bindir} mv etags etags.emacs mv ctags gctags popd pushd %{buildroot}%{_mandir}/man1 mv ctags.1.gz gctags.1.gz mv etags.1.gz etags.emacs.1.gz popd mv %{buildroot}%{_infodir}/info.info.gz %{buildroot}%{_infodir}/info.gz install -d %{buildroot}%{_datadir}/emacs/site-lisp/site-start.d install -d %{buildroot}/%{_datadir}/pkgconfig install -p -m 0644 emacs.pc %{buildroot}/%{_datadir}/pkgconfig install -d %{buildroot}%{_rpmconfigdir}/macros.d install -p -m 0644 macros.emacs %{buildroot}%{_rpmconfigdir}/macros.d/ install -p -m 755 %SOURCE4 %{buildroot}/%{_bindir}/emacs-terminal rm -f %{buildroot}%{_infodir}/dir install -d %{buildroot}%{_userunitdir} install -p -m 0644 %SOURCE5 %{buildroot}%{_userunitdir}/emacs.service # Emacs 26.1 don't installs the upstream unit file to /usr/lib64 on 64bit archs. rm -f %{buildroot}/usr/lib64/systemd/user/emacs.service mkdir -p %{buildroot}%{_datadir}/applications desktop-file-install --dir=%{buildroot}%{_datadir}/applications \ %SOURCE6 desktop-file-install --dir=%{buildroot}%{_datadir}/applications \ %SOURCE7 # We don't ship the client variants yet rm %{buildroot}%{_datadir}/applications/emacsclient.desktop rm %{buildroot}%{_datadir}/applications/emacsclient-mail.desktop rm -f *-filelist {common,el}-*-files ( TOPDIR=${PWD} cd %{buildroot} find .%{_datadir}/emacs/%{version}/lisp .%{_datadir}/emacs/%{version}/lisp/leim \ .%{_datadir}/emacs/site-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 \) ) sed -i -e "s|\.%{_prefix}|%{_prefix}|" *-files cat common-*-files > common-filelist cat el-*-files common-lisp-dir-files > el-filelist %preun %{_sbindir}/alternatives --remove emacs %{_bindir}/emacs-%{version} %posttrans %{_sbindir}/alternatives --install %{_bindir}/emacs emacs %{_bindir}/emacs-%{version} 80 %if !%{with bootstrap} %preun lucid %{_sbindir}/alternatives --remove emacs %{_bindir}/emacs-%{version}-lucid %{_sbindir}/alternatives --remove emacs-lucid %{_bindir}/emacs-%{version}-lucid %posttrans lucid %{_sbindir}/alternatives --install %{_bindir}/emacs emacs %{_bindir}/emacs-%{version}-lucid 70 %{_sbindir}/alternatives --install %{_bindir}/emacs-lucid emacs-lucid %{_bindir}/emacs-%{version}-lucid 60 %endif %preun nox %{_sbindir}/alternatives --remove emacs %{_bindir}/emacs-%{version}-nox %{_sbindir}/alternatives --remove emacs-nox %{_bindir}/emacs-%{version}-nox %posttrans nox %{_sbindir}/alternatives --install %{_bindir}/emacs emacs %{_bindir}/emacs-%{version}-nox 70 %{_sbindir}/alternatives --install %{_bindir}/emacs-nox emacs-nox %{_bindir}/emacs-%{version}-nox 60 %preun common %{_sbindir}/alternatives --remove emacs.etags %{_bindir}/etags.emacs %posttrans common %{_sbindir}/alternatives --install %{_bindir}/etags emacs.etags %{_bindir}/etags.emacs 80 \ --slave %{_mandir}/man1/etags.1.gz emacs.etags.man %{_mandir}/man1/etags.emacs.1.gz %files %doc doc/NEWS BUGS README %license etc/COPYING %attr(0755,-,-) %ghost %{_bindir}/emacs %{_bindir}/emacs-%{version} %{_datadir}/icons/hicolor/* %{_datadir}/applications/emacs.desktop %{_datadir}/applications/emacs-mail.desktop %{_metainfodir}/%{name}.metainfo.xml %files devel %{_includedir}/emacs-module.h %if !%{with bootstrap} %files lucid %attr(0755,-,-) %ghost %{_bindir}/emacs %attr(0755,-,-) %ghost %{_bindir}/emacs-lucid %{_bindir}/emacs-%{version}-lucid %endif %files nox %attr(0755,-,-) %ghost %{_bindir}/emacs %attr(0755,-,-) %ghost %{_bindir}/emacs-nox %{_bindir}/emacs-%{version}-nox %files common -f common-filelist -f el-filelist %doc doc/NEWS BUGS README %license etc/COPYING %{_rpmconfigdir}/macros.d/macros.emacs %attr(0644,root,root) %config(noreplace) %{_datadir}/emacs/site-lisp/default.el %attr(0644,root,root) %config %{_datadir}/emacs/site-lisp/site-start.el %{_bindir}/gctags %{_bindir}/ebrowse %{_bindir}/emacsclient %{_bindir}/etags.emacs %{_libexecdir}/emacs %{pkgconfig}/emacs.pc %{_userunitdir}/emacs.service %dir %{_datadir}/emacs/%{version} %{_datadir}/emacs/%{version}/etc %{_datadir}/emacs/%{version}/site-lisp %{_infodir}/* %files terminal %{_bindir}/emacs-terminal %{_datadir}/applications/emacs-terminal.desktop %files filesystem %dir %{_datadir}/emacs %dir %{_datadir}/emacs/site-lisp %dir %{_datadir}/emacs/site-lisp/site-start.d %files help %doc doc/NEWS BUGS README %{_mandir}/*/* %changelog * Mon Dec 02 2024 Funda Wang - 1:29.4-1 - update to 29.4 * Tue Jul 02 2024 zhangpan - 1:29.1-3 - fix CVE-2024-39331 * Mon Apr 01 2024 lingsheng - 1:29.1-2 - fix CVE-2024-30202 CVE-2024-30203 CVE-2024-30204 CVE-2024-30205 * Tue Jan 23 2024 zhangpan - 1:29.1-1 - update to 29.1 * Mon Sep 25 2023 leeffo - 1:28.2-5 - fix CVE-2022-48337 * Fri Mar 24 2023 zhangpan - 1:28.2-4 - fix CVE-2023-28617 * Wed Mar 15 2023 yanglongkang - 1:28.2-3 - fix CVE-2023-27985 CVE-2023-27986 * Wed Feb 22 2023 zhangpan - 1:28.2-2 - fix CVE-2022-48337 CVE-2022-48338 CVE-2022-48339 * Thu Feb 02 2023 zhouwenpei - 1:28.2-1 - update to 28.2 * Thu Dec 01 2022 wangkerong - 1:27.2-8 - fix CVE-2022-45939 * Fri Nov 18 2022 Wenlong Zhang - 1:27.2-7 - add loongarch support for emacs * Fri Aug 26 2022 zhujunhao - 1:27.2-6 - close bootstrap with product_family * Sat Jun 11 2022 wangkeorng - 1:27.2-5 - delete macro in changelog * Mon Jan 17 2022 liuyumeng - 1:27.2-4 - round self-developed patch * Tue Aug 10 2021 yangcheng - 1:27.2-3 - DESC: Fix the upgrade error caused by the info file in the emacs-help software package being repackaged * Tue Aug 10 2021 yanan - 1:27.2-2 - DESC: Fix FTBFS with glibc 2.34 * Mon Jul 19 2021 wangkerong - 1:27.2-1 - DESC: upgrade to 1:27.2 * Wed Dec 09 2020 chenyanpan - 1:27.1-5 - Type: improvement - DESC: use make_build instead of make for building bootstrap * Wed Dec 16 2020 jinzhimin - 1:27.1-4 - remove unnecessary patch * Wed Dec 16 2020 jinzhimin - 1:27.1-3 - fix emacs run failed * Wed Sep 23 2020 hanhui - 1:27.1-2 - Type:bugfix - ID:NA - SUG:NA - DESC:slove the problem of mercurial compile failed * Wed Aug 19 2020 xiaoweiwei - 1:27.1-1 - upgrade to 27.1 * Mon May 18 2020 zhangrui - 1:26.1-13 - rebuild for giflib * Fri Mar 13 2020 songnannan - 1:26.1-12 - add secure compile option * Sat Jan 11 2020 openEuler Buildteam - 1:26.1-11 - remove unnecessary source * Sat Dec 28 2019 openEuler Buildteam - 1:26.1-10 - Type:bugfix - ID:NA - SUG:NA - DESC:optimization the spec * Tue Oct 29 2019 openEuler Buildteam - 1:26.1-9 - Type:bugfix - Id:NA - SUG:NA - DESC:change the pakcage list and requires * Tue Oct 29 2019 yanglijin - 1:26.1-8 - emacs can not use * Fri Sep 20 2019 chenzhenyu - 1:26.1-7 - Package init