add subpackage git-core

This commit is contained in:
duyiwei 2022-02-16 13:50:12 +08:00
parent 12156c3389
commit 0123a0a663

View File

@ -1,7 +1,7 @@
%global gitexecdir %{_libexecdir}/git-core
Name: git
Version: 2.33.0
Release: 1
Release: 2
Summary: A popular and widely used Version Control System
License: GPLv2+ or LGPLv2.1
URL: https://git-scm.com/
@ -15,9 +15,9 @@ Source102: git.socket
BuildRequires: gcc gettext
BuildRequires: openssl-devel libcurl-devel expat-devel systemd asciidoc xmlto glib2-devel libsecret-devel pcre-devel desktop-file-utils
BuildRequires: python3-devel perl-generators perl-interpreter perl-Error perl(Test::More) perl-MailTools perl(Test)
Requires: less zlib openssh-clients perl(Term::ReadKey) perl-Git
Obsoletes: %{name}-core %{name}-core-doc %{name}-subtree %{name}-p4 git-cvs < %{version}-%{release}
Provides: %{name} <= %{version}-%{release} %{name}-core %{name}-subtree %{name}-p4
Requires: less zlib openssh-clients perl(Term::ReadKey) perl-Git git-core = %{version}-%{release}
Obsoletes: %{name}-core-doc %{name}-subtree %{name}-p4 git-cvs < %{version}-%{release}
Provides: %{name} <= %{version}-%{release} %{name}-subtree %{name}-p4
%description
Git is a free and open source distributed version control system
@ -28,6 +28,21 @@ performance. It outclasses SCM tools like Subversion, CVS, Perforce,
and ClearCase with features like cheap local branching, convenient
staging areas, and multiple workflows.
%package core
Summary: Core package of git with minimal functionality
Requires: less
Requires: openssh-clients
Requires: zlib >= 1.2
%description core
Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations
and full access to internals.
The git-core rpm installs really the core tools with minimal
dependencies. Install git package for common set of tools.
To install all git packages, including tools for integrating with
other SCMs, install the git-all meta-package
%package daemon
Summary: Git server daemon
Requires: %{name} = %{version}-%{release} systemd
@ -182,12 +197,21 @@ cat %{name}.lang >> git-bin-files
(find %{buildroot}{%{_bindir},%{gitexecdir}} -type f -o -type l | grep -vE "git-(gui|daemon|cvs|svn|instaweb|citool|send-email)" | \
sed -e s@^%{buildroot}@@) >> git-bin-files
exclude_re="archimport|email|git-(citool|credential-libsecret|cvs|daemon|gui|instaweb|p4|subtree|svn)|gitk|gitweb|p4merge"
(find %{buildroot}{%{_bindir},%{_libexecdir}} -type f -o -type l | grep -vE "$exclude_re" | sed -e s@^%{buildroot}@@) > bin-man-doc-files
(find %{buildroot}{%{_bindir},%{_libexecdir}} -mindepth 1 -type d | grep -vE "$exclude_re" | sed -e 's@^%{buildroot}@%dir @') >> bin-man-doc-files
(find %{buildroot}%{perl_vendorlib} -type f | sed -e s@^%{buildroot}@@) > perl-git-files
(find %{buildroot}%{perl_vendorlib} -mindepth 1 -type d | sed -e 's@^%{buildroot}@%dir @') >> perl-git-files
# split out perl files for Git and Git::SVN
grep Git/SVN perl-git-files > perl-git-svn-files
sed -i "/Git\/SVN/ d" perl-git-files
# Split core files
not_core_re="git-(add--interactive|contacts|credential-netrc|filter-branch|instaweb|request-pull|send-mail)|gitweb"
grep -vE "$not_core_re|%{_mandir}" bin-man-doc-files > bin-files-core
%check
make %{?_smp_mflags} test
@ -207,6 +231,19 @@ make %{?_smp_mflags} test
%doc README.md
%license LGPL-2.1 COPYING
%files core -f bin-files-core
%license LGPL-2.1 COPYING
# exclude is best way here because of troubles with symlinks inside git-core/
%exclude %{_datadir}/git-core/contrib/diff-highlight
%exclude %{_datadir}/git-core/contrib/hooks/multimail
%exclude %{_datadir}/git-core/contrib/hooks/update-paranoid
%exclude %{_datadir}/git-core/contrib/hooks/setgitperms.perl
%exclude %{_datadir}/git-core/templates/hooks/fsmonitor-watchman.sample
%exclude %{_datadir}/git-core/templates/hooks/pre-rebase.sample
%exclude %{_datadir}/git-core/templates/hooks/prepare-commit-msg.sample
%{_datadir}/bash-completion/completions
%{_datadir}/git-core/
%files daemon
%defattr(-,root,root)
%{_unitdir}/git.socket
@ -254,6 +291,9 @@ make %{?_smp_mflags} test
%{_mandir}/man7/git*.7.*
%changelog
* Thu Feb 17 2022 duyiwei <duyiwei@kylinos.cn> - 2.33.0-2
- add subpackage git-core
* Thu Dec 30 2021 zoulin<zoulin13@huawei.com> - 2.33.0-1
- update version to 2.33.0