summaryrefslogtreecommitdiff
path: root/git.spec
blob: bf0622b3684ba7d060c0cc310836297829c170e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
%global gitexecdir          %{_libexecdir}/git-core
Name:       git
Version:    2.47.0
Release:    1
Summary:    A popular and widely used Version Control System
License:    BSD-3-Clause AND GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-or-later AND MIT
URL:        https://git-scm.com/
Source0:    https://www.kernel.org/pub/software/scm/git/%{name}-%{version}.tar.xz

Source100:  git-gui.desktop
Source101:  git@.service.in
Source102:  git.socket

BuildRequires: gcc gettext
BuildRequires: openssl-devel libcurl-devel expat-devel systemd asciidoc xmlto glib2-devel libsecret-devel pcre2-devel desktop-file-utils
BuildRequires: python3-devel perl-generators perl-interpreter perl-Error perl(Test::More) perl-MailTools perl(Test)
Requires:      perl(Term::ReadKey) perl-Git git-core = %{version}-%{release}
Obsoletes:     %{name}-subtree < %{version}-%{release} %{name}-p4 < %{version}-%{release} git-cvs < %{version}-%{release}
Provides:      %{name} = %{version}-%{release} %{name}-subtree = %{version}-%{release} %{name}-p4 = %{version}-%{release}

%description
Git is a free and open source distributed version control system
designed to handle everything from small to very large projects
with speed and efficiency.
Git is easy to learn and has a tiny footprint with lightning fast
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

%description daemon
%{summary}.


%package gui
Summary:     Graphical user interface to Git
BuildArch:      noarch
Requires:    %{name} = %{version}-%{release} tk

%description gui
%{summary}.


%package -n gitk
Summary:     TK based graphical tool for visualization of Git 
BuildArch:      noarch
Requires:    %{name} = %{version}-%{release} tk

%description -n gitk
%{summary}.


%package web
Summary:     Git web interfaces
BuildArch:      noarch
Requires:    %{name} = %{version}-%{release}
Obsoletes:   gitweb < %{version}-%{release} %{name}-instaweb < %{version}-%{release}
Provides:    gitweb = %{version}-%{release} %{name}-instaweb = %{version}-%{release}

%description web
Git web interface allows user browsing git repositories via web service.

%package svn
Summary:    Git tools for importing Subversion repositories
BuildArch:      noarch
Requires:    %{name} = %{version}-%{release} subversion perl-TermReadKey perl-Digest-MD5

%description svn
%{summary}.

%package email
Summary:        Git tools for sending patches via email
BuildArch:      noarch
Requires:       git = %{version}-%{release}
Requires:       perl-Authen-SASL perl-Net-SMTP-SSL

%description email
%{summary}.

%package -n perl-Git
Summary:        Perl interface to Git
BuildArch:      noarch
Requires:       git = %{version}-%{release}  perl(:MODULE_COMPAT_%(perl -V:version | cut -d"'" -f 2))

%description -n perl-Git
%{summary}.

%package -n perl-Git-SVN
Summary:        Perl interface to Git::SVN
BuildArch:      noarch
Requires:       git = %{version}-%{release}  perl(:MODULE_COMPAT_%(perl -V:version | cut -d"'" -f 2))

%description -n perl-Git-SVN
%{summary}.

%package help
Summary:     Man pages and documents for Git system
BuildArch:   noarch
Obsoletes:   %{name}-core-doc < %{version}-%{release}
Provides:    %{name}-core-doc = %{version}-%{release}

%description help
%{summary}.

%prep
%autosetup -n %{name}-%{version} -p1

rm -rf perl/Git/LoadCPAN{.pm,/}
grep -rlZ '^use Git::LoadCPAN::' | xargs -r0 sed -i 's/Git::LoadCPAN:://g'

sed -i '/^git-cvs/d' command-list.txt

%build
%configure

# Some options can not configure in configure script,  so give options here (config.mak included in Makefile)
cat > config.mak << EOF
CFLAGS = %{optflags}
LDFLAGS = %{__global_ldflags}
NEEDS_CRYPTO_WITH_SSL = 1
USE_LIBPCRE = 1
INSTALL_SYMLINKS = 1
GNU_ROFF = 1
GITWEB_PROJECTROOT = %{_localstatedir}/lib/git
PYTHON_PATH = %{__python3}
htmldir = %{?_pkgdocdir}
perllibdir = %{perl_vendorlib}
gitwebdir = %{_localstatedir}/www/git
NO_PERL_CPAN_FALLBACKS = 1
EOF

%make_build
%make_build -C contrib/subtree/
%make_build -C contrib/contacts/
%make_build -C contrib/credential/libsecret/
%make_build -C contrib/credential/netrc/
%make_build -C contrib/diff-highlight/

%install
%make_install %{_smp_mflags} install-doc
%make_install %{_smp_mflags} -C contrib/subtree/ install-doc
%make_install %{_smp_mflags} -C contrib/contacts/ install-doc

install -p -m 644 README.md %{buildroot}%{_pkgdocdir}
install -p -m 644 gitweb/INSTALL %{buildroot}%{_pkgdocdir}/INSTALL.gitweb
install -p -m 644 gitweb/README %{buildroot}%{_pkgdocdir}/README.gitweb

#setup bash completion
install -Dpm 644 contrib/completion/git-completion.bash %{buildroot}%{_datadir}/bash-completion/completions/git
ln -s git %{buildroot}%{_datadir}/bash-completion/completions/gitk

# install contrib to git-core
mkdir -p %{buildroot}%{_datadir}/git-core/contrib/completion
install -p -m 644 contrib/completion/git-completion.tcsh %{buildroot}%{_datadir}/git-core/contrib/completion/

# install root path for gitweb
mkdir -p %{buildroot}%{_localstatedir}/lib/git

# install config files
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{S:100}
install -D -p -m 644 %{S:101} %{buildroot}%{_unitdir}/git@.service
install -D -p -m 644 %{S:102} %{buildroot}%{_unitdir}/git.socket

install -pm 755 contrib/credential/libsecret/git-credential-libsecret  %{buildroot}%{gitexecdir}
install -pm 755 contrib/credential/netrc/git-credential-netrc %{buildroot}%{gitexecdir}

rm -f %{buildroot}%{_bindir}/git-cvsserver
rm -f %{buildroot}%{gitexecdir}/git-cvs*

%find_lang %{name}
cat %{name}.lang >> git-bin-files

# split out bin for primary package
(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
grep -E "$not_core_re" bin-man-doc-files > git-bin-files

%find_lang %{name}

%check
%make_build test

%preun daemon
%systemd_preun git.socket

%post daemon
%systemd_post git.socket

%postun daemon
%systemd_postun_with_restart git.socket

%files -f git-bin-files
%{_datadir}/git-core/templates/hooks/fsmonitor-watchman.sample
%{_datadir}/git-core/templates/hooks/pre-rebase.sample
%{_datadir}/git-core/templates/hooks/prepare-commit-msg.sample
%{gitexecdir}/git-archimport
%{gitexecdir}/git-credential-libsecret
%{gitexecdir}/git-p4
%{gitexecdir}/git-subtree
%{gitexecdir}/mergetools/p4merge
%doc README.md
%license LGPL-2.1 COPYING

%files core -f bin-files-core -f %{name}.lang
%license LGPL-2.1 COPYING
# exclude is best way here because of troubles with symlinks inside git-core/
%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
%{_unitdir}/git.socket
%{_unitdir}/git@.service
%{gitexecdir}/git-daemon
%{_localstatedir}/lib/git

%files gui
%{_datadir}/applications/git-gui.desktop
%{gitexecdir}/git-gui*
%{gitexecdir}/git-citool
%{_datadir}/git-gui/

%files -n gitk
%{_bindir}/gitk
%{_datadir}/gitk/

%files web
%{_pkgdocdir}/*.gitweb
%{_localstatedir}/www/git/
%{gitexecdir}/git-instaweb

%files svn
%{gitexecdir}/git-svn

%files email
%{gitexecdir}/*email*

%files -n perl-Git -f perl-git-files
%{_mandir}/man3/Git.*

%files -n perl-Git-SVN -f perl-git-svn-files

%files help
%exclude %{_pkgdocdir}/{README.md,*.gitweb}
%{_pkgdocdir}/*
%{_mandir}/man1/git*.1.*
%{_mandir}/man1/scalar*.1.*
%{_mandir}/man5/git*.5.*
%{_mandir}/man7/git*.7.*

%changelog
* Tue Oct 08 2024 Funda Wang <fundawang@yeah.net> - 2.47.0-1
- update to 2.47.0

* Tue Sep 24 2024 Funda Wang <fundawang@yeah.net> - 2.46.2-1
- update to 2.46.2

* Sun Sep 15 2024 Funda Wang <fundawang@yeah.net> - 2.46.1-1
- update to 2.46.1

* Tue Jul 30 2024 Funda Wang <fundawang@yeah.net> - 2.46.0-1
- update to 2.46.0

* Thu May 16 2024 fuanan <fuanan3@h-partners.com> - 2.44.0-3
- Type:CVE
- ID:CVE-2024-32021 CVE-2024-32004 CVE-2024-32020 CVE-2024-32465
- SUG:NA
- DESC:Fix CVE-2024-32021 CVE-2024-32004 CVE-2024-32020 CVE-2024-32465

* Thu May 16 2024 qiaojijun <qiaojijun@kylinos.cn> - 2.44.0-2
- Type:CVE
- ID:CVE-2024-32002
- SUG:NA
- DESC:Fix CVE-2024-32002

* Mon Feb 26 2024 shafeipaozi <sunbo.oerv@isrc.iscas.ac.cn> - 2.44.0-1
- update version to 2.44

* Fri Dec 15 2023 fuanan <fuanan3@h-partners.com> - 2.43.0-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:update version to 2.43.0

* Fri Jul 14 2023 fuanan <fuanan3@h-partners.com> - 2.41.0-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:update version to 2.41.0

* Mon Jul 3 2023 huyubiao <huyubiao@huawei.com> - 2.39.1-8
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Specifying Obsoletes and Provides version numbers, prevent upgrade conflicts.
       Delete git-core-doc from git, git-core-doc is provided by git-help.

* Wed May 17 2023 fuanan <fuanan3@h-partners.com> - 2.39.1-7
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Fix duplicate files in git primary package and subpackage

* Thu Apr 27 2023 fuanan <fuanan3@h-partners.com> - 2.39.1-6
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:enable multithreading compilation and installation,
       move Git.3pm.gz to perl-Git,avoid installation conflicts,
       change BuildRequires from pcre-devel to pcre2-devel.

* Wed Apr 26 2023 fuanan <fuanan3@h-partners.com> - 2.39.1-5
- Type:CVE
- ID:CVE-2023-25652 CVE-2023-29007 CVE-2023-25815
- SUG:NA
- DESC:Fix CVE-2023-25652 CVE-2023-29007 CVE-2023-25815

* Wed Mar 22 2023 lijian <lijian2@kylinos.cn> - 2.39.1-4
- Delete git-core dir in %files git-bin-files

* Wed Feb 15 2023 fuanan <fuanan3@h-partners.com> - 2.39.1-3
- Type:CVE
- ID:CVE-2023-22490 CVE-2023-23946
- SUG:NA
- DESC:Fix CVE-2023-22490 CVE-2023-23946

* Sat Jan 28 2023 fuanan <fuanan3@h-partners.com> - 2.39.1-2
- Type:CVE
- ID:CVE-2022-41953
- SUG:NA
- DESC:Fix CVE-2022-41953

* Thu Jan 19 2023 fuanan <fuanan3@h-partners.com> - 2.39.1-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:update version to 2.39.1

* Fri Oct 21 2022 fuanan <fuanan3@h-partners.com> - 2.38.1-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:update version to 2.38.1

* Fri Jul 15 2022 yinyongkang <yinyongkang@kylinos.cn> -2.36.1-2
- Type:CVE
- ID:CVE-2022-29187
- SUG:NA
- DESC:Fix CVE-2022-29187

* Fri Jul 01 2022 fuanan <fuanan3@h-partners.com> - 2.36.1-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:update version to 2.36.1

* Fri May 20 2022 fuanan <fuanan3@h-partners.com> - 2.33.0-3
- Type:CVE
- ID:CVE-2022-24765
- SUG:NA
- DESC:Fix CVE-2022-24765

* 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

* Fri Sep 10 2021 fuanan <fuanan3@huawei.com> - 2.30.0-6
- Type:CVE
- ID:CVE-2021-40330
- SUG:NA
- DESC:Fix CVE-2021-40330

* Tue Jul 20 2021 panxiaohe<panxiaohe@huawei.com> - 2.30.0-5
- remove unnecessary BuildRequires: gdb

* Fri May 28 2021 panxiaohe <panxiaohe@huawei.com> - 2.30.0-4
- Fix CVE-2021-29468
- Add gcc and gettext to BuildRequires
  - necessary for building and msgfmt command

* Fri Mar 19 2021 fuanan <fuanan3@huawei.com> - 2.30.0-3
- Optimize compilation time

* Thu Mar 18 2021 lirui <lirui130@huawei.com> - 2.30.0-2
- Type:CVE
- ID:CVE-2021-21300
- SUG:NA
- DESC:Fix CVE-2021-21300

* Wed Jan 27 2021 wangchen <wangchen137@huawei.com> - 2.30.0-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:Update to 2.30.0

* Fri Sep 25 2020 yang_zhuang_zhuang <yangzhuangzhuang1@huawei.com> - 2.27.0-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Resolved the problem that a failure message is displayed when the git-daemon package is uninstalled

* Tue Jul 28 2020 yang_zhuang_zhuang <yangzhuangzhuang1@huawei.com> - 2.27.0-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:update version to 2.27.0

* Thu May 14 2020 gaihuiying <gaihuiying1@huawei.com> - 2.23.0-16
- Type:cves
- ID:CVE-2020-11008
- SUG:NA
- DESC:fix CVE-2020-11008
       credential: detect unrepresentable values when parsin urls
       fsck: detect gitmodules URLs with embedded newlines

* Fri Apr 17 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.23.0-15
- Type:cves
- ID:CVE-2020-5260
- SUG:NA
- DESC:fix CVE-2020-5260

* Wed Apr 15 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.23.0-14
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:reset bash completion

* Tue Apr 14 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.23.0-13
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:setup bash completion

* Thu Mar 19 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.23.0-12
- skip updating the preference during running test suite

* Sat Mar 14 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.23.0-11
- add build requires of gdb

* Mon Feb 24 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.23.0-10
- delete cvs subpackage

* Mon Feb 03 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.23.0-9
- fix CVE-2019-1348 CVE-2019-1349 CVE-2019-1350 CVE-2019-1351 CVE-2019-1352 
  CVE-2019-1353 CVE-2019-1354 CVE-2019-1387 CVE-2019-19604
  fix test error

* Thu Jan 09 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.23.0-8
- Delete unneeded files

* Thu Dec 5 2019 shenyangyang <shenyangyang4@huawei.com> - 2.23.0-7
- Add requires and two files in  %{_libexecdir}/git-core

* Thu Dec 5 2019 shenyangyang <shenyangyang4@huawei.com> - 2.23.0-6
- Delete the perl(Error*) module that provided by perl-Git 

* Thu Oct 31 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.23.0-5
- Modify installation of contrib and templates

* Wed Sep 25 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.23.0-4
- Modify license

* Wed Sep 4 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.23.0-3
- Split out perl-Git-SVN

* Wed Sep 4 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.23.0-2
- Split Package

* Sat Aug 31 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.23.0-1
- Package init