Petr Hracek 832068
%global _hardened_build 1
Petr Hracek 832068
cvsdist d31aa3
# This file is encoded in UTF-8.  -*- coding: utf-8 -*-
Petr Hracek da86ac
Summary:       GNU Emacs text editor
Petr Hracek da86ac
Name:          emacs
Petr Hracek da86ac
Epoch:         1
Peter Oliver b8fb44
Version:       29.4
Michel Lind 8061d2
Release:       %autorelease
Lukáš Zaoral 57bf08
License:       GPL-3.0-or-later AND CC0-1.0
Petr Hracek da86ac
URL:           http://www.gnu.org/software/emacs/
Jan Synacek 9e6823
Source0:       https://ftp.gnu.org/gnu/emacs/emacs-%{version}.tar.xz
Dan Čermák 6f367b
Source1:       https://ftp.gnu.org/gnu/emacs/emacs-%{version}.tar.xz.sig
Dan Čermák 28d8e7
Source2:       https://keys.openpgp.org/vks/v1/by-fingerprint/17E90D521672C04631B1183EE78DAE0F3115E06B
Peter Oliver d21aa7
Source3:       https://keys.openpgp.org/vks/v1/by-fingerprint/CEA1DE21AB108493CC9C65742E82323B8F4353EE
Dan Čermák 6f367b
Source4:       dotemacs.el
Dan Čermák 6f367b
Source5:       site-start.el
Dan Čermák 6f367b
Source6:       default.el
Karel Klic c98151
# Emacs Terminal Mode, #551949, #617355
Dan Čermák 6f367b
Source7:       emacs-terminal.desktop
Dan Čermák 6f367b
Source8:       emacs-terminal.sh
Karel Klic 24eae4
# rhbz#713600
Petr Hracek da86ac
Patch1:        emacs-spellchecker.patch
Jan Synacek 0588f1
Patch2:        emacs-system-crypto-policies.patch
Dan Čermák e6bb94
# causes a dependency on pkgconfig(systemd)
Dan Čermák e6bb94
# => remove it if we stop using this patch
Bhavin Gandhi e79d2e
Patch3:        emacs-libdir-vs-systemd.patch
Petr Hracek 832068
Dan Čermák 662bd4
BuildRequires: gcc
Petr Hracek 832068
BuildRequires: atk-devel
Petr Hracek 832068
BuildRequires: cairo-devel
Petr Hracek 832068
BuildRequires: freetype-devel
Petr Hracek 832068
BuildRequires: fontconfig-devel
Petr Hracek 832068
BuildRequires: dbus-devel
Petr Hracek 832068
BuildRequires: giflib-devel
Petr Hracek 832068
BuildRequires: glibc-devel
Petr Hracek 832068
BuildRequires: libpng-devel
Petr Hracek 832068
BuildRequires: libjpeg-turbo-devel
Petr Hracek 832068
BuildRequires: libjpeg-turbo
Petr Hracek 832068
BuildRequires: libtiff-devel
Petr Hracek 832068
BuildRequires: libX11-devel
Petr Hracek 832068
BuildRequires: libXau-devel
Petr Hracek 832068
BuildRequires: libXdmcp-devel
Peter Oliver 0fd1a3
BuildRequires: libXi-devel
Petr Hracek 832068
BuildRequires: libXrender-devel
Petr Hracek 832068
BuildRequires: libXt-devel
Petr Hracek 832068
BuildRequires: libXpm-devel
Petr Hracek 832068
BuildRequires: ncurses-devel
Petr Hracek 832068
BuildRequires: xorg-x11-proto-devel
Petr Hracek 832068
BuildRequires: zlib-devel
Petr Hracek 832068
BuildRequires: gnutls-devel
Petr Hracek 832068
BuildRequires: librsvg2-devel
Petr Hracek 832068
BuildRequires: m17n-lib-devel
Petr Hracek 832068
BuildRequires: libotf-devel
Petr Hracek 832068
BuildRequires: libselinux-devel
Petr Hracek 832068
BuildRequires: alsa-lib-devel
Petr Hracek 832068
BuildRequires: gpm-devel
Petr Hracek 832068
BuildRequires: liblockfile-devel
Petr Hracek 832068
BuildRequires: libxml2-devel
Dan Čermák 3485b7
BuildRequires: autoconf
Petr Hracek 832068
BuildRequires: bzip2
Petr Hracek 832068
BuildRequires: cairo
Petr Hracek 832068
BuildRequires: texinfo
Petr Hracek 832068
BuildRequires: gzip
Petr Hracek 832068
BuildRequires: desktop-file-utils
Peter Oliver a3d22a
BuildRequires: libappstream-glib
Petr Hracek 4b0f20
BuildRequires: libacl-devel
Bhavin Gandhi ac0772
BuildRequires: harfbuzz-devel
Bhavin Gandhi ac0772
BuildRequires: jansson-devel
Bhavin Gandhi ac0772
BuildRequires: systemd-devel
Bhavin Gandhi e79d2e
BuildRequires: libgccjit-devel
Peter Oliver 9c5e49
BuildRequires: libtree-sitter-devel
Peter Oliver 9c5e49
BuildRequires: libsqlite3x-devel
Peter Oliver 9c5e49
BuildRequires: libwebp-devel
Petr Hracek 392f47
Petr Hracek 832068
BuildRequires: gtk3-devel
Michel Lind bd28fb
BuildRequires: webkit2gtk3-devel
Petr Hracek 392f47
Dan Čermák 6f367b
BuildRequires: gnupg2
Dan Čermák 6f367b
Gregory Shimansky 3abc8d
# For lucid
Gregory Shimansky 3abc8d
BuildRequires: Xaw3d-devel
Gregory Shimansky 3abc8d
Dan Čermák e6bb94
# for Patch3
Dan Čermák e6bb94
BuildRequires: pkgconfig(systemd)
Dan Čermák e6bb94
Jan Synacek 47162e
%ifarch %{ix86}
Karel Klic 77da56
BuildRequires: util-linux
Karel Klic 97f8c1
%endif
Tom Stellard 87fd25
BuildRequires: make
Karel Klic e8a2c6
Dan Čermák e4c235
# Emacs requires info for info mode, rhbz#1989264
Dan Čermák e4c235
Requires:      info
Karel Klic 7764e1
# Emacs doesn't run without dejavu-sans-mono-fonts, rhbz#732422
Petr Hracek da86ac
Requires:      desktop-file-utils
Petr Hracek da86ac
Requires:      dejavu-sans-mono-fonts
Bhavin Gandhi e79d2e
Requires:      libgccjit
Karel Klic be557b
Requires(preun): %{_sbindir}/alternatives
Karel Klic be557b
Requires(posttrans): %{_sbindir}/alternatives
Petr Hracek da86ac
Requires:      emacs-common = %{epoch}:%{version}-%{release}
Petr Hracek da86ac
Provides:      emacs(bin) = %{epoch}:%{version}-%{release}
Jonathan G. Underwood 815d30
Charles Coldwell fa071f
%define site_lisp %{_datadir}/emacs/site-lisp
Jonathan G. Underwood 7501f2
%define site_start_d %{site_lisp}/site-start.d
Jonathan G. Underwood 7501f2
%define bytecompargs -batch --no-init-file --no-site-file -f batch-byte-compile
Charles Coldwell fa071f
%define pkgconfig %{_datadir}/pkgconfig
Karel Klic 97f8c1
%define emacs_libexecdir %{_libexecdir}/emacs/%{version}/%{_host}
Bhavin Gandhi e79d2e
%define native_lisp %{_libdir}/emacs/%{version}/native-lisp
Charles Coldwell fa071f
cvsdist af3202
%description
cvsdist af3202
Emacs is a powerful, customizable, self-documenting, modeless text
cvsdist af3202
editor. Emacs contains special code editing features, a scripting
cvsdist 3b2e93
language (elisp), and the capability to read mail, news, and more
cvsdist 3b2e93
without leaving the editor.
cvsdist af3202
cvsdist 45b61e
This package provides an emacs binary with support for X windows.
cvsdist 45b61e
Gregory Shimansky 3abc8d
%package lucid
Gregory Shimansky 3abc8d
Summary:       GNU Emacs text editor with LUCID toolkit X support
Bhavin Gandhi e79d2e
Requires:      libgccjit
Gregory Shimansky 3abc8d
Requires(preun): %{_sbindir}/alternatives
Gregory Shimansky 3abc8d
Requires(posttrans): %{_sbindir}/alternatives
Gregory Shimansky 3abc8d
Requires:      emacs-common = %{epoch}:%{version}-%{release}
Gregory Shimansky 3abc8d
Provides:      emacs(bin) = %{epoch}:%{version}-%{release}
Gregory Shimansky 3abc8d
Gregory Shimansky 3abc8d
%description lucid
Gregory Shimansky 3abc8d
Emacs is a powerful, customizable, self-documenting, modeless text
Gregory Shimansky 3abc8d
editor. Emacs contains special code editing features, a scripting
Gregory Shimansky 3abc8d
language (elisp), and the capability to read mail, news, and more
Gregory Shimansky 3abc8d
without leaving the editor.
Gregory Shimansky 3abc8d
Gregory Shimansky 3abc8d
This package provides an emacs binary with support for X windows
Gregory Shimansky 3abc8d
using LUCID toolkit.
Gregory Shimansky 3abc8d
cvsdist 45b61e
%package nox
Petr Hracek da86ac
Summary:       GNU Emacs text editor without X support
Bhavin Gandhi e79d2e
Requires:      libgccjit
Karel Klic be557b
Requires(preun): %{_sbindir}/alternatives
Karel Klic be557b
Requires(posttrans): %{_sbindir}/alternatives
Petr Hracek da86ac
Requires:      emacs-common = %{epoch}:%{version}-%{release}
Petr Hracek da86ac
Provides:      emacs(bin) = %{epoch}:%{version}-%{release}
cvsdist 45b61e
cvsdist 45b61e
%description nox
cvsdist 45b61e
Emacs is a powerful, customizable, self-documenting, modeless text
cvsdist 45b61e
editor. Emacs contains special code editing features, a scripting
cvsdist 45b61e
language (elisp), and the capability to read mail, news, and more
cvsdist 45b61e
without leaving the editor.
cvsdist 45b61e
cvsdist 45b61e
This package provides an emacs binary with no X windows support for running
cvsdist 45b61e
on a terminal.
cvsdist 45b61e
cvsdist 45b61e
%package common
Petr Hracek da86ac
Summary:       Emacs common files
Karel Klic 3ded10
# The entire source code is GPLv3+ except lib-src/etags.c which is
Karel Klic 3ded10
# also BSD.  Manual (info) is GFDL.
Lukáš Zaoral 57bf08
License:       GPL-3.0-or-later AND GFDL-1.3-no-invariants-or-later AND BSD-3-Clause
Karel Klic be557b
Requires(preun): %{_sbindir}/alternatives
Karel Klic be557b
Requires(posttrans): %{_sbindir}/alternatives
Petr Hracek da86ac
Requires:      %{name}-filesystem = %{epoch}:%{version}-%{release}
Peter Oliver 14924f
Recommends:    enchant2
Petr Hracek da86ac
Provides:      %{name}-el = %{epoch}:%{version}-%{release}
Petr Hracek da86ac
Obsoletes:     emacs-el < 1:24.3-29
Dan Čermák 615534
# transient.el is provided by emacs in lisp/transient.el
Dan Čermák 615534
Provides:      emacs-transient = 0.3.7
Dan Čermák 615534
# the existing emacs-transient package is obsoleted by emacs 28+, last package
Dan Čermák 615534
# version as of the release of emacs 28.1 is obsoleted
Dan Čermák 615534
Obsoletes:     emacs-transient < 0.3.0-4
cvsdist 45b61e
Peter Oliver 9c5e49
# Ideally, we'd package all tree-sitter parsers as RPMs, but, in the
Peter Oliver 9c5e49
# meantime, we need the following packages for
Peter Oliver 9c5e49
# treesit-install-language-grammar to be able to build the parsers for
Peter Oliver 9c5e49
# us at runtime:
Peter Oliver 6a817e
Recommends:    ((gcc and gcc-c++) or clang)
Peter Oliver 6a817e
Recommends:    git
Peter Oliver 9c5e49
Peter Oliver 9c5e49
cvsdist 45b61e
%description common
cvsdist 45b61e
Emacs is a powerful, customizable, self-documenting, modeless text
cvsdist 45b61e
editor. Emacs contains special code editing features, a scripting
cvsdist 45b61e
language (elisp), and the capability to read mail, news, and more
cvsdist 45b61e
without leaving the editor.
cvsdist 45b61e
Gregory Shimansky 3abc8d
This package contains all the common files needed by emacs, emacs-lucid
Gregory Shimansky 3abc8d
or emacs-nox.
cvsdist 45b61e
Karel Klic c98151
%package terminal
Petr Hracek da86ac
Summary:       A desktop menu item for GNU Emacs terminal.
Petr Hracek da86ac
Requires:      emacs = %{epoch}:%{version}-%{release}
Petr Hracek da86ac
BuildArch:     noarch
Karel Klic c98151
Karel Klic c98151
%description terminal
Karel Klic c98151
Contains a desktop menu item running GNU Emacs terminal. Install
Karel Klic c98151
emacs-terminal if you need a terminal with Malayalam support.
Karel Klic c98151
Karel Klic c98151
Please note that emacs-terminal is a temporary package and it will be
Ville Skyttä c4e075
removed when another terminal becomes capable of handling Malayalam.
Karel Klic c98151
Karel Klic 96340c
%package filesystem
Petr Hracek da86ac
Summary:       Emacs filesystem layout
Petr Hracek da86ac
BuildArch:     noarch
Karel Klic 96340c
Karel Klic 96340c
%description filesystem
Karel Klic 96340c
This package provides some directories which are required by other
Karel Klic 96340c
packages that add functionality to Emacs.
Karel Klic 96340c
Jan Synacek f6258e
%package devel
Jan Synacek f6258e
Summary: Development header files for Emacs
Jan Synacek f6258e
Jan Synacek f6258e
%description devel
Jan Synacek f6258e
Development header files for Emacs.
Jan Synacek f6258e
cvsdist af3202
%prep
Peter Oliver d21aa7
cat '%{SOURCE2}' '%{SOURCE3}' > keyring
Peter Oliver d21aa7
%{gpgverify} --keyring=keyring --signature='%{SOURCE1}' --data='%{SOURCE0}'
Peter Oliver d21aa7
rm keyring
Dan Čermák 2850fb
%autosetup -p1
Dan Čermák 2850fb
Michael Cronenworth de26e2
autoconf
Jochen Schmitt 668910
Daniel Novotny fef43a
grep -v "tetris.elc" lisp/Makefile.in > lisp/Makefile.in.new \
Daniel Novotny fef43a
   && mv lisp/Makefile.in.new lisp/Makefile.in
Petr Hracek 61c3d5
grep -v "pong.elc" lisp/Makefile.in > lisp/Makefile.in.new \
Petr Hracek 61c3d5
   && mv lisp/Makefile.in.new lisp/Makefile.in
Daniel Novotny fef43a
Karel Klic 96340c
# Avoid trademark issues
Charles Coldwell e15ad4
rm -f lisp/play/tetris.el lisp/play/tetris.elc
Jason Thatcher a0c541
rm -f lisp/play/pong.el lisp/play/pong.elc
Charles Coldwell 80ee80
Dennis Gilmore a63192
%ifarch %{ix86}
Dennis Gilmore a63192
%define setarch setarch %{_arch} -R
Dennis Gilmore a63192
%else
Dennis Gilmore a63192
%define setarch %{nil}
Dennis Gilmore a63192
%endif
Dennis Gilmore a63192
Karel Klic 3e2828
# Avoid duplicating doc files in the common subpackage
Karel Klic 3e2828
ln -s ../../%{name}/%{version}/etc/COPYING doc
Karel Klic 3e2828
ln -s ../../%{name}/%{version}/etc/NEWS doc
Karel Klic 3e2828
Michael Cronenworth cda0f6
cvsdist af3202
%build
Dan Čermák 662bd4
export CFLAGS="-DMAIL_USE_LOCKF %{build_cflags}"
Dan Čermák 662bd4
%set_build_flags
Jens Petersen 7a997d
Gregory Shimansky 3abc8d
# Build Lucid binary
Gregory Shimansky 3abc8d
mkdir build-lucid && cd build-lucid
Gregory Shimansky 3abc8d
ln -s ../configure .
Gregory Shimansky 3abc8d
Gregory Shimansky 3abc8d
LDFLAGS=-Wl,-z,relro;  export LDFLAGS;
Gregory Shimansky 3abc8d
Gregory Shimansky 3abc8d
%configure --with-dbus --with-gif --with-jpeg --with-png --with-rsvg \
Gregory Shimansky 3abc8d
           --with-tiff --with-xft --with-xpm --with-x-toolkit=lucid --with-gpm=no \
Bhavin Gandhi e79d2e
           --with-modules --with-harfbuzz --with-cairo --with-json \
Peter Oliver 9c5e49
           --with-native-compilation=aot --with-tree-sitter --with-sqlite3 \
Peter Oliver 9c5e49
           --with-webp --with-xinput2
Peter Oliver 9c5e49
%{setarch} %make_build bootstrap
Dan Čermák 662bd4
%{setarch} %make_build
Gregory Shimansky 3abc8d
cd ..
Gregory Shimansky 3abc8d
Jonathan G. Underwood 71dd62
# Build binary without X support
Jonathan G. Underwood 71dd62
mkdir build-nox && cd build-nox
Jonathan G. Underwood 71dd62
ln -s ../configure .
Peter Oliver 9c5e49
%configure --with-x=no --with-modules --with-json \
Peter Oliver 9c5e49
           --with-native-compilation=aot --with-tree-sitter --with-sqlite3
Peter Oliver 9c5e49
%{setarch} %make_build bootstrap
Bhavin Gandhi e79d2e
%{setarch} %make_build
Bhavin Gandhi e79d2e
cd ..
Bhavin Gandhi e79d2e
Bhavin Gandhi e79d2e
# Build GTK+ binary
Bhavin Gandhi e79d2e
mkdir build-gtk && cd build-gtk
Bhavin Gandhi e79d2e
ln -s ../configure .
Bhavin Gandhi e79d2e
Bhavin Gandhi e79d2e
LDFLAGS=-Wl,-z,relro;  export LDFLAGS;
Bhavin Gandhi e79d2e
Bhavin Gandhi e79d2e
%configure --with-dbus --with-gif --with-jpeg --with-png --with-rsvg \
29b8e9
           --with-tiff --with-xpm --with-x-toolkit=gtk3 --with-gpm=no \
Bhavin Gandhi e79d2e
           --with-xwidgets --with-modules --with-harfbuzz --with-cairo --with-json \
Peter Oliver 9c5e49
           --with-native-compilation=aot --with-tree-sitter --with-sqlite3 \
Peter Oliver 9c5e49
           --with-webp --with-xinput2
Peter Oliver 9c5e49
%{setarch} %make_build bootstrap
Dan Čermák 662bd4
%{setarch} %make_build
Jonathan G. Underwood 71dd62
cd ..
Charles Coldwell ee280a
Jonathan G. Underwood 71dd62
# Remove versioned file so that we end up with .1 suffix and only one DOC file
Gregory Shimansky 3abc8d
rm build-{gtk,lucid,nox}/src/emacs-%{version}.*
cvsdist af3202
Charles Coldwell fa071f
# Create pkgconfig file
Charles Coldwell 80ee80
cat > emacs.pc << EOF
Charles Coldwell 80ee80
sitepkglispdir=%{site_lisp}
Jonathan G. Underwood 28acda
sitestartdir=%{site_start_d}
Charles Coldwell 80ee80
Charles Coldwell 80ee80
Name: emacs
Charles Coldwell 80ee80
Description: GNU Emacs text editor
Dennis Gilmore a63192
Version: %{epoch}:%{version}
Charles Coldwell 80ee80
EOF
Charles Coldwell 80ee80
Jonathan G. Underwood 7501f2
# Create macros.emacs RPM macro file
Jonathan G. Underwood 7501f2
cat > macros.emacs << EOF
Jonathan G. Underwood 7501f2
%%_emacs_version %{version}
Jonathan G. Underwood 28acda
%%_emacs_ev %{?epoch:%{epoch}:}%{version}
Jonathan G. Underwood 28acda
%%_emacs_evr %{?epoch:%{epoch}:}%{version}-%{release}
Jonathan G. Underwood 7501f2
%%_emacs_sitelispdir %{site_lisp}
Jonathan G. Underwood 7501f2
%%_emacs_sitestartdir %{site_start_d}
Jonathan G. Underwood 5649bd
%%_emacs_bytecompile /usr/bin/emacs -batch --no-init-file --no-site-file --eval '(progn (setq load-path (cons "." load-path)))' -f batch-byte-compile
Jonathan G. Underwood 7501f2
EOF
Jonathan G. Underwood 7501f2
cvsdist af3202
%install
Jonathan G. Underwood 71dd62
cd build-gtk
Jan Synacek 1cedb9
%make_install
Jonathan G. Underwood 71dd62
cd ..
Jens Petersen 41350f
Karel Klic 96340c
# Let alternatives manage the symlink
Charles Coldwell fa071f
rm %{buildroot}%{_bindir}/emacs
Karel Klic a6db38
touch %{buildroot}%{_bindir}/emacs
Charles Coldwell ee280a
Karel Klic 96340c
# Do not compress the files which implement compression itself (#484830)
Daniel Novotny 793e02
gunzip %{buildroot}%{_datadir}/emacs/%{version}/lisp/jka-compr.el.gz
Daniel Novotny 793e02
gunzip %{buildroot}%{_datadir}/emacs/%{version}/lisp/jka-cmpr-hook.el.gz
Daniel Novotny 793e02
Gregory Shimansky 3abc8d
# Install the emacs with LUCID toolkit
Gregory Shimansky 3abc8d
install -p -m 0755 build-lucid/src/emacs %{buildroot}%{_bindir}/emacs-%{version}-lucid
Gregory Shimansky 3abc8d
Karel Klic 96340c
# Install the emacs without X
Jonathan G. Underwood 71dd62
install -p -m 0755 build-nox/src/emacs %{buildroot}%{_bindir}/emacs-%{version}-nox
cvsdist af3202
Karel Klic 96340c
# Make sure movemail isn't setgid
Charles Coldwell fa071f
chmod 755 %{buildroot}%{emacs_libexecdir}/movemail
Charles Coldwell ee280a
Charles Coldwell fa071f
mkdir -p %{buildroot}%{site_lisp}
Dan Čermák 6f367b
install -p -m 0644 %SOURCE5 %{buildroot}%{site_lisp}/site-start.el
Dan Čermák 6f367b
install -p -m 0644 %SOURCE6 %{buildroot}%{site_lisp}
Charles Coldwell ee280a
Karel Klic 96340c
# This solves bz#474958, "update-directory-autoloads" now finally
Karel Klic 96340c
# works the path is different each version, so we'll generate it here
Daniel Novotny 42cbd7
echo "(setq source-directory \"%{_datadir}/emacs/%{version}/\")" \
Daniel Novotny 42cbd7
 >> %{buildroot}%{site_lisp}/site-start.el
Daniel Novotny 42cbd7
Charles Coldwell fa071f
mv %{buildroot}%{_bindir}/{etags,etags.emacs}
Karel Klic 2d7f92
mv %{buildroot}%{_mandir}/man1/{ctags.1.gz,gctags.1.gz}
Karel Klic 2d7f92
mv %{buildroot}%{_mandir}/man1/{etags.1.gz,etags.emacs.1.gz}
Charles Coldwell fa071f
mv %{buildroot}%{_bindir}/{ctags,gctags}
Petr Hracek b1c2ab
# BZ 927996
Petr Hracek b1c2ab
mv %{buildroot}%{_infodir}/{info.info.gz,info.gz}
cvsdist af3202
Charles Coldwell fa071f
mkdir -p %{buildroot}%{site_lisp}/site-start.d
cvsdist af3202
Karel Klic 96340c
# Default initialization file
Charles Coldwell fa071f
mkdir -p %{buildroot}%{_sysconfdir}/skel
Dan Čermák 6f367b
install -p -m 0644 %SOURCE4 %{buildroot}%{_sysconfdir}/skel/.emacs
Jens Petersen 336b3d
Karel Klic 96340c
# Install pkgconfig file
Charles Coldwell fa071f
mkdir -p %{buildroot}/%{pkgconfig}
Daniel Novotny fef43a
install -p -m 0644 emacs.pc %{buildroot}/%{pkgconfig}
Charles Coldwell 80ee80
Karel Klic 96340c
# Install rpm macro definition file
Petr Hracek ff52e7
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d
Petr Hracek ff52e7
install -p -m 0644 macros.emacs %{buildroot}%{_rpmconfigdir}/macros.d/
Jonathan G. Underwood 7501f2
Karel Klic 96340c
# Installing emacs-terminal binary
Dan Čermák 6f367b
install -p -m 755 %SOURCE8 %{buildroot}%{_bindir}/emacs-terminal
Karel Klíč 0134b8
Karel Klic 96340c
# After everything is installed, remove info dir
Charles Coldwell fa071f
rm -f %{buildroot}%{_infodir}/dir
Jens Petersen fa4e25
Karel Klic 96340c
# Install desktop files
Karel Klíč 0134b8
desktop-file-install --dir=%{buildroot}%{_datadir}/applications \
Dan Čermák 6f367b
                     %SOURCE7
Charles Coldwell dcc57f
Peter Oliver f8859c
# Remove duplicate desktop-related files
Peter Oliver f8859c
rm %{buildroot}%{_datadir}/%{name}/%{version}/etc/%{name}.{desktop,service}
Peter Oliver f8859c
Bhavin Gandhi e79d2e
# We don't ship the client variants yet
Bhavin Gandhi e79d2e
# https://src.fedoraproject.org/rpms/emacs/pull-request/12
Bhavin Gandhi e79d2e
rm %{buildroot}%{_datadir}/applications/emacsclient.desktop
Bhavin Gandhi e79d2e
rm %{buildroot}%{_datadir}/applications/emacsclient-mail.desktop
Bhavin Gandhi e79d2e
cvsdist af3202
#
Karel Klic 96340c
# Create file lists
cvsdist af3202
#
Jens Petersen fa4e25
rm -f *-filelist {common,el}-*-files
Jens Petersen fa4e25
cvsdist 45b61e
( TOPDIR=${PWD}
Charles Coldwell fa071f
  cd %{buildroot}
cvsdist af3202
Peter Oliver f151e6
  find .%{_datadir}/emacs/%{version}/lisp .%{site_lisp} \
Peter Oliver f151e6
    \( -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 \)
Charles Coldwell ee280a
Charles Coldwell ee280a
)
cvsdist af3202
Dan Čermák ebd9e6
# Sorted list of info files
Dan Čermák 0bef05
%define info_files auth autotype bovine calc ccmode cl dbus dired-x ebrowse ede ediff edt efaq eglot eieio eintr elisp emacs-gnutls emacs-mime emacs epa erc ert eshell eudc eww flymake forms gnus htmlfontify idlwave ido 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 use-package vhdl-mode vip viper vtable widget wisent woman
Dan Čermák ebd9e6
Dan Čermák ebd9e6
for info_f in %info_files; do
Dan Čermák ebd9e6
    echo "%{_infodir}/${info_f}.info*" >> info-filelist
Dan Čermák ebd9e6
done
Dan Čermák ebd9e6
# info.gz is a rename of info.info.gz and thus needs special handling
Dan Čermák ebd9e6
echo "%{_infodir}/info*" >> info-filelist
Dan Čermák ebd9e6
Karel Klic 96340c
# Put the lists together after filtering  ./usr to /usr
Jens Petersen d1cee9
sed -i -e "s|\.%{_prefix}|%{_prefix}|" *-files
Peter Oliver f151e6
grep -vhE '%{site_lisp}(|/(default\.el|site-start\.d|site-start\.el))$' {common,el}-*-files > common-filelist
cvsdist af3202
Jan Synacek 904568
# Remove old icon
Jan Synacek 904568
rm %{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes/emacs-document23.svg
Jan Synacek 904568
Bhavin Gandhi e79d2e
# Install all the pdmp with fingerprints
Bhavin Gandhi e79d2e
gtk_pdmp="emacs-$(./build-gtk/src/emacs --fingerprint 2>&1 | sed 's/.* //').pdmp"
Bhavin Gandhi e79d2e
install -p -m 0644 build-gtk/src/emacs.pdmp %{buildroot}%{emacs_libexecdir}/${gtk_pdmp}
Bhavin Gandhi e79d2e
Bhavin Gandhi e79d2e
lucid_pdmp="emacs-$(./build-lucid/src/emacs --fingerprint 2>&1 | sed 's/.* //').pdmp"
Bhavin Gandhi e79d2e
install -p -m 0644 build-lucid/src/emacs.pdmp %{buildroot}%{emacs_libexecdir}/${lucid_pdmp}
Bhavin Gandhi e79d2e
Bhavin Gandhi e79d2e
nox_pdmp="emacs-$(./build-nox/src/emacs --fingerprint 2>&1 | sed 's/.* //').pdmp"
Bhavin Gandhi e79d2e
install -p -m 0644 build-nox/src/emacs.pdmp %{buildroot}%{emacs_libexecdir}/${nox_pdmp}
Bhavin Gandhi e79d2e
Bhavin Gandhi e79d2e
# Install native compiled Lisp of all builds
Bhavin Gandhi e79d2e
gtk_comp_native_ver=$(ls -1 build-gtk/native-lisp)
Bhavin Gandhi e79d2e
lucid_comp_native_ver=$(ls -1 build-lucid/native-lisp)
Bhavin Gandhi e79d2e
nox_comp_native_ver=$(ls -1 build-nox/native-lisp)
Bhavin Gandhi e79d2e
cp -ar build-gtk/native-lisp/${gtk_comp_native_ver} %{buildroot}%{native_lisp}
Bhavin Gandhi e79d2e
cp -ar build-lucid/native-lisp/${lucid_comp_native_ver} %{buildroot}%{native_lisp}
Bhavin Gandhi e79d2e
cp -ar build-nox/native-lisp/${nox_comp_native_ver} %{buildroot}%{native_lisp}
Bhavin Gandhi e79d2e
Dan Čermák 42430c
(TOPDIR=${PWD}
Dan Čermák 42430c
 cd %{buildroot}
Dan Čermák 42430c
 find .%{native_lisp}/${gtk_comp_native_ver} \( -type f -name '*eln' -fprintf $TOPDIR/gtk-eln-filelist "%%%%attr(755,-,-) %%p\n" \) -o \( -type d -fprintf $TOPDIR/gtk-dirs "%%%%dir %%p\n" \)
Dan Čermák 42430c
)
Dan Čermák 42430c
(TOPDIR=${PWD}
Dan Čermák 42430c
 cd %{buildroot}
Dan Čermák 42430c
 find .%{native_lisp}/${lucid_comp_native_ver} \( -type f -name '*eln' -fprintf $TOPDIR/lucid-eln-filelist "%%%%attr(755,-,-) %%p\n" \) -o \( -type d -fprintf $TOPDIR/lucid-dirs "%%%%dir %%p\n" \)
Dan Čermák 42430c
)
Dan Čermák 42430c
(TOPDIR=${PWD}
Dan Čermák 42430c
 cd %{buildroot}
Dan Čermák 42430c
 find .%{native_lisp}/${nox_comp_native_ver} \( -type f -name '*eln' -fprintf $TOPDIR/nox-eln-filelist "%%%%attr(755,-,-) %%p\n" \) -o \( -type d -fprintf $TOPDIR/nox-dirs "%%%%dir %%p\n" \)
Dan Čermák 42430c
)
Dan Čermák 42430c
echo %{emacs_libexecdir}/${gtk_pdmp} >> gtk-eln-filelist
Dan Čermák 42430c
echo %{emacs_libexecdir}/${lucid_pdmp} >> lucid-eln-filelist
Dan Čermák 42430c
echo %{emacs_libexecdir}/${nox_pdmp} >> nox-eln-filelist
Dan Čermák 42430c
Dan Čermák 42430c
# remove leading . from filelists
Dan Čermák 42430c
sed -i -e "s|\.%{native_lisp}|%{native_lisp}|" *-eln-filelist *-dirs
Bhavin Gandhi e79d2e
Dan Čermák 69e675
# remove exec permissions from eln files to prevent the debuginfo extractor from
Dan Čermák 69e675
# trying to extract debuginfo from them
Dan Čermák 69e675
find %{buildroot}%{_libdir}/ -name '*eln' -type f | xargs chmod -x
Dan Čermák 69e675
Dan Čermák a45e30
# ensure native files are newer than byte-code files
Dan Čermák a45e30
# see: https://bugzilla.redhat.com/show_bug.cgi?id=2157979#c11
Dan Čermák a45e30
find %{buildroot}%{_libdir}/ -name '*eln' -type f | xargs touch
Dan Čermák a45e30
Peter Oliver e65978
%check
Bhavin Gandhi e79d2e
appstream-util validate-relax --nonet %{buildroot}/%{_metainfodir}/*.metainfo.xml
Peter Oliver e65978
desktop-file-validate %{buildroot}/%{_datadir}/applications/*.desktop
Peter Oliver e65978
Karel Klic be557b
%preun
Dan Čermák fe829a
%{_sbindir}/alternatives --remove emacs %{_bindir}/emacs-%{version} || :
Michel Alexandre Salim c005e5
Karel Klic be557b
%posttrans
Dan Čermák fe829a
%{_sbindir}/alternatives --install %{_bindir}/emacs emacs %{_bindir}/emacs-%{version} 80 || :
Charles Coldwell fc47e9
Gregory Shimansky 3abc8d
%preun lucid
Dan Čermák fe829a
%{_sbindir}/alternatives --remove emacs %{_bindir}/emacs-%{version}-lucid || :
Dan Čermák fe829a
%{_sbindir}/alternatives --remove emacs-lucid %{_bindir}/emacs-%{version}-lucid || :
Gregory Shimansky 3abc8d
Gregory Shimansky 3abc8d
%posttrans lucid
Dan Čermák fe829a
%{_sbindir}/alternatives --install %{_bindir}/emacs emacs %{_bindir}/emacs-%{version}-lucid 70 || :
Dan Čermák fe829a
%{_sbindir}/alternatives --install %{_bindir}/emacs-lucid emacs-lucid %{_bindir}/emacs-%{version}-lucid 60 || :
Gregory Shimansky 3abc8d
Karel Klic be557b
%preun nox
Dan Čermák fe829a
%{_sbindir}/alternatives --remove emacs %{_bindir}/emacs-%{version}-nox || :
Dan Čermák fe829a
%{_sbindir}/alternatives --remove emacs-nox %{_bindir}/emacs-%{version}-nox || :
Karel Klic be557b
Karel Klic be557b
%posttrans nox
Dan Čermák fe829a
%{_sbindir}/alternatives --install %{_bindir}/emacs emacs %{_bindir}/emacs-%{version}-nox 70 || :
Dan Čermák fe829a
%{_sbindir}/alternatives --install %{_bindir}/emacs-nox emacs-nox %{_bindir}/emacs-%{version}-nox 60 || :
Charles Coldwell ee280a
cvsdist 45b61e
%preun common
Dan Čermák fe829a
%{_sbindir}/alternatives --remove emacs.etags %{_bindir}/etags.emacs || :
cvsdist af3202
Charles Coldwell 75c8a0
%posttrans common
Karel Klic be557b
%{_sbindir}/alternatives --install %{_bindir}/etags emacs.etags %{_bindir}/etags.emacs 80 \
Dan Čermák fe829a
       --slave %{_mandir}/man1/etags.1.gz emacs.etags.man %{_mandir}/man1/etags.emacs.1.gz || :
Charles Coldwell 75c8a0
Dan Čermák 42430c
%files -f gtk-eln-filelist -f gtk-dirs
cvsdist 45b61e
%{_bindir}/emacs-%{version}
Karel Klic a6db38
%attr(0755,-,-) %ghost %{_bindir}/emacs
Charles Coldwell e15ad4
%{_datadir}/applications/emacs.desktop
Bhavin Gandhi e79d2e
%{_datadir}/applications/emacs-mail.desktop
Bhavin Gandhi e79d2e
%{_metainfodir}/%{name}.metainfo.xml
Charles Coldwell dcc57f
%{_datadir}/icons/hicolor/*/apps/emacs.png
Daniel Novotny fef43a
%{_datadir}/icons/hicolor/scalable/apps/emacs.svg
Bhavin Gandhi ac0772
%{_datadir}/icons/hicolor/scalable/apps/emacs.ico
Daniel Novotny fef43a
%{_datadir}/icons/hicolor/scalable/mimetypes/emacs-document.svg
Daniel Novotny fef43a
Dan Čermák 42430c
%files lucid -f lucid-eln-filelist -f lucid-dirs
Gregory Shimansky 3abc8d
%{_bindir}/emacs-%{version}-lucid
Gregory Shimansky 3abc8d
%attr(0755,-,-) %ghost %{_bindir}/emacs
Gregory Shimansky 3abc8d
%attr(0755,-,-) %ghost %{_bindir}/emacs-lucid
Gregory Shimansky 3abc8d
Dan Čermák 42430c
%files nox -f nox-eln-filelist -f nox-dirs
Jens Petersen 69dd38
%{_bindir}/emacs-%{version}-nox
Jan Chaloupka 92271d
%attr(0755,-,-) %ghost %{_bindir}/emacs
Petr Hracek 9ec93c
%attr(0755,-,-) %ghost %{_bindir}/emacs-nox
cvsdist 45b61e
Peter Oliver f151e6
%files common -f common-filelist -f info-filelist
cvsdist d31aa3
%config(noreplace) %{_sysconfdir}/skel/.emacs
Petr Hracek ff52e7
%{_rpmconfigdir}/macros.d/macros.emacs
54f4bc
%license etc/COPYING
54f4bc
%doc doc/NEWS BUGS README
Karel Klic 9c6ebc
%{_bindir}/ebrowse
Karel Klic 9c6ebc
%{_bindir}/emacsclient
Karel Klic 9c6ebc
%{_bindir}/etags.emacs
Karel Klic 9c6ebc
%{_bindir}/gctags
Dan Čermák ecd248
%{_mandir}/man1/ebrowse.1*
Dan Čermák ecd248
%{_mandir}/man1/emacs.1*
Dan Čermák ecd248
%{_mandir}/man1/emacsclient.1*
Dan Čermák ecd248
%{_mandir}/man1/etags.emacs.1*
Dan Čermák ecd248
%{_mandir}/man1/gctags.1*
cvsdist d31aa3
%dir %{_datadir}/emacs/%{version}
cvsdist d31aa3
%{_datadir}/emacs/%{version}/etc
cvsdist d31aa3
%{_datadir}/emacs/%{version}/site-lisp
Dan Čermák a1c92f
%dir %{emacs_libexecdir}/
Dan Čermák a1c92f
%{emacs_libexecdir}/movemail
Dan Čermák a1c92f
%{emacs_libexecdir}/hexl
Dan Čermák a1c92f
%{emacs_libexecdir}/rcs2log
Petr Hracek f86fe1
%{_userunitdir}/emacs.service
Peter Oliver f151e6
%attr(0644,root,root) %config(noreplace) %{site_lisp}/default.el
Peter Oliver f151e6
%attr(0644,root,root) %config %{site_lisp}/site-start.el
Charles Coldwell fa071f
%{pkgconfig}/emacs.pc
cvsdist af3202
Karel Klic c98151
%files terminal
Karel Klic c98151
%{_bindir}/emacs-terminal
Karel Klic c98151
%{_datadir}/applications/emacs-terminal.desktop
Karel Klic c98151
Karel Klic 96340c
%files filesystem
Karel Klic 96340c
%dir %{_datadir}/emacs
Karel Klic 96340c
%dir %{_datadir}/emacs/site-lisp
Karel Klic 96340c
%dir %{_datadir}/emacs/site-lisp/site-start.d
Karel Klic 96340c
Jan Synacek f6258e
%files devel
Jan Synacek f6258e
%{_includedir}/emacs-module.h
Jan Synacek f6258e
cvsdist c08065
%changelog
Michel Lind 8061d2
%autochangelog