File ctags.spec of Package ctags

# spec file for package ctags
# 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

Name:           ctags
%define ctags_ver	5.8
%define etags_ver
# Let the date means last update of either ctags or etags tarball
Version:        2011.8.2
Release:        1
License:        GPL-2.0+
Summary:        A Program to Generate Tag Files for Use with vi and Other Editors
Group:          Development/Tools/Navigators
Source0:        ctags-%{ctags_ver}.tar.gz
Source1:        etags-%{etags_ver}.tar.gz
Source2:        README.SuSE
Patch1:         ctags-5.7.diff
# No resources to make this patch work with ctags-5.8 (applied to ctags-5.7)
# Anyone is welcome to make it work again.
#Patch2:        ctags-ycp-parser.diff
Patch3:         ctags-date-time.patch
Patch4:         etags-%{etags_ver}.diff
Patch5:         etags-strcpy-overlap.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

CTags (from Darren Hiebert) generates tag files from source code in C,
C++, Eiffel, Fortran, and Java to be used with vi and its derivatives,
Emacs, and several other editors.

ETags (from GNU Emacs sources) generates tag files from source code in
Pascal, Cobol, Ada, Perl, LaTeX, Scheme, Emacs Lisp/Common Lisp,
Postscript, Erlang, Python, Prolog, and most assembler-like syntaxes.

%setup -q -n ctags-%{ctags_ver} -b 1
%patch3 -p1
cd ../etags-%{etags_ver}
%patch5 -p1

CFLAGS="%{optflags} -Wall"
export CFLAGS CC
./configure --prefix=/usr --mandir=%{_mandir} --disable-etags
make %{?_smp_mflags}
cd ../etags-%{etags_ver}
$CC $CFLAGS -o etags etags.c
$CC $CFLAGS -DCTAGS -o gnuctags etags.c

make install prefix=%{buildroot}/usr mandir=%{buildroot}%{_mandir}
mkdir -p %{buildroot}%{_docdir}/ctags/Exuberant_Ctags
install -m 644 COPYING EXTENDING.html FAQ README %{buildroot}%{_docdir}/ctags/Exuberant_Ctags
install -m 644 %{SOURCE2} %{buildroot}%{_docdir}/ctags
cd ../etags-%{etags_ver}
install -m 755 etags gnuctags %{buildroot}%{_prefix}/bin
install -m 644 etags.1 %{buildroot}%{_mandir}/man1
ln -sf etags.1.gz %{buildroot}%{_mandir}/man1/gnuctags.1.gz
install -m 644 ETAGS.README %{buildroot}%{_docdir}/ctags