cscope/cscope.spec

117 lines
3.8 KiB
RPMSpec
Raw Normal View History

Summary: C source code tree search and browse tool
Name: cscope
Version: 15.9
Release: 22%{?dist}
Source0: https://downloads.sourceforge.net/project/%{name}/%{name}/v%{version}/%{name}-%{version}.tar.gz
URL: http://cscope.sourceforge.net
License: BSD-3-Clause AND GPL-2.0-or-later
BuildRequires: pkgconf-pkg-config ncurses-devel gcc flex bison m4
BuildRequires: autoconf automake make
Requires: emacs-filesystem coreutils ed
2021-11-09 23:41:38 +00:00
%if !0%{?rhel} && 0%{?fedora} < 36
2018-03-01 19:19:18 +00:00
Requires: xemacs-filesystem
%endif
# upstream commits from https://sourceforge.net/p/cscope/cscope/commit_browser
Patch1: cscope-1-modified-from-patch-81-Fix-reading-include-files-in-.patch
Patch2: cscope-2-Cull-extraneous-declaration.patch
Patch3: cscope-3-Avoid-putting-directories-found-during-header-search.patch
Patch4: cscope-4-Avoid-double-free-via-double-fclose-in-changestring.patch
Patch5: cscope-5-contrib-ocs-Fix-bashims-Closes-480591.patch
Patch6: cscope-6-doc-cscope.1-Fix-hyphens.patch
Patch7: cscope-7-fscanner-swallow-function-as-parameters.patch
Patch8: cscope-8-emacs-plugin-fixup-GNU-Emacs-27.1-removes-function-p.patch
Patch9: cscope-9-fix-access-beyond-end-of-string.patch
Patch10: cscope-a-docs-typo-fixes-in-man-page-and-comments.patch
# distrubution patches which were not upstreamed
Patch11: dist-1-coverity-fixes.patch
Patch12: dist-2-cscope-indexer-help.patch
Patch13: dist-3-add-selftests.patch
Patch14: dist-4-fix-printf.patch
2019-04-16 14:56:27 +00:00
%define cscope_share_path %{_datadir}/cscope
2021-11-09 23:41:38 +00:00
%if !0%{?rhel} && 0%{?fedora} < 36
%define xemacs_lisp_path %{_datadir}/xemacs/site-packages/lisp
2021-11-09 23:41:38 +00:00
%else
%define xemacs_lisp_path %nil
%endif
%define emacs_lisp_path %{_datadir}/emacs/site-lisp
2011-06-01 13:20:53 +00:00
%define vim_plugin_path %{_datadir}/vim/vimfiles/plugin
%description
cscope is a mature, ncurses based, C source code tree browsing tool. It
allows users to search large source code bases for variables, functions,
macros, etc, as well as perform general regex and plain text searches.
Results are returned in lists, from which the user can select individual
matches for use in file editing.
%prep
%autosetup -p1
%build
aclocal
autoheader
autoconf
automake --add-missing
%configure
make
%install
rm -rf $RPM_BUILD_ROOT %{name}-%{version}.files
make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p $RPM_BUILD_ROOT/var/lib/cs
mkdir -p $RPM_BUILD_ROOT%{cscope_share_path}
cp -a contrib/xcscope/xcscope.el $RPM_BUILD_ROOT%{cscope_share_path}
2016-11-28 14:27:09 +00:00
install -m 755 contrib/xcscope/cscope-indexer $RPM_BUILD_ROOT%{_bindir}
2011-05-26 20:01:23 +00:00
cp -a contrib/cctree.vim $RPM_BUILD_ROOT%{cscope_share_path}
for dir in %{xemacs_lisp_path} %{emacs_lisp_path} ; do
mkdir -p $RPM_BUILD_ROOT$dir
ln -s %{cscope_share_path}/xcscope.el $RPM_BUILD_ROOT$dir
touch $RPM_BUILD_ROOT$dir/xcscope.elc
echo "%ghost $dir/xcscope.el*" >> %{name}-%{version}.files
done
%check
make check
%files -f %{name}-%{version}.files
%{_bindir}/*
%dir %{cscope_share_path}
2011-05-26 20:01:23 +00:00
%{cscope_share_path}/
%{_mandir}/man1/*
%dir /var/lib/cs
2011-05-26 20:01:23 +00:00
%doc AUTHORS COPYING ChangeLog README TODO contrib/cctree.txt
2021-11-09 23:41:38 +00:00
%if !0%{?rhel} && 0%{?fedora} < 36
%triggerin -- xemacs
ln -sf %{cscope_share_path}/xcscope.el %{xemacs_lisp_path}/xcscope.el
2018-03-01 19:19:18 +00:00
%endif
%triggerin -- emacs, emacs-nox, emacs-lucid
ln -sf %{cscope_share_path}/xcscope.el %{emacs_lisp_path}/xcscope.el
2011-05-26 20:01:23 +00:00
%triggerin -- vim-filesystem
ln -sf %{cscope_share_path}/cctree.vim %{vim_plugin_path}/cctree.vim
2021-11-09 23:41:38 +00:00
%if !0%{?rhel} && 0%{?fedora} < 36
%triggerun -- xemacs
[ $2 -gt 0 ] && exit 0
rm -f %{xemacs_lisp_path}/xcscope.el
2018-03-01 19:19:18 +00:00
%endif
%triggerun -- emacs, emacs-nox, emacs-lucid
[ $2 -gt 0 ] && exit 0
rm -f %{emacs_lisp_path}/xcscope.el
2011-05-26 20:01:23 +00:00
%triggerun -- vim-filesystem
[ $2 -gt 0 ] && exit 0
rm -f %{vim_plugin_path}/cctree.vim
%changelog
* Thu Feb 01 2024 Vladis Dronov <vdronov@redhat.com> - 15.9-22
- Use proper SPDX license identifiers (RHEL-30639)
* Fri Jan 26 2024 Vladis Dronov <vdronov@redhat.com> - 15.9-21
- Initial import from Fedora 40