You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
225 lines
6.6 KiB
225 lines
6.6 KiB
## |
|
## emacs.spec -- OpenPKG RPM Package Specification |
|
## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/> |
|
## |
|
## Permission to use, copy, modify, and distribute this software for |
|
## any purpose with or without fee is hereby granted, provided that |
|
## the above copyright notice and this permission notice appear in all |
|
## copies. |
|
## |
|
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
|
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
|
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
|
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
|
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
|
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
|
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
## SUCH DAMAGE. |
|
## |
|
|
|
# package version |
|
%define V_emacs 23.1 |
|
%define V_subdir 23.1 |
|
%define V_leim 21.4 |
|
|
|
# package information |
|
Name: emacs |
|
Summary: GNU Emacs Text Editor |
|
URL: http://www.gnu.org/software/emacs/ |
|
Vendor: Richard Stallmann et al. |
|
Packager: OpenPKG Foundation e.V. |
|
Distribution: OpenPKG Community |
|
Class: BASE |
|
Group: Editor |
|
License: GPL |
|
Version: %{V_emacs} |
|
Release: 20090730 |
|
|
|
# package options |
|
%option with_x11 no |
|
%option with_gtk no |
|
%option with_xaw3d no |
|
%option with_jpeg no |
|
%option with_png no |
|
%option with_tiff no |
|
%option with_gif no |
|
%option with_leim no |
|
|
|
# package option dependencies |
|
%if "%{with_jpeg}" == "yes" || "%{with_png}" == "yes" || "%{with_tiff}" == "yes" || "%{with_gif}" == "yes" || "%{with_xaw3d}" == "yes" || "%{with_gtk}" == "yes" |
|
%undefine with_x11 |
|
%define with_x11 yes |
|
%endif |
|
|
|
# list of sources |
|
Source0: ftp://ftp.gnu.org/gnu/emacs/emacs-%{V_emacs}.tar.gz |
|
Source1: ftp://ftp.gnu.org/gnu/emacs/leim-%{V_leim}.tar.gz |
|
|
|
# build information |
|
Prefix: %{l_prefix} |
|
BuildRoot: %{l_buildroot} |
|
BuildPreReq: OpenPKG, openpkg >= 20040130, make, binutils, texinfo |
|
PreReq: OpenPKG, openpkg >= 20040130 |
|
%if "%{with_x11}" == "yes" |
|
BuildPreReq: X11 |
|
PreReq: X11 |
|
%if "%{with_gtk}" == "yes" |
|
BuildPreReq: gtk2, pkgconfig |
|
PreReq: gtk2 |
|
%endif |
|
%if "%{with_xaw3d}" == "yes" |
|
BuildPreReq: xaw3d |
|
PreReq: xaw3d |
|
%endif |
|
%if "%{with_jpeg}" == "yes" |
|
BuildPreReq: jpeg |
|
PreReq: jpeg |
|
%endif |
|
%if "%{with_png}" == "yes" |
|
BuildPreReq: png, zlib |
|
PreReq: png, zlib |
|
%endif |
|
%if "%{with_tiff}" == "yes" |
|
BuildPreReq: tiff |
|
PreReq: tiff |
|
%endif |
|
%if "%{with_gif}" == "yes" |
|
BuildPreReq: giflib |
|
PreReq: giflib |
|
%endif |
|
%endif |
|
AutoReq: no |
|
AutoReqProv: no |
|
|
|
%description |
|
The popular GNU Emacs text editor, an extensible, customizable, |
|
self-documenting real-time display editor. GNU Emacs at its core |
|
is powered by an interpreter for Emacs Lisp, a dialect of the Lisp |
|
programming language with extensions to support text editing. |
|
|
|
%track |
|
prog emacs = { |
|
version = %{V_emacs} |
|
url = ftp://ftp.gnu.org/gnu/emacs/ |
|
regex = emacs-(__VER__)\.tar\.gz |
|
} |
|
prog emacs:leim = { |
|
version = %{V_leim} |
|
url = ftp://ftp.gnu.org/gnu/emacs/ |
|
regex = leim-(__VER__)\.tar\.gz |
|
} |
|
|
|
%prep |
|
%setup -q -n emacs-%{V_subdir} |
|
%if "%{with_leim}" == "yes" |
|
%setup -q -n emacs-%{V_subdir} -T -D -b 1 |
|
%endif |
|
case "%{l_platform -p}" in |
|
ix86-fedora[4-7] ) %{l_shtool} subst -e 's;/\* \(#define CANNOT_DUMP\) \*/;\1 1;' src/m/intel386.h ;; |
|
esac |
|
|
|
%build |
|
# configure program |
|
%if "%{with_xaw3d}" != "yes" |
|
( echo "ac_cv_header_X11_Xaw3d_Scrollbar_h=no" |
|
echo "ac_cv_lib_Xaw3d_XawScrollbarSetThumb=no" |
|
) >config.cache |
|
%endif |
|
%{l_shtool} subst \ |
|
-e 's;/${version}/;/;g' \ |
|
-e 's;/${version};;g' \ |
|
-e 's;/${configuration};;g' \ |
|
configure |
|
%if "%{with_leim}" == "yes" |
|
%{l_shtool} subst \ |
|
-e 's;/${version}/;/;g' \ |
|
leim/Makefile.in |
|
%endif |
|
CC="%{l_cc}" \ |
|
CFLAGS="%{l_cflags -O}" \ |
|
%if "%{with_tiff}" == "yes" |
|
CPPFLAGS="%{l_cppflags tiff .}" \ |
|
%else |
|
CPPFLAGS="%{l_cppflags}" \ |
|
%endif |
|
LDFLAGS="%{l_ldflags}" \ |
|
./configure \ |
|
%if "%{with_xaw3d}" != "yes" |
|
--cache-file=./config.cache \ |
|
%endif |
|
--prefix=%{l_prefix} \ |
|
--mandir=%{l_prefix}/man \ |
|
--infodir=%{l_prefix}/info \ |
|
%if "%{with_x11}" == "yes" |
|
--with-x \ |
|
--x-includes=`%{l_rc} --query x11_incdir` \ |
|
--x-libraries=`%{l_rc} --query x11_libdir` \ |
|
%if "%{with_gtk}" == "yes" |
|
--with-x-toolkit=gtk \ |
|
%else |
|
--with-x-toolkit=athena \ |
|
%endif |
|
%if "%{with_xaw3d}" == "yes" |
|
--with-toolkit-scroll-bars \ |
|
%else |
|
--without-toolkit-scroll-bars \ |
|
%endif |
|
%if "%{with_jpeg}" == "yes" |
|
--with-jpeg \ |
|
%endif |
|
%if "%{with_png}" == "yes" |
|
--with-png \ |
|
%endif |
|
%if "%{with_tiff}" == "yes" |
|
--with-tiff \ |
|
%endif |
|
%if "%{with_gif}" == "yes" |
|
--with-gif \ |
|
%endif |
|
%else |
|
--with-x-toolkit=no \ |
|
--without-x |
|
%endif |
|
|
|
# build program |
|
cmd="%{l_make} %{l_mflags -O}" |
|
if [ ".`uname -s`" = .Linux ] && %{l_shtool} path -s setarch; then |
|
# work-around conflicting Exec-shield security feature |
|
cmd="setarch i386 $cmd" |
|
fi |
|
eval $cmd |
|
|
|
%install |
|
# install program |
|
rm -rf $RPM_BUILD_ROOT |
|
%{l_make} %{l_mflags} install DESTDIR="$RPM_BUILD_ROOT" |
|
|
|
# strip down installation files |
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/emacs-%{version} |
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/rcs-checkin |
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/[ce]tags |
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/[ce]tags.1 |
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/b2m |
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/var |
|
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
|
strip $RPM_BUILD_ROOT%{l_prefix}/libexec/emacs/* >/dev/null 2>&1 || true |
|
|
|
# rearrange and strip down info pages |
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir |
|
mv $RPM_BUILD_ROOT%{l_prefix}/info $RPM_BUILD_ROOT%{l_prefix}/info.old |
|
%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/info |
|
mv $RPM_BUILD_ROOT%{l_prefix}/info.old/emacs* $RPM_BUILD_ROOT%{l_prefix}/info/ |
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/info.old |
|
|
|
# determine installation files |
|
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} |
|
|
|
%files -f files |
|
|
|
%clean |
|
rm -rf $RPM_BUILD_ROOT |
|
|
|
|