Name:		ctags
Version:	6.2.1
Release:	2
Summary:	A C programming language indexing and/or cross-reference tool

License:	GPL-2.0-or-later
URL:		https://ctags.io/
Source0:	https://github.com/universal-ctags/ctags/releases/download/v%{version}/universal-ctags-%{version}.tar.gz

BuildRequires:	gcc make
BuildRequires:  pkgconfig(jansson)
BuildRequires:  pkgconfig(libpcre2-8)
BuildRequires:  pkgconfig(libseccomp)
BuildRequires:  pkgconfig(libxml-2.0) >= 2.7.7
BuildRequires:  pkgconfig(yaml-0.1)
BuildRequires:  /usr/bin/sphinx-build

Provides:       ctags-etags = %{version}-%{release}
Obsoletes:      ctags-etags < %{version}-%{release}
Provides:       universal-ctags = %{version}-%{release}
Obsoletes:      universal-ctags < %{version}-%{release}

%description
Ctags generates an index (or tag) file of language objects found in source
files that allows these items to be quickly and easily located by a text
editor or other utility. A tag signifies a language object for which an
index entry is available (or, alternatively, the index entry created for
that object).

This package will also generate tags in a format which GNU Emacs understand,
it's a alternativ implementation of the GNU etags program.

%package help
Buildarch: noarch
Summary: Man pages of %{name}
Provides: universal-ctags-help = %{version}-%{release}
Obsoletes: universal-ctags-help < %{version}-%{release}

%description help
Man pages of %{name}.

%prep
%autosetup -n universal-ctags-%{version} -p1

%build
%configure --enable-lto
%make_build

%install
%make_install
cd %{buildroot}%{_bindir}
ln -s ctags etags.ctags

%check
%make_build check

%files
%license COPYING
%doc README.md
%{_bindir}/ctags
%{_bindir}/etags.ctags
%{_bindir}/optscript
%{_bindir}/readtags

%files help
%{_mandir}/man?/*

%changelog
* Fri Nov 28 2025 Funda Wang <fundawang@yeah.net> - 6.2.1-2
- use upstream tarball rather than git archive
- add more features for easy upgrading from other distros

* Tue Nov 25 2025 Wang Kui <wangkui35@h-partners.com> - 6.2.1-1
- Update to 6.2.1

* Thu Nov 28 2024 sqfu <dev01203@linx-info.com> - 5.8-30
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix invalid soft links

* Thu Sep 21 2023 dillon chen <dillon.chen@gmail.com> - 5.8-29
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:CVE-2022-4515

* Mon Aug 16 2021 yixiangzhike <zhangxingliang3@huawei.com> - 5.8-28
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:rename the local __unused__ to __ctags_unused__

* Tue Sep 24 2019 shenyangyang<shenyangyang4@huawei.com> - 5.8-27
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:revise packages and help package

* Thu Sep 12 2019 shenyangyang<shenyangyang4@huawei.com> - 5.8-26
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix the alternative bug after uninstall ctags(bug 17)

* Mon Aug 12 2019 openEuler Builteam <buildteam@openeuler.org> - 5.8-25
- Package init