emacs/emacs.spec
Silvan Calarco a8b012b690 remove emacs.pdmp causing conflicts when using differant emacs x/nox target
update configure (with gtk3) and specfile cleanups [release 27.1-2mamba;Sat Oct 24 2020]
2024-01-05 22:04:55 +01:00

520 lines
17 KiB
RPMSpec

# Staged build (no first stage deps)
# rpm -ba emacs.spec --define 'stage1 1'
%define dirver %(echo %version | sed "s|[a-z]$||")
Name: emacs
Version: 27.1
Release: 2mamba
Summary: Common files needed to run the GNU Emacs text editor
Group: Applications/Text
Vendor: openmamba
Distribution: openmamba
Packager: Davide Madrisan <davide.madrisan@gmail.com>
URL: http://www.gnu.org/software/emacs/
Source: ftp://ftp.gnu.org/pub/gnu/%{name}/%{name}-%{version}.tar.gz
Source1: %{name}-xemacs.desktop
Source2: %{name}-xemacs.png
Patch0: %{name}-22.2-infofix.patch
Patch1: %{name}-22.3-security_mktemp.patch
Patch2: %{name}-21.3-ia64.patch
Patch3: %{name}-21.3-x86_64.patch
Patch4: emacs-24.3-libgif-5.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: ldconfig
BuildRequires: libICE-devel
BuildRequires: libSM-devel
%if "%{?stage1}" != "1"
BuildRequires: libX11-devel
BuildRequires: libXcomposite-devel
BuildRequires: libXext-devel
BuildRequires: libXfixes-devel
BuildRequires: libXinerama-devel
BuildRequires: libXpm-devel
BuildRequires: libXrandr-devel
BuildRequires: libXrender-devel
%endif
BuildRequires: libacl-devel
BuildRequires: libalsa-devel
BuildRequires: libatk-devel
BuildRequires: libcairo-devel
BuildRequires: libdbus-devel
BuildRequires: libfontconfig-devel
BuildRequires: libfreetype-devel
BuildRequires: libgdk-pixbuf-devel
BuildRequires: libgif-devel
BuildRequires: libglib-devel
BuildRequires: libgmp-devel
BuildRequires: libgnutls-devel
BuildRequires: libgpm-devel
BuildRequires: libgtk-devel
BuildRequires: libharfbuzz-devel
BuildRequires: libjansson-devel
BuildRequires: libjpeg-devel
BuildRequires: liblcms2-devel
BuildRequires: libncurses-devel
BuildRequires: libpango-devel
%if "%{?stage1}" != "1"
BuildRequires: libpng-devel
%endif
BuildRequires: librsvg-devel
BuildRequires: libselinux-devel
BuildRequires: libsoup-devel
BuildRequires: libsystemd-devel
%if "%{?stage1}" != "1"
BuildRequires: libtiff-devel
BuildRequires: libwebkit2gtk-devel
%endif
BuildRequires: libxcb-devel
BuildRequires: libxml2-devel
BuildRequires: libz-devel
## AUTOBUILDREQ-END
BuildRequires: debianutils
%if "%{?stage1}" != "1"
BuildRequires: Xaw3d-devel
#BuildRequires: libungif-devel
BuildRequires: liblesstif-devel
%endif
BuildRequires: pkgconfig
BuildRequires: texinfo
Requires: debianutils
Requires(post):%{__install_info}
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%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 includes the libraries you need to run the Emacs editor, so you need to install this package if you intend to use Emacs.
You also need to install the actual Emacs program package (emacs-nox or emacs-X11).
Install emacs-nox if you are not going to use the X Window System; install emacs-X11 if you will be using X.
%package el
Summary: The sources for elisp programs included with Emacs
Group: Applications/Text
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%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 doc
Summary: Emacs documentation
Group: Documentation
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description doc
The Emacs documentation.
%package leim
Summary: Emacs Lisp code for input methods for internationalization
Group: Applications/Text
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description leim
The Emacs Lisp code for input methods for various international character scripts.
%package nox
Summary: The Emacs text editor without support for the X Window System
Group: Applications/Text
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Provides: %{name}-bin
%description nox
Emacs-nox is the Emacs text editor program without support for the X Window System.
You need to install this package only if you plan on exclusively using Emacs without the X Window System (emacs-X11 will work both in X and out of X, but emacs-nox will only work outside of X).
You'll also need to install the emacs package in order to run Emacs.
%package X11
Summary: The Emacs text editor for the X Window System
Group: Graphical Desktop/Applications/Office
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Provides: %{name}-bin
%description X11
Emacs-X11 includes the Emacs text editor program for use with the X Window System (it provides support for the mouse and other GUI elements).
Emacs-X11 will also run Emacs outside of X, but it has a larger memory footprint than the 'non-X' Emacs package (emacs-nox).
Install emacs-X11 if you're going to use Emacs with the X Window System.
You should also install emacs-X11 if you're going to run Emacs both with and without X (it will work fine both ways).
You'll also need to install the emacs package in order to run Emacs.
%debug_package
%prep
%setup -q -n %{name}-%{dirver}
#-D -T
#%patch0 -p1 -b .infofix
#%patch1 -p1 -b .security_mktemp
#patch2 -p1 -b .ia64
#patch3 -p1 -b .x86_64
#%patch4 -p1
#sed -i 's/ctags/gctags/g' etc/etags.1
#./autogen.sh
%build
#:<< _EOF
CFLAGSEXTRA="-DMAIL_USE_LOCKF -DSYSTEM_PURESIZE_EXTRA=16777216"
#CONFOPTS="\
#--build=%{_build} \
#--host=%{_host} \
#--prefix=%{_prefix} \
#--libdir=%{_libdir} \
#--libexecdir=%{_libdir} \
#--mandir=%{_mandir} \
#--infodir=%{_infodir} \
#--sharedstatedir=/var \
#--with-pop"
# build binary with X support
%if "%{?stage1}" != "1"
[ -d build-withx ] && rm -rf build-withx
mkdir build-withx && cd build-withx
ln -s ../configure .
CFLAGS="%{optflags} $CFLAGSEXTRA" LDFLAGS=-s \
%configure ${CONFOPTS} \
--libexecdir=%{_libdir} \
--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 \
--with-sound \
%{_arch}-pc-linux-gnu
%make bootstrap
%make systemdunitdir=%{_userunitdir}
cd ..
%endif
# build binary without X support
[ -d build-nox ] && rm -rf build-nox
mkdir build-nox && cd build-nox
ln -s ../configure .
CFLAGS="%{optflags} $CFLAGSEXTRA" LDFLAGS=-s \
%configure ${CONFOPTS} \
--libexecdir=%{_libdir} \
--with-x=no \
--with-modules \
--with-json
%make bootstrap
%make systemdunitdir=%{_userunitdir}
cd ..
%install
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
PATH=$PATH:/sbin
ARCHDIR=%{_arch}-pc-linux-gnu
%if "%{?stage1}" != "1"
%define opt_build withx
%else
%define opt_build nox
%endif
%makeinstall -C build-%{opt_build} \
systemdunitdir=%{_userunitdir}
#\
# sharedstatedir=%{buildroot}/var \
# libexecdir=%{buildroot}%{_libdir} \
# systemdunitdir=%{_userunitdir}
# Remove emacs.pdmp from common
rm %{buildroot}%{_libdir}/emacs/%{dirver}/%{_host}/emacs.pdmp
# Install emacs.pdmp of the emacs with GTK+
install -p -m 0644 build-withx/src/emacs.pdmp %{buildroot}%{_bindir}/emacs-%{dirver}.pdmp
# Install the emacs without X
install -p -m 0755 build-nox/src/emacs %{buildroot}%{_bindir}/emacs-%{dirver}-nox
install -p -m 0644 build-nox/src/emacs.pdmp %{buildroot}%{_bindir}/emacs-%{dirver}-nox.pdmp
rm -f %{buildroot}%{_infodir}/dir
mv %{buildroot}%{_mandir}/man1/ctags.1.gz %{buildroot}%{_mandir}/man1/gctags.1.gz
mv %{buildroot}%{_bindir}/ctags %{buildroot}%{_bindir}/gctags
# remove sun specific stuff
rm -f %{buildroot}%{_datadir}/%{name}/%{dirver}/etc/emacstool.1
# remove unuseful stuff
rm -f %{buildroot}%{_datadir}/%{name}/%{dirver}/etc/sex.6
rm -f %{buildroot}%{_libdir}/%{name}/%{dirver}/%{_arch}-pc-linux-gnu/fakemail
rm -f %{buildroot}%{_infodir}/dir
rm -f %{buildroot}%{_localstatedir}/games/emacs/*
install -d %{buildroot}%{_libdir}/%{name}/site-lisp
# create file lists
find %{buildroot}%{_datadir}/%{name}/%{dirver}/lisp \
-name '*.elc' -print -o -type d -printf "%%%%dir %%p\n" | \
grep -v lisp/leim | \
sed "s,%{buildroot},," > core-filelist
find %{buildroot}%{_libdir}/%{name}/%{dirver} -type f | \
sed "s,%{buildroot},," | grep -v movemail >> core-filelist
# include .el files which lack a corresponding byte compiled form
for f in `find %{buildroot}%{_datadir}/%{name}/%{dirver}/lisp -name '*.el'`; do
[ -e `dirname $f`/`basename $f .el`.elc ] ||
echo $f | sed "s,%{buildroot},,"
done >> core-filelist
# move docs from emacs to emacs-el to reduce emacs core size
# (tutorials, news, postscript files, ...)'
find %{buildroot}%{_datadir}/%{name}/%{dirver}/etc/ -type f | \
egrep -v 'DOC|TUTORIAL|NEWS|ONEWS|termcap.src|\.ps$' | \
sed "s,%{buildroot},," >> core-filelist
find %{buildroot}%{_datadir}/%{name}/%{dirver}/etc/ -type d -printf "%%%%dir %%p\n" | \
sed "s,%{buildroot},," >> core-filelist
# these two files're needed by ps-print
for f in %{_datadir}/%{name}/%{dirver}/etc/ps-prin{0,1}.ps; do
echo $f >> core-filelist
done
find %{buildroot}%{_datadir}/%{name}/%{dirver}/etc/ -type f | \
egrep 'termcap.src' | fgrep -v /etc/ps-prin | \
sed "s,%{buildroot},," > el-filelist
find %{buildroot}%{_datadir}/%{name}/%{dirver}/etc/ -type f | \
egrep 'TUTORIAL|NEWS|ONEWS|.ps$' | fgrep -v /etc/ps-prin | \
sed "s,%{buildroot},," > doc-filelist
# include all non elisp files which emacs installs
find %{buildroot}%{_datadir}/%{name}/%{dirver}/lisp -type f | \
sed "s,%{buildroot},," | grep -v "\.el\(c\)\?$" >> core-filelist
find %{buildroot}%{_datadir}/%{name}/%{dirver}/lisp/leim \
-name '*.elc' -print -o -mindepth 1 -type d -printf "%%%%dir %%p\n" | \
sed "s^%{buildroot}^^" > leim-filelist
# be sure to exclude some files which are need in core package
for f in `find %{buildroot}%{_datadir}/%{name}/%{dirver}/lisp -name '*.el'`; do
[ -e `dirname $f`/`basename $f .el`.elc ] &&
echo $f | sed "s,%{buildroot},,"
done >> el-filelist
find %{buildroot}%{_datadir}/%{name}/%{dirver}/lisp/leim \
-name '*.el.gz' -print | sed "s,%{buildroot},," | \
grep -v "leim\/leim-list.el" >> el-filelist
%if "%{?stage1}" == "1"
rm -rf %{buildroot}%{_datadir}/icons %{buildroot}%{_datadir}/applications
%endif
rm -f %{buildroot}%{_bindir}/%{name}
ln -sf %{_bindir}/%{name}-%{dirver}-nox %{buildroot}%{_bindir}/%{name}
%if "%{?stage1}" != "1"
ln -sf %{_bindir}/%{name}-%{dirver} %{buildroot}%{_bindir}/x%{name}
# install a menu entry for xemacs
install -D -m0644 %{S:1} %{buildroot}%{_datadir}/applications/xemacs.desktop
install -D -m0644 %{S:2} %{buildroot}%{_datadir}/pixmaps/xemacs.png
rm -f %{buildroot}%{_datadir}/applications/emacs.desktop
%endif
# info.info conflicting with texinfo 5.1
rm -f %{buildroot}%{_infodir}/info.info.*
#mkdir -p %{buildroot}%{_userunitdir}
#mv %{buildroot}%{_libdir}/systemd/user/emacs.service %{buildroot}%{_userunitdir}/emacs.service
%clean
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
%define info_files ada-mode autotype ccmode cl dired-x ebrowse ediff efaq emacs emacs-mime eshell eudc forms gnus idlwave message mh-e pcl-cvs reftex sc speedbar vip viper widget woman
%post
for info_file in %info_files
do %install_info $info_file
done
exit 0
%preun
for info_file in %info_files
do %uninstall_info $info_file
done
exit 0
%files -f core-filelist
%defattr(-,root,root)
%{_bindir}/gctags
%{_bindir}/emacsclient
%{_bindir}/ebrowse
%{_bindir}/etags
#%{_bindir}/grep-changelog
#%{_bindir}/rcs-checkin
%{_userunitdir}/emacs.service
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/%{dirver}
%dir %{_libdir}/%{name}/%{dirver}/%{_host}
%ifarch arm
%attr(755,root,root) %{_libdir}/%{name}/%{dirver}/%{_host}/movemail
%endif
%dir %{_datadir}/%{name}/site-lisp
%dir %{_datadir}/%{name}/%{dirver}/site-lisp
#%{_localstatedir}/games/%{name}/
%{_includedir}/emacs-module.h
%{_mandir}/man?/*
%{_infodir}/*
%exclude %{_datadir}/%{name}/%{version}/lisp/leim
%doc src/COPYING
%files -f doc-filelist doc
%defattr(-,root,root)
%exclude %{_datadir}/%{name}/%{version}/etc/refcards/*
%doc BUGS README
%files -f el-filelist el
%defattr(-,root,root)
%{_datadir}/%{name}/%{dirver}/site-lisp/subdirs.el
%{_datadir}/%{name}/site-lisp/subdirs.el
%files -f leim-filelist leim
%defattr(-,root,root)
%{_datadir}/%{name}/%{dirver}/lisp/leim/leim-list.el
%files nox
%defattr(-,root,root)
%{_bindir}/emacs
%{_bindir}/emacs-%{dirver}-nox
%{_bindir}/emacs-%{dirver}-nox.pdmp
%if "%{?stage1}" == "1"
%{_bindir}/emacs-%{dirver}
%endif
%{_datadir}/%{name}/%{dirver}/etc/DOC
#%doc src/COPYING
%if "%{?stage1}" != "1"
%files X11
%defattr(-,root,root)
%{_bindir}/emacs-%{dirver}
%{_bindir}/emacs-%{dirver}.pdmp
%{_bindir}/xemacs
%{_datadir}/pixmaps/xemacs.png
%{_datadir}/applications/xemacs.desktop
%{_datadir}/metainfo/emacs.appdata.xml
%{_datadir}/icons/hicolor/*/apps/emacs*.png
%{_datadir}/icons/hicolor/scalable/apps/emacs.ico
%{_datadir}/icons/hicolor/scalable/apps/emacs.svg
%{_datadir}/icons/hicolor/scalable/mimetypes/emacs-document*.svg
%endif
%changelog
* Sat Oct 24 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 27.1-2mamba
- remove emacs.pdmp causing conflicts when using differant emacs x/nox target
- update configure (with gtk3) and specfile cleanups
* Thu Aug 13 2020 Automatic Build System <autodist@mambasoft.it> 27.1-1mamba
- automatic version update by autodist
* Thu Aug 29 2019 Automatic Build System <autodist@mambasoft.it> 26.3-1mamba
- automatic version update by autodist
* Fri Apr 19 2019 Automatic Build System <autodist@mambasoft.it> 26.2-1mamba
- automatic version update by autodist
* Sun Jun 17 2018 Automatic Build System <autodist@mambasoft.it> 26.1-1mamba
- automatic version update by autodist
* Sun Sep 17 2017 Automatic Build System <autodist@mambasoft.it> 25.3-1mamba
- automatic version update by autodist
* Sat Apr 22 2017 Automatic Build System <autodist@mambasoft.it> 25.2-1mamba
- automatic version update by autodist
* Sun Oct 02 2016 Automatic Build System <autodist@mambasoft.it> 25.1-1mamba
- automatic version update by autodist
* Mon Apr 20 2015 Automatic Build System <autodist@mambasoft.it> 24.5-1mamba
- automatic version update by autodist
* Thu Oct 30 2014 Automatic Build System <autodist@mambasoft.it> 24.4-1mamba
- automatic version update by autodist
* Wed Dec 11 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 24.3-3mamba
- added build patch against libgif 5
* Mon Mar 18 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 24.3-2mamba
- don't install info.info.gz conflicting with texinfo 5.1
* Fri Mar 15 2013 Automatic Build System <autodist@mambasoft.it> 24.3-1mamba
- automatic version update by autodist
* Tue Aug 21 2012 Automatic Build System <autodist@mambasoft.it> 24.2-1mamba
- automatic version update by autodist
* Tue Jun 12 2012 Automatic Build System <autodist@mambasoft.it> 24.1-1mamba
- automatic version update by autodist
* Sat Jan 28 2012 Automatic Build System <autodist@mambasoft.it> 23.4-1mamba
- automatic version update by autodist
* Sat Nov 26 2011 Automatic Build System <autodist@mambasoft.it> 23.3b-1mamba
- automatic version update by autodist
* Sun Aug 07 2011 Automatic Build System <autodist@mambasoft.it> 23.3a-1mamba
- automatic version update by autodist
* Thu Mar 10 2011 Automatic Build System <autodist@mambasoft.it> 23.3-1mamba
- automatic update by autodist
* Sun Aug 22 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 23.2-2mamba
- pass correct host and build to configure
* Sat May 08 2010 Automatic Build System <autodist@mambasoft.it> 23.2-1mamba
- automatic update to 23.2 by autodist
* Sun Aug 02 2009 Automatic Build System <autodist@mambasoft.it> 23.1-1mamba
- automatic update to 23.1 by autodist
* Mon Sep 08 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 22.3-1mamba
- automatic update to 22.3 by autodist
* Tue Jun 03 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 22.2-1mamba
- update to 22.2
* Mon Jun 11 2007 Aleph0 <aleph0@openmamba.org> 22.1-1mamba
- update to 22.1
- /usr/X11R6/lib/X11/app-defaults/Emacs moved to %{_datadir}/X11/app-defaults/Emacs
- add %%optflags options to CFLAGS
- remove /var/games for now
- new icon
* Tue Dec 13 2005 Stefano Cotta Ramusino <stefano.cotta@qilinux.it> 21.4-2qilnx
- specfile fixes
- fixed group of X11 subpackage
- X11 subpackage excluded in bootstrap compilations
* Tue Apr 12 2005 Davide Madrisan <davide.madrisan@qilinux.it> 21.4-1qilnx
- update to version 21.4a by autospec
- also fixes security issue QSA-2005-038 (CAN-2005-0100)
- added %%post and %%preun scriptlets
* Wed Jan 05 2005 Davide Madrisan <davide.madrisan@qilinux.it> 21.3-5qilnx
- make emacs a symlink to the emacs binary build with no X11 support
- added KDE menu entry
* Thu Dec 09 2004 Davide Madrisan <davide.madrisan@qilinux.it> 21.3-4qilnx
- ctags binary and man page renamed to gctags
* Mon Nov 29 2004 Davide Madrisan <davide.madrisan@qilinux.it> 21.3-3qilnx
- added leim source and package
- specfile rewritten
- splitted emacs into several packages
- fixed insecure temporary file creation in the bash scripts
- added emacs.desktop to display the emacs antry in the KDE menu
* Mon Apr 14 2003 Alessandro Ramazzina <alessandro.ramazzina@qinet.it> 21.3-1qilnx
- creation of emacs package