File gnuserv.spec of Package gnuserv

#
# spec file for package gnuserv
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           gnuserv
BuildRequires:  autoconf
BuildRequires:  emacs-nox
BuildRequires:  xorg-x11
BuildRequires:  xorg-x11-devel
Provides:       fgnuserv 
Obsoletes:      fgnuserv
Summary:        Server and Clients for Emacs
License:        GPL-2.0+
Group:          Productivity/Editors/Emacs
Version:        3.12.6
Release:        0
Source:         http://meltin.net/hacks/emacs/gnuserv-%{version}.tar.gz
Source1:        %{name}-README.SuSE
Patch:          gnuserv-3.12.6.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This package is not required for XEmacs, because the tools included
here are a part of the XEmacs package.

With these tools, an already running Emacs can be accessed externally,
for example, in order to edit a file or run a code in Emacs Lisp. This
way, there is no need to start a new Emacs each time another
application loads an editor.

Find hints at /usr/share/doc/packages/gnuserv/README.SuSE.



Authors:
--------
    Andy Norman  <ange@hplb.hpl.hp.com>
    Arup Mukherjee <arup@cmu.edu>
    Bob Weiner <weiner@mot.com>
    Darrell Kindred <dkindred@cmu.edu>
    Martin Schwenke <martin@meltin.net>
    Noah Friedman <friedman@prep.ai.mit.edu>

%define INSTALL install -m755 -s
%define INSTALL_DIR install -d -m755
%define INSTALL_DATA install -m644

%prep
%setup -q
cp -p %{S:1} README.SuSE
%patch -p1

%build
# export LC_CTYPE=ISO-8859-1
autoreconf -fi
./configure --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} --x-includes=/usr/include
make "CFLAGS=$RPM_OPT_FLAGS"
make gnuserv.elc
# emacs -batch -f batch-byte-compile gnuserv.el

%install
%{INSTALL_DIR} $RPM_BUILD_ROOT%{_mandir}/man1 \
               $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
make install prefix=$RPM_BUILD_ROOT%{_prefix} \
	     man1dir=$RPM_BUILD_ROOT%{_mandir}/man1
make install-elisp elispdir=$RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp \
                   prefix=$RPM_BUILD_ROOT%{_prefix}
pushd $RPM_BUILD_ROOT%{_mandir}/man1
for f in *.1 ; do
  case $f in
    gnuserv.1)
      # To avoid conflict with xemacs:
      mv $f emacs-$f
      ;;
    *)
      rm -f $f
      ln -s emacs-gnuserv.1.gz emacs-$f.gz
      ;;
  esac
done
popd
mv README.orig README.%{name}

%clean
rm -fr $RPM_BUILD_ROOT

%files
%defattr(-, root, root)
%doc COPYING README README.%{name} README.SuSE
%{_bindir}/*
%{_mandir}/man1/*
%{_datadir}/emacs/site-lisp/*

%changelog