diff --git a/Use-a-64KB-page-size-for-pdump.patch b/Use-a-64KB-page-size-for-pdump.patch new file mode 100644 index 0000000000000000000000000000000000000000..cc21eac9526744ee63ae7cbe41816b06bd4291bd --- /dev/null +++ b/Use-a-64KB-page-size-for-pdump.patch @@ -0,0 +1,26 @@ +commit 216c65b135c2b0be7e048cdc6683873b03b99b9a +Author: Lars Ingebrigtsen +Date: Sun Mar 28 19:13:00 2021 +0200 + + Use a 64KB page size for pdump + + * src/pdumper.c (dump_get_page_size): Use a 64KB page size on all + architectures, as this many vary between systems (bug#47125). + +diff --git a/src/pdumper.c b/src/pdumper.c +index 337742fda4..fdd9b3bacb 100644 +--- a/src/pdumper.c ++++ b/src/pdumper.c +@@ -162,11 +162,7 @@ ptrdiff_t_to_dump_off (ptrdiff_t value) + static int + dump_get_page_size (void) + { +-#if defined (WINDOWSNT) || defined (CYGWIN) +- return 64 * 1024; /* Worst-case allocation granularity. */ +-#else +- return getpagesize (); +-#endif ++ return 64 * 1024; + } + + #define dump_offsetof(type, member) \ diff --git a/default.el b/default.el new file mode 100644 index 0000000000000000000000000000000000000000..7df4ceeb4dcf8afa397f489b1ac8becdb2d781fc --- /dev/null +++ b/default.el @@ -0,0 +1,7 @@ +;;; default.el - loaded after ".emacs" on startup +;;; +;;; Setting `inhibit-default-init' non-nil in "~/.emacs" +;;; prevents loading of this file. Also the "-q" option to emacs +;;; prevents both "~/.emacs" and this file from being loaded at startup. + +(setq-default smime-CA-directory "/etc/ssl/certs") diff --git a/dotemacs.el b/dotemacs.el new file mode 100644 index 0000000000000000000000000000000000000000..e1bee17a6b6b16c4ab851dac57dc9af63275f5ad --- /dev/null +++ b/dotemacs.el @@ -0,0 +1,12 @@ +;; .emacs + +(custom-set-variables + ;; uncomment to always end a file with a newline + ;'(require-final-newline t) + ;; uncomment to disable loading of "default.el" at startup + ;'(inhibit-default-init t) + ;; default to unified diffs + '(diff-switches "-u")) + +;;; uncomment for CJK utf-8 support for non-Asian users +;; (require 'un-define) diff --git a/emacs-27.2.tar.xz b/emacs-27.2.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..0618c17e1640bdcd9ed15abb928e57236f1f8900 Binary files /dev/null and b/emacs-27.2.tar.xz differ diff --git a/emacs-glibc-2.34.patch b/emacs-glibc-2.34.patch new file mode 100644 index 0000000000000000000000000000000000000000..6d764aa2666543ba69376273244d278001978dee --- /dev/null +++ b/emacs-glibc-2.34.patch @@ -0,0 +1,40 @@ +From f97e07ea807cc6d38774a3888a15091b20645ac6 Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Tue, 9 Mar 2021 11:22:59 -0800 +Subject: [PATCH] Port alternate signal stack to upcoming glibc 2.34 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +* src/sysdep.c (sigsegv_stack): Increase size to 64 KiB and align +it to max_align_t. This copies from Gnulib’s c-stack.c, and works +around a portability bug in draft glibc 2.34, which no longer +defines SIGSTKSZ when _GNU_SOURCE is defined. +--- + src/sysdep.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/src/sysdep.c b/src/sysdep.c +index 941b4e2fa2..24d8832b2f 100644 +--- a/src/sysdep.c ++++ b/src/sysdep.c +@@ -1785,7 +1785,15 @@ handle_arith_signal (int sig) + + /* Alternate stack used by SIGSEGV handler below. */ + +-static unsigned char sigsegv_stack[SIGSTKSZ]; ++/* Storage for the alternate signal stack. ++ 64 KiB is not too large for Emacs, and is large enough ++ for all known platforms. Smaller sizes may run into trouble. ++ For example, libsigsegv 2.6 through 2.8 have a bug where some ++ architectures use more than the Linux default of an 8 KiB alternate ++ stack when deciding if a fault was caused by stack overflow. */ ++static max_align_t sigsegv_stack[(64 * 1024 ++ + sizeof (max_align_t) - 1) ++ / sizeof (max_align_t)]; + + + /* Return true if SIGINFO indicates a stack overflow. */ +-- +2.29.2 + diff --git a/emacs-libdir-vs-systemd.patch b/emacs-libdir-vs-systemd.patch new file mode 100644 index 0000000000000000000000000000000000000000..32f6a832ede3a44c1b4422415897442deb3b36ab --- /dev/null +++ b/emacs-libdir-vs-systemd.patch @@ -0,0 +1,31 @@ +From a56539c1d7ef7aa56e575685bdfe1406aebb518d Mon Sep 17 00:00:00 2001 +From: Peter Oliver +Date: Wed, 5 Feb 2020 12:42:04 +0000 +Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20assemble=20systemdunitdir=20fro?= + =?UTF-8?q?m=20`libdir`?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +On 64 bit Fedora, `libdir` is `/usr/lib64`, whereas systemd services +live under `/usr/lib/systemd`. +--- + Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index 2c82c49fba..b2468eb824 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -208,7 +208,7 @@ appdatadir= + # Other options include ~/.config/systemd/user/, + # $XDG_RUNTIME_DIR/systemd/user/ + # It seems the user may end up having to make a manual link... +-systemdunitdir=$(libdir)/systemd/user ++systemdunitdir=$(shell pkg-config --variable=systemduserunitdir systemd) + + # Where the etc/images/icons/hicolor directory is to be installed. + icondir=$(datarootdir)/icons +-- +2.24.1 + diff --git a/emacs-modula2.patch b/emacs-modula2.patch new file mode 100644 index 0000000000000000000000000000000000000000..2d0fde809b78b2c022f68ce697a7dba0e43ca077 --- /dev/null +++ b/emacs-modula2.patch @@ -0,0 +1,30 @@ +From 462ca0654d2aa2a2b6506f2e9a1a9ceb8e683cad Mon Sep 17 00:00:00 2001 +From: Gregory Heytings +Date: Sun, 25 Apr 2021 10:33:48 +0000 +Subject: [PATCH] Fix infloop in Modula-2 mode + +* lisp/progmodes/modula2.el (m2-smie-refine-colon): Stop looping when +point does not move with forward-sexp (Bug#48011) +--- + lisp/progmodes/modula2.el | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/lisp/progmodes/modula2.el b/lisp/progmodes/modula2.el +index 2a0374aa81..5756d91831 100644 +--- a/lisp/progmodes/modula2.el ++++ b/lisp/progmodes/modula2.el +@@ -201,7 +201,10 @@ m2-smie-refine-colon + ((zerop (length tok)) + (let ((forward-sexp-function nil)) + (condition-case nil +- (forward-sexp -1) ++ (let ((p (point))) ++ (forward-sexp -1) ++ (if (= p (point)) ++ (setq res ":"))) + (scan-error (setq res ":"))))) + ((member tok '("|" "OF" "..")) (setq res ":-case")) + ((member tok '(":" "END" ";" "BEGIN" "VAR" "RECORD" "PROCEDURE")) +-- +2.30.2 + diff --git a/emacs-spellchecker.patch b/emacs-spellchecker.patch new file mode 100644 index 0000000000000000000000000000000000000000..4551dcb835594f790f55308ce31800ab9ebab74b --- /dev/null +++ b/emacs-spellchecker.patch @@ -0,0 +1,22 @@ +diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el +index 65f61644b6..254c3e6a82 100644 +--- a/lisp/textmodes/ispell.el ++++ b/lisp/textmodes/ispell.el +@@ -197,14 +197,11 @@ ispell-choices-win-default-height + :type 'integer + :group 'ispell) + +-;; XXX Add enchant to this list once enchant >= 2.1.0 is widespread. +-;; Before that, adding it is useless, as if it is found, it will just +-;; cause an error; and one of the other spelling engines below is +-;; almost certainly installed in any case, for enchant to use. + (defcustom ispell-program-name +- (or (executable-find "aspell") +- (executable-find "ispell") ++ (or (executable-find "enchant-2") + (executable-find "hunspell") ++ (executable-find "aspell") ++ (executable-find "ispell") + "ispell") + "Program invoked by \\[ispell-word] and \\[ispell-region] commands." + :type 'string diff --git a/emacs-system-crypto-policies.patch b/emacs-system-crypto-policies.patch new file mode 100644 index 0000000000000000000000000000000000000000..2f2435c03370e432c48eb5861c98834a7a2b1a04 --- /dev/null +++ b/emacs-system-crypto-policies.patch @@ -0,0 +1,11 @@ +--- a/src/gnutls.c 2016-01-24 10:29:58.000000000 +0100 ++++ b/src/gnutls.c 2016-02-02 09:32:28.477274274 +0100 +@@ -1557,7 +1557,7 @@ + gnutls_certificate_credentials_t x509_cred = NULL; + gnutls_anon_client_credentials_t anon_cred = NULL; + Lisp_Object global_init; +- char const *priority_string_ptr = "NORMAL"; /* default priority string. */ ++ char const *priority_string_ptr = "@SYSTEM"; /* default priority string. */ + char *c_hostname; + + /* Placeholders for the property list elements. */ diff --git a/emacs-terminal.desktop b/emacs-terminal.desktop new file mode 100644 index 0000000000000000000000000000000000000000..3c12470b9f1eacfd21ff2cde18392fb5aabbb908 --- /dev/null +++ b/emacs-terminal.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Emacs Terminal +GenericName=Emacs Terminal +Comment=Emacs Terminal Mode +Exec=emacs-terminal +Icon=utilities-terminal +Type=Application +Terminal=false +Categories=Application;Utility;X-Red-Hat-Base;GTK;TerminalEmulator; +Encoding=UTF-8 +StartupWMClass=Emacs diff --git a/emacs-terminal.sh b/emacs-terminal.sh new file mode 100644 index 0000000000000000000000000000000000000000..bc0592a282a3f4d36a771bd7a9be7bd4a0024958 --- /dev/null +++ b/emacs-terminal.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /usr/bin/emacs -Q --eval '(term "/bin/bash")' diff --git a/emacs.appdata.xml b/emacs.appdata.xml new file mode 100644 index 0000000000000000000000000000000000000000..94ba9854e1ffee279ce17aebd19288616c51aa65 --- /dev/null +++ b/emacs.appdata.xml @@ -0,0 +1,64 @@ + + + + emacs.desktop + CC0-1.0 + GPL-3.0+ + GNU Emacs + Edit text files, view pictures and binary files + +

+ Emacs is a powerful, customizable, self-documenting, modeless + editor. It is used primarely to edit text, including text + documents, source code of programs, web pages and XML documents, + but can also be used to display and edit binary files. +

+

+ Emacs allows efficient editing of text with shortcuts which + allow operating on letters, words, sentences, and paragraphs as + single units. This includes both moving around and operations + like copying, deleting, transposing, and pasting. Macros can be + conveniently defined to repeat sequences of commands. In + addition, Emacs is (partially) built in a scripting language + (elisp) which can also be used to define further functions + extending existing capabilities. +

+

+ Emacs has extensive support for editing source code, including + programmable syntax highlighting, automatic indentation, source + code indexing, overview modes, and navigation based on language + specific units like functions and blocks. It is also possible to + invoke the compiler from within Emacs and easily move between + compiler output and corresponding positions in the source. +

+

+ Emacs has multiple modules which provide further functionality. + This provides the capability to read mail, news, browse + pictures, read man and info pages, browse the web, execute + arbitrary programs, and more, without leaving the editor. +

+
+ + + http://in.waw.pl/~zbyszek/fedora/emacs-two-buffers.png + + + http://in.waw.pl/~zbyszek/fedora/emacs-editing-xml.png + + + http://in.waw.pl/~zbyszek/fedora/emacs-hexl-mode.png + + + http://in.waw.pl/~zbyszek/fedora/emacs-showing-svg.png + + + http://in.waw.pl/~zbyszek/fedora/emacs-with-python-source.png + + + http://www.gnu.org/software/emacs/ + https://www.gnu.org/software/emacs/manual/html_node/emacs/Bugs.html + https://my.fsf.org/donate/ + https://www.gnu.org/software/emacs/manual/ + zbyszek@in.waw.pl + +
diff --git a/emacs.spec b/emacs.spec new file mode 100644 index 0000000000000000000000000000000000000000..b3bab5d04eab712554fe0643cac606f227be1426 --- /dev/null +++ b/emacs.spec @@ -0,0 +1,470 @@ +%define anolis_release 1 +%global _hardened_build 1 + +# This file is encoded in UTF-8. -*- coding: utf-8 -*- +Summary: GNU Emacs text editor +Name: emacs +Epoch: 1 +Version: 27.2 +Release: %{anolis_release}%{?dist} +License: GPLv3+ and CC0 +URL: http://www.gnu.org/software/emacs/ +Source0: https://ftp.gnu.org/gnu/emacs/emacs-%{version}.tar.xz +Source2: dotemacs.el +Source3: site-start.el +Source4: default.el +Source5: emacs-terminal.desktop +Source6: emacs-terminal.sh +Source7: %{name}.appdata.xml +Patch1: emacs-spellchecker.patch +Patch2: emacs-system-crypto-policies.patch +Patch3: emacs-glibc-2.34.patch +Patch4: emacs-libdir-vs-systemd.patch +Patch5: https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-04/txt0tY7uKvJKS.txt#./emacs-modula2.patch +# cherry picked from 216c65b135c2b0be7e048cdc6683873b03b99b9a +Patch6: Use-a-64KB-page-size-for-pdump.patch + +BuildRequires: gcc +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-turbo-devel +BuildRequires: libjpeg-turbo +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: libselinux-devel +BuildRequires: alsa-lib-devel +BuildRequires: gpm-devel +BuildRequires: liblockfile-devel +BuildRequires: libxml2-devel +BuildRequires: autoconf +BuildRequires: bzip2 +BuildRequires: cairo +BuildRequires: texinfo +BuildRequires: gzip +BuildRequires: desktop-file-utils +BuildRequires: libappstream-glib +BuildRequires: libacl-devel +BuildRequires: harfbuzz-devel +BuildRequires: jansson-devel +BuildRequires: systemd-devel +BuildRequires: gtk3-devel +BuildRequires: webkit2gtk3-devel +BuildRequires: gnupg2 +BuildRequires: Xaw3d-devel +BuildRequires: make + +Requires: info +Requires: desktop-file-utils +Requires: 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 lucid +Summary: GNU Emacs text editor with LUCID toolkit X support +Requires(preun): %{_sbindir}/alternatives +Requires(posttrans): %{_sbindir}/alternatives +Requires: emacs-common = %{epoch}:%{version}-%{release} +Provides: emacs(bin) = %{epoch}:%{version}-%{release} + +%description lucid +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 +using LUCID toolkit. + +%package nox +Summary: GNU Emacs text editor without X support +Requires(preun): %{_sbindir}/alternatives +Requires(posttrans): %{_sbindir}/alternatives +Requires: emacs-common = %{epoch}:%{version}-%{release} +Provides: emacs(bin) = %{epoch}:%{version}-%{release} + +%description nox +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 no X windows support for running +on a terminal. + +%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 +Requires(preun): %{_sbindir}/alternatives +Requires(posttrans): %{_sbindir}/alternatives +Requires: %{name}-filesystem = %{epoch}:%{version}-%{release} +Recommends: enchant2 +Provides: %{name}-el = %{epoch}:%{version}-%{release} +Obsoletes: emacs-el < 1:24.3-29 + +%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, emacs-lucid +or emacs-nox. + +%package terminal +Summary: A desktop menu item for GNU Emacs terminal. +Requires: emacs = %{epoch}:%{version}-%{release} +BuildArch: noarch + +%description terminal +Contains a desktop menu item running GNU Emacs terminal. Install +emacs-terminal if you need a terminal with Malayalam support. + +Please note that emacs-terminal is a temporary package and it will be +removed when another terminal becomes capable of handling Malayalam. + +%package filesystem +Summary: Emacs filesystem layout +BuildArch: noarch + +%description filesystem +This package provides some directories which are required by other +packages that add functionality to Emacs. + +%package devel +Summary: Development header files for Emacs + +%description devel +Development header files for Emacs. + +%prep +%setup -q + +%patch1 -p1 -b .spellchecker +%patch2 -p1 -b .system-crypto-policies +%patch3 -p1 -b .glibc2.34 +%patch4 -p1 -b .libdir-vs-systemd +%patch5 -p1 +%patch6 -p1 +autoconf + +grep -v "tetris.elc" lisp/Makefile.in > lisp/Makefile.in.new \ + && mv lisp/Makefile.in.new lisp/Makefile.in +grep -v "pong.elc" lisp/Makefile.in > lisp/Makefile.in.new \ + && mv lisp/Makefile.in.new lisp/Makefile.in + +# Avoid trademark issues +rm -f lisp/play/tetris.el lisp/play/tetris.elc +rm -f lisp/play/pong.el lisp/play/pong.el + +# Sorted list of info files +%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 + +# Since the list of info files has to be maintained, check if all info files +# from the upstream tarball are actually present in %%info_files. +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 .. + +%define setarch %{nil} + +# 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 %{build_cflags}" +%set_build_flags + +# Build GTK+ binary +mkdir build-gtk && cd build-gtk +ln -s ../configure . + +LDFLAGS=-Wl,-z,relro; export LDFLAGS; + +%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-xwidgets --with-modules --with-harfbuzz --with-cairo --with-json +make bootstrap +%{setarch} %make_build +cd .. + +# Build Lucid binary +mkdir build-lucid && cd build-lucid +ln -s ../configure . + +LDFLAGS=-Wl,-z,relro; export LDFLAGS; + +%configure --with-dbus --with-gif --with-jpeg --with-png --with-rsvg \ + --with-tiff --with-xft --with-xpm --with-x-toolkit=lucid --with-gpm=no \ + --with-modules --with-harfbuzz --with-cairo --with-json +make bootstrap +%{setarch} %make_build +cd .. + +# Build binary without X support +mkdir build-nox && cd build-nox +ln -s ../configure . +%configure --with-x=no --with-modules --with-json +%{setarch} %make_build +cd .. + +# Remove versioned file so that we end up with .1 suffix and only one DOC file +rm build-{gtk,lucid,nox}/src/emacs-%{version}.* + +# 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 +cd build-gtk +%make_install +cd .. + +# Let alternatives manage the symlink +rm %{buildroot}%{_bindir}/emacs +touch %{buildroot}%{_bindir}/emacs + +# Remove emacs.pdmp from common +rm %{buildroot}%{emacs_libexecdir}/emacs.pdmp + +# 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 + +# Install emacs.pdmp of the emacs with GTK+ +install -p -m 0644 build-gtk/src/emacs.pdmp %{buildroot}%{_bindir}/emacs-%{version}.pdmp + +# Install the emacs with LUCID toolkit +install -p -m 0755 build-lucid/src/emacs %{buildroot}%{_bindir}/emacs-%{version}-lucid +install -p -m 0644 build-lucid/src/emacs.pdmp %{buildroot}%{_bindir}/emacs-%{version}-lucid.pdmp + +# Install the emacs without X +install -p -m 0755 build-nox/src/emacs %{buildroot}%{_bindir}/emacs-%{version}-nox +install -p -m 0644 build-nox/src/emacs.pdmp %{buildroot}%{_bindir}/emacs-%{version}-nox.pdmp + +# Make sure movemail isn't setgid +chmod 755 %{buildroot}%{emacs_libexecdir}/movemail + +mkdir -p %{buildroot}%{site_lisp} +install -p -m 0644 %SOURCE3 %{buildroot}%{site_lisp}/site-start.el +install -p -m 0644 %SOURCE4 %{buildroot}%{site_lisp} + +# This solves bz#474958, "update-directory-autoloads" now finally +# works the path is different each version, so we'll generate it here +echo "(setq source-directory \"%{_datadir}/emacs/%{version}/\")" \ + >> %{buildroot}%{site_lisp}/site-start.el + +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} +mv %{buildroot}%{_infodir}/{info.info.gz,info.gz} + +mkdir -p %{buildroot}%{site_lisp}/site-start.d + +# Default initialization file +mkdir -p %{buildroot}%{_sysconfdir}/skel +install -p -m 0644 %SOURCE2 %{buildroot}%{_sysconfdir}/skel/.emacs + +# Install pkgconfig file +mkdir -p %{buildroot}/%{pkgconfig} +install -p -m 0644 emacs.pc %{buildroot}/%{pkgconfig} + +# Install app data +mkdir -p %{buildroot}/%{_datadir}/appdata +cp -a %SOURCE7 %{buildroot}/%{_datadir}/appdata +# Upstream ships its own appdata file, but it's quite terse. +rm %{buildroot}/%{_metainfodir}/emacs.appdata.xml + +# Install rpm macro definition file +mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d +install -p -m 0644 macros.emacs %{buildroot}%{_rpmconfigdir}/macros.d/ + +# Installing emacs-terminal binary +install -p -m 755 %SOURCE6 %{buildroot}%{_bindir}/emacs-terminal + +# After everything is installed, remove info dir +rm -f %{buildroot}%{_infodir}/dir + +# Install desktop files +desktop-file-install --dir=%{buildroot}%{_datadir}/applications \ + %SOURCE5 + +# Remove duplicate desktop-related files +rm %{buildroot}%{_datadir}/%{name}/%{version}/etc/%{name}.{desktop,service} + +# +# Create file lists +# +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 \) + +) + +# 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 + +# Remove old icon +rm %{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes/emacs-document23.svg + +%check +appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/*.appdata.xml +desktop-file-validate %{buildroot}/%{_datadir}/applications/*.desktop + +%preun +%{_sbindir}/alternatives --remove emacs %{_bindir}/emacs-%{version} || : + +%posttrans +%{_sbindir}/alternatives --install %{_bindir}/emacs emacs %{_bindir}/emacs-%{version} 80 || : + +%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 || : + +%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 +%{_bindir}/emacs-%{version} +%{_bindir}/emacs-%{version}.pdmp +%attr(0755,-,-) %ghost %{_bindir}/emacs +%{_datadir}/applications/emacs.desktop +%{_datadir}/appdata/%{name}.appdata.xml +%{_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 + +%files lucid +%{_bindir}/emacs-%{version}-lucid +%{_bindir}/emacs-%{version}-lucid.pdmp +%attr(0755,-,-) %ghost %{_bindir}/emacs +%attr(0755,-,-) %ghost %{_bindir}/emacs-lucid + +%files nox +%{_bindir}/emacs-%{version}-nox +%{_bindir}/emacs-%{version}-nox.pdmp +%attr(0755,-,-) %ghost %{_bindir}/emacs +%attr(0755,-,-) %ghost %{_bindir}/emacs-nox + +%files common -f common-filelist -f el-filelist +%config(noreplace) %{_sysconfdir}/skel/.emacs +%{_rpmconfigdir}/macros.d/macros.emacs +%license etc/COPYING +%doc doc/NEWS BUGS README +%{_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 +%{_userunitdir}/emacs.service +%attr(0644,root,root) %config(noreplace) %{_datadir}/emacs/site-lisp/default.el +%attr(0644,root,root) %config %{_datadir}/emacs/site-lisp/site-start.el +%{pkgconfig}/emacs.pc + +%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 devel +%{_includedir}/emacs-module.h + +%changelog +* Wed Mar 23 2022 Dan Čermák - 1:27.2-11 +- Include upstream version of bundled glib cdefs.h, fixes rhbz#2045136 + diff --git a/site-start.el b/site-start.el new file mode 100644 index 0000000000000000000000000000000000000000..efbb75b1133eecb28cb71501809ccac5f0843399 --- /dev/null +++ b/site-start.el @@ -0,0 +1,9 @@ +;;; loaded before user's ".emacs" file and default.el + +;; load *.el and *.elc in /usr/share/emacs/site-lisp/site-start.d on startup +(mapc + 'load + (delete-dups + (mapcar 'file-name-sans-extension + (directory-files + "/usr/share/emacs/site-lisp/site-start.d" t "\\.elc?\\'"))))