From e9dbaa403a9138f24cf2eab19e66896c967ea58a Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 28 2020 10:05:44 +0000 Subject: import git-2.27.0-1.el8 --- diff --git a/.git.metadata b/.git.metadata index 42df035..e39855e 100644 --- a/.git.metadata +++ b/.git.metadata @@ -1,2 +1,2 @@ -c57084d534cc259c14371a4dbdaf0119933d8f41 SOURCES/git-2.18.1.tar.xz +996c0be58e901deb4ef9d0145e7bf98cdf6a0fb3 SOURCES/git-2.27.0.tar.xz 097b8da13939ac9f51f97a5659184c1d96fb0973 SOURCES/gpgkey-junio.asc diff --git a/.gitignore b/.gitignore index d32ef2a..e3e9c6d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/git-2.18.1.tar.xz +SOURCES/git-2.27.0.tar.xz SOURCES/gpgkey-junio.asc diff --git a/SOURCES/0001-Switch-git-instaweb-default-to-apache-2.26.2.patch b/SOURCES/0001-Switch-git-instaweb-default-to-apache-2.26.2.patch new file mode 100644 index 0000000..a3a40a6 --- /dev/null +++ b/SOURCES/0001-Switch-git-instaweb-default-to-apache-2.26.2.patch @@ -0,0 +1,12 @@ +diff -ur a/git-instaweb.sh b/git-instaweb.sh +--- a/git-instaweb.sh 2020-04-20 17:52:30.000000000 +0200 ++++ b/git-instaweb.sh 2020-05-27 12:36:20.725300334 +0200 +@@ -36,7 +36,7 @@ + # Defaults: + + # if installed, it doesn't need further configuration (module_path) +-test -z "$httpd" && httpd='lighttpd -f' ++test -z "$httpd" && httpd='httpd -f' + + # Default is @@GITWEBDIR@@ + test -z "$root" && root='@@GITWEBDIR@@' diff --git a/SOURCES/0001-Switch-git-instaweb-default-to-apache.patch b/SOURCES/0001-Switch-git-instaweb-default-to-apache.patch deleted file mode 100644 index 6d9d21c..0000000 --- a/SOURCES/0001-Switch-git-instaweb-default-to-apache.patch +++ /dev/null @@ -1,43 +0,0 @@ -From aebe9c096f7150eee901fcc59036a89c54c26a0b Mon Sep 17 00:00:00 2001 -From: Sebastian Kisela -Date: Mon, 16 Jul 2018 08:54:00 +0200 -Subject: [PATCH] Switch instaweb default HTTP daemon to httpd - ---- - git-instaweb.sh | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/git-instaweb.sh b/git-instaweb.sh -index 47e38f3..e089f0d 100755 ---- a/git-instaweb.sh -+++ b/git-instaweb.sh -@@ -36,7 +36,7 @@ conf="$GIT_DIR/gitweb/httpd.conf" - # Defaults: - - # if installed, it doesn't need further configuration (module_path) --test -z "$httpd" && httpd='lighttpd -f' -+test -z "$httpd" && httpd='httpd -f' - - # Default is @@GITWEBDIR@@ - test -z "$root" && root='@@GITWEBDIR@@' -@@ -332,6 +332,8 @@ apache2_conf () { - module_path="/usr/lib/httpd/modules" - test -d "/usr/lib/apache2/modules" && - module_path="/usr/lib/apache2/modules" -+ test -d "/etc/httpd/modules" && -+ module_path="/etc/httpd/modules" - fi - bind= - test x"$local" = xtrue && bind='127.0.0.1:' -@@ -356,7 +358,7 @@ EOF - break - fi - done -- for mod in mime dir env log_config authz_core -+ for mod in mime dir env log_config authz_core unixd - do - if test -e $module_path/mod_${mod}.so - then --- -2.14.4 - diff --git a/SOURCES/0001-add-p-fix-counting-empty-context-lines-in-edited-pat.patch b/SOURCES/0001-add-p-fix-counting-empty-context-lines-in-edited-pat.patch deleted file mode 100644 index 6d36fe5..0000000 --- a/SOURCES/0001-add-p-fix-counting-empty-context-lines-in-edited-pat.patch +++ /dev/null @@ -1,99 +0,0 @@ -From 5be233541a4fc2e395087fe51a30a3664165e8bc Mon Sep 17 00:00:00 2001 -From: Phillip Wood -Date: Fri, 1 Jun 2018 18:46:44 +0100 -Subject: [PATCH] add -p: fix counting empty context lines in edited patches - -recount_edited_hunk() introduced in commit 2b8ea7f3c7 ("add -p: -calculate offset delta for edited patches", 2018-03-05) required all -context lines to start with a space, empty lines are not counted. This -was intended to avoid any recounting problems if the user had -introduced empty lines at the end when editing the patch. However this -introduced a regression into 'git add -p' as it seems it is common for -editors to strip the trailing whitespace from empty context lines when -patches are edited thereby introducing empty lines that should be -counted. 'git apply' knows how to deal with such empty lines and POSIX -states that whether or not there is an space on an empty context line -is implementation defined [1]. - -Fix the regression by counting lines consist solely of a newline as -well as lines starting with a space as context lines and add a test to -prevent future regressions. - -[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html - -Reported-by: Mahmoud Al-Qudsi -Reported-by: Oliver Joseph Ash -Reported-by: Jeff Felchner -Signed-off-by: Phillip Wood ---- - git-add--interactive.perl | 2 +- - t/t3701-add-interactive.sh | 43 ++++++++++++++++++++++++++++++++++++++ - 2 files changed, 44 insertions(+), 1 deletion(-) - -diff --git a/git-add--interactive.perl b/git-add--interactive.perl -index c1f52e457f..befbe8c749 100755 ---- a/git-add--interactive.perl -+++ b/git-add--interactive.perl -@@ -1055,7 +1055,7 @@ sub recount_edited_hunk { - $o_cnt++; - } elsif ($mode eq '+') { - $n_cnt++; -- } elsif ($mode eq ' ') { -+ } elsif ($mode eq ' ' or $_ eq "\n") { - $o_cnt++; - $n_cnt++; - } -diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh -index b170fb02b8..3e9139dca8 100755 ---- a/t/t3701-add-interactive.sh -+++ b/t/t3701-add-interactive.sh -@@ -175,6 +175,49 @@ test_expect_success 'real edit works' ' - diff_cmp expected output - ' - -+test_expect_success 'setup file' ' -+ test_write_lines a "" b "" c >file && -+ git add file && -+ test_write_lines a "" d "" c >file -+' -+ -+test_expect_success 'setup patch' ' -+ SP=" " && -+ NULL="" && -+ cat >patch <<-EOF -+ @@ -1,4 +1,4 @@ -+ a -+ $NULL -+ -b -+ +f -+ $SP -+ c -+ EOF -+' -+ -+test_expect_success 'setup expected' ' -+ cat >expected <<-EOF -+ diff --git a/file b/file -+ index b5dd6c9..f910ae9 100644 -+ --- a/file -+ +++ b/file -+ @@ -1,5 +1,5 @@ -+ a -+ $SP -+ -f -+ +d -+ $SP -+ c -+ EOF -+' -+ -+test_expect_success 'edit can strip spaces from empty context lines' ' -+ test_write_lines e n q | git add -p 2>error && -+ test_must_be_empty error && -+ git diff >output && -+ diff_cmp expected output -+' -+ - test_expect_success 'skip files similarly as commit -a' ' - git reset && - echo file >.gitignore && diff --git a/SOURCES/0001-config-document-value-2-for-protocol.version.patch b/SOURCES/0001-config-document-value-2-for-protocol.version.patch deleted file mode 100644 index cc17108..0000000 --- a/SOURCES/0001-config-document-value-2-for-protocol.version.patch +++ /dev/null @@ -1,32 +0,0 @@ -From db2d36fad8b6b495a5064ea89d3bed1a48841ba9 Mon Sep 17 00:00:00 2001 -From: Brandon Williams -Date: Mon, 10 Sep 2018 14:21:57 -0700 -Subject: [PATCH] config: document value 2 for protocol.version - -Update the config documentation to note the value `2` as an acceptable -value for the protocol.version config. - -Signed-off-by: Brandon Williams -Signed-off-by: Josh Steadmon -Reviewed-by: Jonathan Nieder -Signed-off-by: Junio C Hamano ---- - Documentation/config.txt | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Documentation/config.txt b/Documentation/config.txt -index 64c1dbba94..5105a39e98 100644 ---- a/Documentation/config.txt -+++ b/Documentation/config.txt -@@ -2587,6 +2587,8 @@ protocol.version:: - * `1` - the original wire protocol with the addition of a version string - in the initial response from the server. - -+* `2` - link:technical/protocol-v2.html[wire protocol version 2]. -+ - -- - - pull.ff:: --- -2.14.4 - diff --git a/SOURCES/0001-run-command-mark-path-lookup-errors-with-ENOENT.patch b/SOURCES/0001-run-command-mark-path-lookup-errors-with-ENOENT.patch deleted file mode 100644 index 5206d68..0000000 --- a/SOURCES/0001-run-command-mark-path-lookup-errors-with-ENOENT.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 1e1167f676252c220fbee6038715157c457c7d2f Mon Sep 17 00:00:00 2001 -From: Jeff King -Date: Wed, 24 Oct 2018 03:38:00 -0400 -Subject: [PATCH] run-command: mark path lookup errors with ENOENT - -Since commit e3a434468f (run-command: use the -async-signal-safe execv instead of execvp, 2017-04-19), -prepare_cmd() does its own PATH lookup for any commands we -run (on non-Windows platforms). - -However, its logic does not match the old execvp call when -we fail to find a matching entry in the PATH. Instead of -feeding the name directly to execv, execvp would consider -that an ENOENT error. By continuing and passing the name -directly to execv, we effectively behave as if "." was -included at the end of the PATH. This can have confusing and -even dangerous results. - -The fix itself is pretty straight-forward. There's a new -test in t0061 to cover this explicitly, and I've also added -a duplicate of the ENOENT test to ensure that we return the -correct errno for this case. - -Signed-off-by: Jeff King -Signed-off-by: Junio C Hamano ---- - run-command.c | 21 +++++++++++++++++---- - t/t0061-run-command.sh | 13 ++++++++++++- - 2 files changed, 29 insertions(+), 5 deletions(-) - -diff --git a/run-command.c b/run-command.c -index 84b883c213..d679cc267c 100644 ---- a/run-command.c -+++ b/run-command.c -@@ -380,7 +380,7 @@ static void child_err_spew(struct child_process *cmd, struct child_err *cerr) - set_error_routine(old_errfn); - } - --static void prepare_cmd(struct argv_array *out, const struct child_process *cmd) -+static int prepare_cmd(struct argv_array *out, const struct child_process *cmd) - { - if (!cmd->argv[0]) - BUG("command is empty"); -@@ -403,16 +403,22 @@ static void prepare_cmd(struct argv_array *out, const struct child_process *cmd) - /* - * If there are no '/' characters in the command then perform a path - * lookup and use the resolved path as the command to exec. If there -- * are no '/' characters or if the command wasn't found in the path, -- * have exec attempt to invoke the command directly. -+ * are '/' characters, we have exec attempt to invoke the command -+ * directly. - */ - if (!strchr(out->argv[1], '/')) { - char *program = locate_in_PATH(out->argv[1]); - if (program) { - free((char *)out->argv[1]); - out->argv[1] = program; -+ } else { -+ argv_array_clear(out); -+ errno = ENOENT; -+ return -1; - } - } -+ -+ return 0; - } - - static char **prep_childenv(const char *const *deltaenv) -@@ -719,6 +725,12 @@ int start_command(struct child_process *cmd) - struct child_err cerr; - struct atfork_state as; - -+ if (prepare_cmd(&argv, cmd) < 0) { -+ failed_errno = errno; -+ cmd->pid = -1; -+ goto end_of_spawn; -+ } -+ - if (pipe(notify_pipe)) - notify_pipe[0] = notify_pipe[1] = -1; - -@@ -729,7 +741,6 @@ int start_command(struct child_process *cmd) - set_cloexec(null_fd); - } - -- prepare_cmd(&argv, cmd); - childenv = prep_childenv(cmd->env); - atfork_prepare(&as); - -@@ -857,6 +868,8 @@ int start_command(struct child_process *cmd) - argv_array_clear(&argv); - free(childenv); - } -+end_of_spawn: -+ - #else - { - int fhin = 0, fhout = 1, fherr = 2; -diff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh -index c887ed5b45..b9cfc03a53 100755 ---- a/t/t0061-run-command.sh -+++ b/t/t0061-run-command.sh -@@ -13,10 +13,14 @@ cat >hello-script <<-EOF - EOF - >empty - --test_expect_success 'start_command reports ENOENT' ' -+test_expect_success 'start_command reports ENOENT (slash)' ' - test-tool run-command start-command-ENOENT ./does-not-exist - ' - -+test_expect_success 'start_command reports ENOENT (no slash)' ' -+ test-tool run-command start-command-ENOENT does-not-exist -+' -+ - test_expect_success 'run_command can run a command' ' - cat hello-script >hello.sh && - chmod +x hello.sh && -@@ -26,6 +30,13 @@ test_expect_success 'run_command can run a command' ' - test_cmp empty err - ' - -+test_expect_success 'run_command is restricted to PATH' ' -+ write_script should-not-run <<-\EOF && -+ echo yikes -+ EOF -+ test_must_fail test-tool run-command run-command should-not-run -+' -+ - test_expect_success !MINGW 'run_command can run a script without a #! line' ' - cat >hello <<-\EOF && - cat hello-script --- -2.14.4 - diff --git a/SOURCES/0001-t5551-http-fetch-smart.sh-sort-cookies-before-compar.patch b/SOURCES/0001-t5551-http-fetch-smart.sh-sort-cookies-before-compar.patch deleted file mode 100644 index 7cc468b..0000000 --- a/SOURCES/0001-t5551-http-fetch-smart.sh-sort-cookies-before-compar.patch +++ /dev/null @@ -1,34 +0,0 @@ -From f5b2c9c98eedc2af38efea91e2702fe8a7e70a6a Mon Sep 17 00:00:00 2001 -From: Todd Zullinger -Date: Fri, 7 Sep 2018 19:22:05 -0400 -Subject: [PATCH] t5551-http-fetch-smart.sh: sort cookies before comparing -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -With curl-7.61.1 cookies are sorted by creation-time¹. Sort the output -used in the 'cookies stored in http.cookiefile when http.savecookies -set' test before comparing it to the expected cookies. - -¹ https://github.com/curl/curl/commit/e2ef8d6fa ("cookies: support - creation-time attribute for cookies", 2018-08-28) - -Signed-off-by: Todd Zullinger -Signed-off-by: Junio C Hamano ---- - t/t5551-http-fetch-smart.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh -index 771f36f9ff473..538656bfef09b 100755 ---- a/t/t5551-http-fetch-smart.sh -+++ b/t/t5551-http-fetch-smart.sh -@@ -215,7 +215,7 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set - git config http.cookiefile cookies.txt && - git config http.savecookies true && - git ls-remote $HTTPD_URL/smart_cookies/repo.git master && -- tail -3 cookies.txt >cookies_tail.txt && -+ tail -3 cookies.txt | sort >cookies_tail.txt && - test_cmp expect_cookies.txt cookies_tail.txt - ' - diff --git a/SOURCES/git-1.8-gitweb-home-link.patch b/SOURCES/git-1.8-gitweb-home-link.patch deleted file mode 100644 index aeb29e0..0000000 --- a/SOURCES/git-1.8-gitweb-home-link.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up git-1.8.4.2/gitweb/gitweb.perl.orig git-1.8.4.2/gitweb/gitweb.perl ---- git-1.8.4.2/gitweb/gitweb.perl.orig 2013-10-28 14:17:38.000000000 -0400 -+++ git-1.8.4.2/gitweb/gitweb.perl 2013-10-29 16:49:07.302747507 -0400 -@@ -83,7 +83,7 @@ our $projectroot = "++GITWEB_PROJECTROOT - our $project_maxdepth = "++GITWEB_PROJECT_MAXDEPTH++"; - - # string of the home link on top of all pages --our $home_link_str = "++GITWEB_HOME_LINK_STR++"; -+our $home_link_str = $ENV{'SERVER_NAME'} ? "git://" . $ENV{'SERVER_NAME'} : "projects"; - - # extra breadcrumbs preceding the home link - our @extra_breadcrumbs = (); diff --git a/SOURCES/git-2.18.1-core-crypto-hmac.patch b/SOURCES/git-2.18.1-core-crypto-hmac.patch deleted file mode 100644 index a1c8d7f..0000000 --- a/SOURCES/git-2.18.1-core-crypto-hmac.patch +++ /dev/null @@ -1,70 +0,0 @@ -diff -ru git-2.18.1/builtin/receive-pack.c git-2.18.1_patched/builtin/receive-pack.c ---- git-2.18.1/builtin/receive-pack.c 2018-09-27 22:44:44.000000000 +0200 -+++ git-2.18.1_patched/builtin/receive-pack.c 2019-06-11 11:19:52.887797134 +0200 -@@ -26,6 +26,8 @@ - #include "oidset.h" - #include "packfile.h" - #include "protocol.h" -+#include -+#include - - static const char * const receive_pack_usage[] = { - N_("git receive-pack "), -@@ -419,43 +421,11 @@ - - #define HMAC_BLOCK_SIZE 64 - --static void hmac_sha1(unsigned char *out, -+static inline void hmac_sha1(unsigned char *out, - const char *key_in, size_t key_len, - const char *text, size_t text_len) - { -- unsigned char key[HMAC_BLOCK_SIZE]; -- unsigned char k_ipad[HMAC_BLOCK_SIZE]; -- unsigned char k_opad[HMAC_BLOCK_SIZE]; -- int i; -- git_SHA_CTX ctx; -- -- /* RFC 2104 2. (1) */ -- memset(key, '\0', HMAC_BLOCK_SIZE); -- if (HMAC_BLOCK_SIZE < key_len) { -- git_SHA1_Init(&ctx); -- git_SHA1_Update(&ctx, key_in, key_len); -- git_SHA1_Final(key, &ctx); -- } else { -- memcpy(key, key_in, key_len); -- } -- -- /* RFC 2104 2. (2) & (5) */ -- for (i = 0; i < sizeof(key); i++) { -- k_ipad[i] = key[i] ^ 0x36; -- k_opad[i] = key[i] ^ 0x5c; -- } -- -- /* RFC 2104 2. (3) & (4) */ -- git_SHA1_Init(&ctx); -- git_SHA1_Update(&ctx, k_ipad, sizeof(k_ipad)); -- git_SHA1_Update(&ctx, text, text_len); -- git_SHA1_Final(out, &ctx); -- -- /* RFC 2104 2. (6) & (7) */ -- git_SHA1_Init(&ctx); -- git_SHA1_Update(&ctx, k_opad, sizeof(k_opad)); -- git_SHA1_Update(&ctx, out, GIT_SHA1_RAWSZ); -- git_SHA1_Final(out, &ctx); -+ HMAC(EVP_sha1(), key_in, key_len, text, text_len, out, NULL); - } - - static char *prepare_push_cert_nonce(const char *path, timestamp_t stamp) -diff -ru git-2.18.1/Makefile git-2.18.1_patched/Makefile ---- git-2.18.1/Makefile 2018-09-27 22:44:44.000000000 +0200 -+++ git-2.18.1_patched/Makefile 2019-06-10 17:28:26.137986964 +0200 -@@ -1721,6 +1721,8 @@ - BASIC_CFLAGS += -DHAVE_GETDELIM - endif - -+EXTLIBS += -lcrypto -+ - ifneq ($(PROCFS_EXECUTABLE_PATH),) - procfs_executable_path_SQ = $(subst ','\'',$(PROCFS_EXECUTABLE_PATH)) - BASIC_CFLAGS += '-DPROCFS_EXECUTABLE_PATH="$(procfs_executable_path_SQ)"' diff --git a/SOURCES/git-2.18.1.tar.sign b/SOURCES/git-2.18.1.tar.sign deleted file mode 100644 index d2d8e10..0000000 Binary files a/SOURCES/git-2.18.1.tar.sign and /dev/null differ diff --git a/SOURCES/git-2.27.0-core-crypto-hmac.patch b/SOURCES/git-2.27.0-core-crypto-hmac.patch new file mode 100644 index 0000000..c99ced2 --- /dev/null +++ b/SOURCES/git-2.27.0-core-crypto-hmac.patch @@ -0,0 +1,70 @@ +diff -ur a/builtin/receive-pack.c b/builtin/receive-pack.c +--- a/builtin/receive-pack.c 2020-06-01 17:49:27.000000000 +0200 ++++ b/builtin/receive-pack.c 2020-06-15 15:28:48.149268576 +0200 +@@ -29,6 +29,8 @@ + #include "commit-reach.h" + #include "worktree.h" + #include "shallow.h" ++#include ++#include + + static const char * const receive_pack_usage[] = { + N_("git receive-pack "), +@@ -419,43 +421,11 @@ + return 0; + } + +-static void hmac_hash(unsigned char *out, ++static inline void hmac_hash(unsigned char *out, + const char *key_in, size_t key_len, + const char *text, size_t text_len) + { +- unsigned char key[GIT_MAX_BLKSZ]; +- unsigned char k_ipad[GIT_MAX_BLKSZ]; +- unsigned char k_opad[GIT_MAX_BLKSZ]; +- int i; +- git_hash_ctx ctx; +- +- /* RFC 2104 2. (1) */ +- memset(key, '\0', GIT_MAX_BLKSZ); +- if (the_hash_algo->blksz < key_len) { +- the_hash_algo->init_fn(&ctx); +- the_hash_algo->update_fn(&ctx, key_in, key_len); +- the_hash_algo->final_fn(key, &ctx); +- } else { +- memcpy(key, key_in, key_len); +- } +- +- /* RFC 2104 2. (2) & (5) */ +- for (i = 0; i < sizeof(key); i++) { +- k_ipad[i] = key[i] ^ 0x36; +- k_opad[i] = key[i] ^ 0x5c; +- } +- +- /* RFC 2104 2. (3) & (4) */ +- the_hash_algo->init_fn(&ctx); +- the_hash_algo->update_fn(&ctx, k_ipad, sizeof(k_ipad)); +- the_hash_algo->update_fn(&ctx, text, text_len); +- the_hash_algo->final_fn(out, &ctx); +- +- /* RFC 2104 2. (6) & (7) */ +- the_hash_algo->init_fn(&ctx); +- the_hash_algo->update_fn(&ctx, k_opad, sizeof(k_opad)); +- the_hash_algo->update_fn(&ctx, out, the_hash_algo->rawsz); +- the_hash_algo->final_fn(out, &ctx); ++ HMAC(EVP_sha1(), key_in, key_len, text, text_len, out, NULL); + } + + static char *prepare_push_cert_nonce(const char *path, timestamp_t stamp) +diff -ur a/Makefile b/Makefile +--- a/Makefile 2020-06-01 17:49:27.000000000 +0200 ++++ b/Makefile 2020-06-15 15:00:45.212758547 +0200 +@@ -1830,6 +1830,8 @@ + BASIC_CFLAGS += -DHAVE_GETDELIM + endif + ++EXTLIBS += -lcrypto ++ + ifneq ($(PROCFS_EXECUTABLE_PATH),) + procfs_executable_path_SQ = $(subst ','\'',$(PROCFS_EXECUTABLE_PATH)) + BASIC_CFLAGS += '-DPROCFS_EXECUTABLE_PATH="$(procfs_executable_path_SQ)"' diff --git a/SOURCES/git-2.27.0.tar.sign b/SOURCES/git-2.27.0.tar.sign new file mode 100644 index 0000000..760ea5d Binary files /dev/null and b/SOURCES/git-2.27.0.tar.sign differ diff --git a/SPECS/git.spec b/SPECS/git.spec index 00698f8..1526603 100644 --- a/SPECS/git.spec +++ b/SPECS/git.spec @@ -1,20 +1,8 @@ -%{?scl:%scl_package git} -%{!?scl:%global pkg_name %{name}} # Pass --without docs to rpmbuild if you don't want the documentation %bcond_without docs -%if 0%{?scl:1} -%global httpdconfdir /opt/rh/httpd24/root/etc/httpd/conf.d -%global appdesktopdir %{_root_datadir}/applications -# Build and link files with httpd24-libcurl -# See rhscl commit f70137d3d3 -%global cpath_dir /opt/rh/%{scl_httpd}/root%{_root_includedir} -%global libcurl_devel %{?scl_prefix_httpd}libcurl-devel -%else -%global appdesktopdir %{_datadir}/applications -%global httpdconfdir %{_sysconfdir}/httpd/conf.d -%global libcurl_devel libcurl-devel -%endif +# Pass --without tests to rpmbuild if you don't want to run the tests +%bcond_without tests %global gitexecdir %{_libexecdir}/git-core @@ -26,46 +14,45 @@ %bcond_with linkcheck %endif -# Settings for Fedora > 29 and EL > 7 -%if 0%{?fedora} > 29 || 0%{?rhel} > 7 -%bcond_with python2 -%else -%bcond_without python2 -%endif - -# Settings for Fedora >= 29 and EL > 7 -%if 0%{?fedora} >= 29 || 0%{?rhel} > 7 -%global gitweb_httpd_conf gitweb.conf +# Settings for Fedora and EL >= 9 +%if 0%{?fedora} || 0%{?rhel} >= 9 +%bcond_without asciidoctor %else -%global gitweb_httpd_conf git.conf +%bcond_with asciidoctor %endif # Settings for Fedora and EL > 7 %if 0%{?fedora} || 0%{?rhel} > 7 +%bcond_with python2 %bcond_without python3 +%global gitweb_httpd_conf gitweb.conf +%global use_glibc_langpacks 1 %global use_perl_generators 1 %global use_perl_interpreter 1 %else +%bcond_without python2 %bcond_with python3 +%global gitweb_httpd_conf git.conf +%global use_glibc_langpacks 0 %global use_perl_generators 0 %global use_perl_interpreter 0 %endif # Settings for Fedora and EL >= 7 %if 0%{?fedora} || 0%{?rhel} >= 7 +%bcond_without libsecret %global bashcomp_pkgconfig 1 -%global bashcompdir %{?scl:%_scl_root}%(pkg-config --variable=completionsdir bash-completion 2>/dev/null) +%global bashcompdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null) %global bashcomproot %(dirname %{bashcompdir} 2>/dev/null) %global emacs_filesystem 1 -%global libsecret 1 %global use_new_rpm_filters 1 %global use_systemd 1 %else +%bcond_with libsecret %global bashcomp_pkgconfig 0 %global bashcompdir %{_sysconfdir}/bash_completion.d %global bashcomproot %{bashcompdir} %global emacs_filesystem 0 -%global libsecret 0 %global use_new_rpm_filters 0 %global use_systemd 0 %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} @@ -81,7 +68,7 @@ # Allow p4 subpackage to be toggled via --with/--without # Disable by default if we lack python2 support -%if ! %{with python2} +%if %{without python2} %bcond_with p4 %else %bcond_without p4 @@ -94,21 +81,21 @@ # Hardening flags for EL-6 %if 0%{?rhel} == 6 -%global optflags %{optflags} -fPIC -pie -%global __global_ldflags -Wl,-z,relro -Wl,-z,now +%global build_cflags %{build_cflags} -fPIC -pie +%global build_ldflags -Wl,-z,relro -Wl,-z,now %endif # Define for release candidates #global rcrev .rc0 -Name: %{?scl_prefix}git -Version: 2.18.1 -Release: 4%{?rcrev}%{?dist} +Name: git +Version: 2.27.0 +Release: 1%{?rcrev}%{?dist} Summary: Fast Version Control System License: GPLv2 URL: https://git-scm.com/ -Source0: https://www.kernel.org/pub/software/scm/git/%{?rcrev:testing/}%{pkg_name}-%{version}%{?rcrev}.tar.xz -Source1: https://www.kernel.org/pub/software/scm/git/%{?rcrev:testing/}%{pkg_name}-%{version}%{?rcrev}.tar.sign +Source0: https://www.kernel.org/pub/software/scm/git/%{?rcrev:testing/}%{name}-%{version}%{?rcrev}.tar.xz +Source1: https://www.kernel.org/pub/software/scm/git/%{?rcrev:testing/}%{name}-%{version}%{?rcrev}.tar.sign # Junio C Hamano's key is used to sign git releases, it can be found in the # junio-gpg-pub tag within git. @@ -132,33 +119,31 @@ Source16: git.socket # Script to print test failure output (used in %%check) Source99: print-failed-test-output -Patch0: git-1.8-gitweb-home-link.patch # https://bugzilla.redhat.com/490602 -Patch1: git-cvsimport-Ignore-cvsps-2.2b1-Branches-output.patch -# https://github.com/gitster/git/commit/f2cb01d35 -# https://public-inbox.org/git/20180601174644.13055-1-phillip.wood@talktalk.net/ -Patch2: 0001-add-p-fix-counting-empty-context-lines-in-edited-pat.patch -Patch3: 0001-Switch-git-instaweb-default-to-apache.patch -# curl-7.61.1 changes cookie sort order -# https://public-inbox.org/git/20180907232205.31328-1-tmz@pobox.com/ -# https://github.com/git/git/commit/f5b2c9c98e.patch -Patch4: 0001-t5551-http-fetch-smart.sh-sort-cookies-before-compar.patch -Patch5: 0001-config-document-value-2-for-protocol.version.patch -# CVE-2018-19486 -# https://bugzilla.redhat.com/1653143 -# https://github.com/git/git/commit/321fd82389.patch -Patch7: 0001-run-command-mark-path-lookup-errors-with-ENOENT.patch +Patch0: git-cvsimport-Ignore-cvsps-2.2b1-Branches-output.patch +Patch1: 0001-Switch-git-instaweb-default-to-apache-2.26.2.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1619113 -Patch8: git-2.18.1-core-crypto-hmac.patch +Patch2: git-2.27.0-core-crypto-hmac.patch %if %{with docs} +# pod2man is needed to build Git.3pm +BuildRequires: %{_bindir}/pod2man +%if %{with asciidoctor} +BuildRequires: docbook5-style-xsl +BuildRequires: rubygem-asciidoctor +%else BuildRequires: asciidoc >= 8.4.1 +%endif +# endif with asciidoctor BuildRequires: xmlto %if %{with linkcheck} BuildRequires: linkchecker %endif +# endif with linkcheck %endif +# endif with docs BuildRequires: desktop-file-utils +BuildRequires: diffutils BuildRequires: emacs BuildRequires: expat-devel BuildRequires: findutils @@ -166,93 +151,138 @@ BuildRequires: gawk BuildRequires: gcc BuildRequires: gettext BuildRequires: gnupg2 -BuildRequires: %{libcurl_devel} -%if %{libsecret} -BuildRequires: libsecret-devel -%endif +BuildRequires: libcurl-devel BuildRequires: make BuildRequires: openssl-devel BuildRequires: pcre2-devel BuildRequires: perl(Error) +BuildRequires: perl(lib) BuildRequires: perl(Test) %if %{use_perl_generators} BuildRequires: perl-generators %endif +# endif use_perl_generators %if %{use_perl_interpreter} BuildRequires: perl-interpreter %else BuildRequires: perl %endif +# endif use_perl_interpreter %if %{bashcomp_pkgconfig} BuildRequires: pkgconfig(bash-completion) %endif +# endif bashcomp_pkgconfig BuildRequires: sed %if %{use_systemd} # For macros BuildRequires: systemd %endif -%{?scl:Requires:%scl_runtime} +# endif use_systemd BuildRequires: tcl BuildRequires: tk BuildRequires: zlib-devel >= 1.2 +%if %{with tests} # Test suite requirements BuildRequires: acl %if 0%{?fedora} >= 27 || 0%{?rhel} > 7 -# see bz1491151 # Needed by t5540-http-push-webdav.sh BuildRequires: apr-util-bdb %endif +# endif fedora >= 27 BuildRequires: bash %if %{with cvs} BuildRequires: cvs BuildRequires: cvsps %endif +# endif with cvs +%if %{use_glibc_langpacks} +# glibc-all-langpacks and glibc-langpack-is are needed for GETTEXT_LOCALE and +# GETTEXT_ISO_LOCALE test prereq's, glibc-langpack-en ensures en_US.UTF-8. +BuildRequires: glibc-all-langpacks +BuildRequires: glibc-langpack-en +BuildRequires: glibc-langpack-is +%endif +# endif use_glibc_langpacks +%if 0%{?fedora} && 0%{?fedora} < 30 BuildRequires: gnupg -%if 0%{?fedora} || ( 0%{?rhel} && ( 0%{?rhel} == 6 || 0%{?rhel} >= 7 && %{_arch} != ppc64 )) +%endif +# endif fedora < 30 +%if 0%{?fedora} || 0%{?rhel} > 8 +BuildRequires: gnupg2-smime +%endif +# endif fedora or el > 8 +%if 0%{?fedora} || 0%{?rhel} == 6 || ( 0%{?rhel} >= 7 && ( "%{_arch}" == "ppc64le" || "%{_arch}" == "x86_64" ) ) BuildRequires: highlight %endif +# endif fedora, el-6, or el7+ (ppc64le/x86_64) BuildRequires: httpd -%if 0%{?fedora} && %{_arch} != s390x +%if 0%{?fedora} && ! ( "%{_arch}" == "i386" || "%{_arch}" == "s390x" ) BuildRequires: jgit %endif +# endif fedora (except i386 and s390x) BuildRequires: mod_dav_svn -BuildRequires: pcre BuildRequires: perl(App::Prove) BuildRequires: perl(CGI) BuildRequires: perl(CGI::Carp) BuildRequires: perl(CGI::Util) BuildRequires: perl(DBD::SQLite) BuildRequires: perl(Digest::MD5) +BuildRequires: perl(Fcntl) +BuildRequires: perl(File::Basename) +BuildRequires: perl(File::Copy) +BuildRequires: perl(File::Find) +BuildRequires: perl(filetest) BuildRequires: perl(HTTP::Date) BuildRequires: perl(IO::Pty) +BuildRequires: perl(JSON) +BuildRequires: perl(JSON::PP) BuildRequires: perl(Mail::Address) BuildRequires: perl(Memoize) +BuildRequires: perl(POSIX) +BuildRequires: perl(Term::ReadLine) BuildRequires: perl(Test::More) BuildRequires: perl(Time::HiRes) %if %{with python2} BuildRequires: python2-devel %endif +# endif with python2 %if %{with python3} BuildRequires: python3-devel %endif +# endif with python3 BuildRequires: subversion BuildRequires: subversion-perl +BuildRequires: tar BuildRequires: time +BuildRequires: zip +%endif +# endif with tests -Requires: %{?scl_prefix}git-core = %{version}-%{release} -Requires: %{?scl_prefix}git-core-doc = %{version}-%{release} +Requires: git-core = %{version}-%{release} +Requires: git-core-doc = %{version}-%{release} %if ! %{defined perl_bootstrap} Requires: perl(Term::ReadKey) %endif -Requires: %{?scl_prefix}perl-Git = %{version}-%{release} +# endif ! defined perl_bootstrap +Requires: perl-Git = %{version}-%{release} -%if %{emacs_filesystem} +%if %{emacs_filesystem} && %{defined _emacs_version} Requires: emacs-filesystem >= %{_emacs_version} %endif +# endif emacs_filesystem -# Obsolete gnome-keyring credential helper (remove in Fedora 29) -Obsoletes: %{?scl_prefix}git-gnome-keyring < 2.11.1-4 +# Obsolete git-cvs if it's disabled +%if %{without cvs} +Obsoletes: git-cvs < %{?epoch:%{epoch}:}%{version}-%{release} +%endif +# endif without cvs + +# Obsolete git-p4 if it's disabled +%if %{without p4} +Obsoletes: git-p4 < %{?epoch:%{epoch}:}%{version}-%{release} +%endif +# endif without p4 %description Git is a fast, scalable, distributed revision control system with an @@ -266,27 +296,34 @@ tools for integrating with other SCMs, install the git-all meta-package. %package all Summary: Meta-package to pull in all git tools BuildArch: noarch -%{?scl:Requires:%scl_runtime} -Requires: %{?scl_prefix}git = %{version}-%{release} +Requires: git = %{version}-%{release} +%if %{with libsecret} +Requires: git-credential-libsecret = %{version}-%{release} +%endif +# endif with libsecret %if %{with cvs} -Requires: %{?scl_prefix}git-cvs = %{version}-%{release} +Requires: git-cvs = %{version}-%{release} %endif -Requires: %{?scl_prefix}git-email = %{version}-%{release} -Requires: %{?scl_prefix}git-gui = %{version}-%{release} +# endif with cvs +Requires: git-email = %{version}-%{release} +Requires: git-gui = %{version}-%{release} %if %{with p4} -Requires: %{?scl_prefix}git-p4 = %{version}-%{release} +Requires: git-p4 = %{version}-%{release} %endif -Requires: %{?scl_prefix}git-subtree = %{version}-%{release} -Requires: %{?scl_prefix}git-svn = %{version}-%{release} -Requires: %{?scl_prefix}git-instaweb = %{version}-%{release} -Requires: %{?scl_prefix}gitk = %{version}-%{release} -Requires: %{?scl_prefix}perl-Git = %{version}-%{release} +# endif with p4 +Requires: git-subtree = %{version}-%{release} +Requires: git-svn = %{version}-%{release} +Requires: git-instaweb = %{version}-%{release} +Requires: gitk = %{version}-%{release} +Requires: perl-Git = %{version}-%{release} %if ! %{defined perl_bootstrap} Requires: perl(Term::ReadKey) %endif +# endif ! defined perl_bootstrap %if ! %{emacs_filesystem} -Requires: %{?scl_prefix}emacs-git = %{version}-%{release} +Requires: emacs-git = %{version}-%{release} %endif +# endif ! emacs_filesystem %description all Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations @@ -296,7 +333,6 @@ This is a dummy package which brings in all subpackages. %package core Summary: Core package of git with minimal functionality -%{?scl:Requires:%scl_runtime} Requires: less Requires: openssh-clients Requires: zlib >= 1.2 @@ -313,28 +349,36 @@ other SCMs, install the git-all meta-package. %package core-doc Summary: Documentation files for git-core BuildArch: noarch -%{?scl:Requires:%scl_runtime} -Requires: %{?scl_prefix}git-core = %{version}-%{release} +Requires: git-core = %{version}-%{release} %description core-doc Documentation files for git-core package including man pages. +%if %{with libsecret} +%package credential-libsecret +Summary: Git helper for accessing credentials via libsecret +BuildRequires: libsecret-devel +Requires: git = %{version}-%{release} +%description credential-libsecret +%{summary}. +%endif +# endif with libsecret + %if %{with cvs} %package cvs Summary: Git tools for importing CVS repositories BuildArch: noarch -%{?scl:Requires:%scl_runtime} -Requires: %{?scl_prefix}git = %{version}-%{release} +Requires: git = %{version}-%{release} Requires: cvs Requires: cvsps Requires: perl(DBD::SQLite) %description cvs %{summary}. %endif +# endif with cvs %package daemon Summary: Git protocol daemon -%{?scl:Requires:%scl_runtime} -Requires: %{?scl_prefix}git-core = %{version}-%{release} +Requires: git-core = %{version}-%{release} %if %{use_systemd} Requires: systemd Requires(post): systemd @@ -343,14 +387,14 @@ Requires(postun): systemd %else Requires: xinetd %endif +# endif use_systemd %description daemon The git daemon for supporting git:// access to git repositories %package email Summary: Git tools for sending patches via email BuildArch: noarch -%{?scl:Requires:%scl_runtime} -Requires: %{?scl_prefix}git = %{version}-%{release} +Requires: git = %{version}-%{release} Requires: perl(Authen::SASL) Requires: perl(Net::SMTP::SSL) %description email @@ -359,8 +403,7 @@ Requires: perl(Net::SMTP::SSL) %if ! %{emacs_filesystem} %package -n emacs-git Summary: Git version control system support for Emacs -%{?scl:Requires:%scl_runtime} -Requires: %{?scl_prefix}git = %{version}-%{release} +Requires: git = %{version}-%{release} BuildArch: noarch Requires: emacs(bin) >= %{_emacs_version} Obsoletes: emacs-git-el < 2.18.0-0.0 @@ -368,65 +411,73 @@ Provides: emacs-git-el = %{version}-%{release} %description -n emacs-git %{summary}. %endif +# endif ! emacs_filesystem -%package -n %{?scl_prefix}gitk +%package -n gitk Summary: Git repository browser BuildArch: noarch -%{?scl:Requires:%scl_runtime} -Requires: %{?scl_prefix}git = %{version}-%{release} +Requires: git = %{version}-%{release} +Requires: git-gui = %{version}-%{release} Requires: tk >= 8.4 -%description -n %{?scl_prefix}gitk +%description -n gitk %{summary}. -%package -n %{?scl_prefix}gitweb +%package -n gitweb Summary: Simple web interface to git repositories BuildArch: noarch -%{?scl:Requires:%scl_runtime} -Requires: %{?scl_prefix}git = %{version}-%{release} -%description -n %{?scl_prefix}gitweb +Requires: git = %{version}-%{release} +%description -n gitweb %{summary}. %package gui Summary: Graphical interface to Git BuildArch: noarch -%{?scl:Requires:%scl_runtime} -Requires: %{?scl_prefix}gitk = %{version}-%{release} +Requires: gitk = %{version}-%{release} Requires: tk >= 8.4 %description gui %{summary}. +%package instaweb +Summary: Repository browser in gitweb +BuildArch: noarch +Requires: git = %{version}-%{release} +Requires: gitweb = %{version}-%{release} +Requires: httpd + +%description instaweb +A simple script to set up gitweb and a web server for browsing the local +repository. + %if %{with p4} %package p4 Summary: Git tools for working with Perforce depots BuildArch: noarch -%{?scl:Requires:%scl_runtime} BuildRequires: python2-devel -Requires: %{?scl_prefix}git = %{version}-%{release} +Requires: git = %{version}-%{release} %description p4 %{summary}. %endif +# endif with p4 -%package -n %{?scl_prefix}perl-Git +%package -n perl-Git Summary: Perl interface to Git BuildArch: noarch -Requires: %{?scl_prefix}git = %{version}-%{release} +Requires: git = %{version}-%{release} Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) -%description -n %{?scl_prefix}perl-Git +%description -n perl-Git %{summary}. -%package -n %{?scl_prefix}perl-Git-SVN +%package -n perl-Git-SVN Summary: Perl interface to Git::SVN BuildArch: noarch -%{?scl:Requires:%scl_runtime} -Requires: %{?scl_prefix}git = %{version}-%{release} +Requires: git = %{version}-%{release} Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) -%description -n %{?scl_prefix}perl-Git-SVN +%description -n perl-Git-SVN %{summary}. %package subtree Summary: Git tools to merge and split repositories -%{?scl:Requires:%scl_runtime} -Requires: %{?scl_prefix}git-core = %{version}-%{release} +Requires: git-core = %{version}-%{release} %description subtree Git subtrees allow subprojects to be included within a subdirectory of the main project, optionally including the subproject's entire @@ -434,43 +485,30 @@ history. %package svn Summary: Git tools for interacting with Subversion repositories -%{?scl:Requires:%scl_runtime} -Requires: %{?scl_prefix}git = %{version}-%{release} +BuildArch: noarch +Requires: git = %{version}-%{release} Requires: perl(Digest::MD5) %if ! %{defined perl_bootstrap} Requires: perl(Term::ReadKey) %endif +# endif ! defined perl_bootstrap Requires: subversion %description svn %{summary}. -%package instaweb -Summary: Repository browser in gitweb -Group: Development/Tools -Requires: %{?scl_prefix}git = %{version}-%{release} -Requires: %{?scl_prefix}gitweb = %{version}-%{release} -Requires: httpd - -%description instaweb -A simple script to set up gitweb and a web server for browsing the local repository. - %prep # Verify GPG signatures gpghome="$(mktemp -qd)" # Ensure we don't use any existing gpg keyrings -key="%{SOURCE9}" -src="%{SOURCE0}" -# Ignore noisy output from GnuPG 2.0, used on EL <= 7 -# https://bugs.gnupg.org/gnupg/issue1555 -gpg2 --dearmor --quiet --batch --yes $key >/dev/null -# Upstream signs the uncompressed tarballs -tar=${src/%.xz/} -xz -dc $src > $tar -gpgv2 --homedir "$gpghome" --quiet --keyring $key.gpg $tar.sign $tar -rm -rf "$tar" "$gpghome" # Cleanup tar files and tmp gpg home dir +# Convert the ascii-armored key to binary +# (use --yes to ensure an existing dearmored key is overwritten) +gpg2 --homedir "$gpghome" --dearmor --quiet --yes %{SOURCE9} +xz -dc %{SOURCE0} | # Upstream signs the uncompressed tarballs + gpgv2 --homedir "$gpghome" --quiet --keyring %{SOURCE9}.gpg %{SOURCE1} - +rm -rf "$gpghome" # Cleanup tmp gpg home dir # Ensure a blank line follows autosetup, el6 chokes otherwise # https://bugzilla.redhat.com/1310704 -%autosetup -p1 -n %{pkg_name}-%{version}%{?rcrev} +%autosetup -p1 -n %{name}-%{version}%{?rcrev} # Install print-failed-test-output script install -p -m 755 %{SOURCE99} print-failed-test-output @@ -478,23 +516,25 @@ install -p -m 755 %{SOURCE99} print-failed-test-output # Remove git-archimport from command list sed -i '/^git-archimport/d' command-list.txt -%if ! %{with cvs} +%if %{without cvs} # Remove git-cvs* from command list sed -i '/^git-cvs/d' command-list.txt %endif +# endif without cvs -%if ! %{with p4} +%if %{without p4} # Remove git-p4 from command list sed -i '/^git-p4/d' command-list.txt %endif +# endif without p4 # Use these same options for every invocation of 'make'. # Otherwise it will rebuild in %%install due to flags changes. -cat << \EOF > config.mak +# Pipe to tee to aid confirmation/verification of settings. +cat << \EOF | tee config.mak V = 1 -CFLAGS = %{optflags} -LDFLAGS = %{__global_ldflags} -LIBS = ${LIBS} +CFLAGS = %{build_cflags} +LDFLAGS = %{build_ldflags} NEEDS_CRYPTO_WITH_SSL = 1 USE_LIBPCRE = 1 ETC_GITCONFIG = %{_sysconfdir}/gitconfig @@ -507,16 +547,20 @@ PYTHON_PATH = %{__python2} %else NO_PYTHON = 1 %endif +# endif with python2 +%if %{with asciidoctor} +USE_ASCIIDOCTOR = 1 +%endif +# endif with asciidoctor htmldir = %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}} prefix = %{_prefix} -perllibdir = %{?scl:%{_scl_root}}%{perl_vendorlib} +perllibdir = %{perl_vendorlib} gitwebdir = %{_localstatedir}/www/git # Test options DEFAULT_TEST_TARGET = prove -GIT_PROVE_OPTS = --verbose --normalize %{?_smp_mflags} +GIT_PROVE_OPTS = --verbose --normalize %{?_smp_mflags} --formatter=TAP::Formatter::File GIT_TEST_OPTS = -x --verbose-log -TEST_SHELL_PATH = /bin/bash EOF # Filter bogus perl requires @@ -527,6 +571,7 @@ EOF %if ! %{defined perl_bootstrap} %global __requires_exclude %{?__requires_exclude:%__requires_exclude|}perl\\(Term::ReadKey\\) %endif +# endif ! defined perl_bootstrap %else cat << \EOF > %{name}-req #!/bin/sh @@ -537,37 +582,42 @@ EOF %global __perl_requires %{_builddir}/%{name}-%{version}%{?rcrev}/%{name}-req chmod +x %{__perl_requires} %endif +# endif use_new_rpm_filters # Remove Git::LoadCPAN to ensure we use only system perl modules. This also # allows the dependencies to be automatically processed by rpm. rm -rf perl/Git/LoadCPAN{.pm,/} grep -rlZ '^use Git::LoadCPAN::' | xargs -r0 sed -i 's/Git::LoadCPAN:://g' +# Update gitweb default home link string +sed -i 's@"++GITWEB_HOME_LINK_STR++"@$ENV{"SERVER_NAME"} ? "git://" . $ENV{"SERVER_NAME"} : "projects"@' \ + gitweb/gitweb.perl + +# Move contrib/{contacts,subtree} docs to Documentation so they build with the +# proper asciidoc/docbook/xmlto options +mv contrib/{contacts,subtree}/git-*.txt Documentation/ + %build -%{?scl:scl enable %{scl_httpd} - << "EOF"} -%{?scl:export CPATH="%{cpath_dir}:${CPATH}"} -# asciidoc writes a timestamp to files it produces, based on the last -# modified date of the source file, but is sensible to the timezone. -# This makes the results differ according to the timezone of the build machine -# and spurious changes will be seen. -# Set the timezone to UTC as a workaround. -# https://wiki.debian.org/ReproducibleBuilds/TimestampsInDocumentationGeneratedByAsciidoc -TZ=UTC %make_build all %{?with_docs:doc} - -TZ=UTC %make_build -C contrib/contacts/ all %{?with_docs:doc} - -%if %{libsecret} +# Improve build reproducibility +export TZ=UTC +export SOURCE_DATE_EPOCH=$(date -r version +%%s 2>/dev/null) + +%make_build all %{?with_docs:doc} + +%make_build -C contrib/contacts/ all + +%if %{with libsecret} %make_build -C contrib/credential/libsecret/ %endif +# endif with libsecret + +%make_build -C contrib/credential/netrc/ %make_build -C contrib/diff-highlight/ -TZ=UTC %make_build -C contrib/subtree/ all %{?with_docs:doc} +%make_build -C contrib/subtree/ all # Fix shebang in a few places to silence rpmlint complaints -# -# The multimail hook is installed with git. Use python3 to avoid an -# unnecessary python2 dependency. %if %{with python2} sed -i -e '1s@#! */usr/bin/env python$@#!%{__python2}@' \ contrib/fast-import/import-zips.py \ @@ -576,22 +626,27 @@ sed -i -e '1s@#! */usr/bin/env python$@#!%{__python2}@' \ contrib/hooks/multimail/migrate-mailhook-config \ contrib/hooks/multimail/post-receive.example \ contrib/svn-fe/svnrdump_sim.py +%else +# Remove contrib/fast-import/import-zips.py, contrib/hg-to-git, and +# contrib/svn-fe which all require python2. +rm -rf contrib/fast-import/import-zips.py contrib/hg-to-git contrib/svn-fe %endif +# endif with python2 + +# The multimail hook is installed with git. Use python3 to avoid an +# unnecessary python2 dependency, if possible. %if %{with python3} sed -i -e '1s@#!\( */usr/bin/env python\|%{__python2}\)$@#!%{__python3}@' \ contrib/hooks/multimail/git_multimail.py \ contrib/hooks/multimail/migrate-mailhook-config \ contrib/hooks/multimail/post-receive.example %endif -%{?scl:EOF} +# endif with python3 %install -%{?scl:scl enable %{scl_httpd} - << "EOF"} -%{?scl:export CPATH="%{cpath_dir}:${CPATH}"} %make_install %{?with_docs:install-doc} -%{?scl:EOF} -%make_install -C contrib/contacts %{?with_docs:install-doc} +%make_install -C contrib/contacts %global elispdir %{_emacs_sitelispdir}/git pushd contrib/emacs >/dev/null @@ -603,20 +658,23 @@ for el in *.el ; do done popd >/dev/null -%if %{libsecret} +%if %{with libsecret} install -pm 755 contrib/credential/libsecret/git-credential-libsecret \ %{buildroot}%{gitexecdir} %endif +# endif with libsecret install -pm 755 contrib/credential/netrc/git-credential-netrc \ %{buildroot}%{gitexecdir} +# temporarily move contrib/credential/netrc aside to prevent it from being +# deleted in the docs preparation, so the tests can be run in %%check +mv contrib/credential/netrc . -%make_install -C contrib/subtree %{?with_docs:install-doc} +%make_install -C contrib/subtree -mkdir -p %{buildroot}%{httpdconfdir} -mkdir -p %{buildroot}%{_sysconfdir} -install -pm 0644 %{SOURCE13} %{buildroot}%{httpdconfdir}/%{?scl_prefix}%{gitweb_httpd_conf} +mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d +install -pm 0644 %{SOURCE13} %{buildroot}%{_sysconfdir}/httpd/conf.d/%{gitweb_httpd_conf} sed "s|@PROJECTROOT@|%{_localstatedir}/lib/git|g" \ - %{SOURCE14} > %{buildroot}%{_sysconfdir}/%{gitweb_httpd_conf} + %{SOURCE14} > %{buildroot}%{_sysconfdir}/gitweb.conf # install contrib/diff-highlight and clean up to avoid cruft in git-core-doc install -Dpm 0755 contrib/diff-highlight/diff-highlight \ @@ -624,30 +682,33 @@ install -Dpm 0755 contrib/diff-highlight/diff-highlight \ rm -rf contrib/diff-highlight/{Makefile,diff-highlight,*.perl,t} # Clean up contrib/subtree to avoid cruft in the git-core-doc docdir -# Move git-subtree.txt to Documentation so it can be installed later in docdir -mv contrib/subtree/git-subtree.txt Documentation/ -rm -rf contrib/subtree/{INSTALL,Makefile,git-subtree{,.{1,html,sh,txt,xml}},t} +rm -rf contrib/subtree/{INSTALL,Makefile,git-subtree*,t} # git-archimport is not supported find %{buildroot} Documentation -type f -name 'git-archimport*' -exec rm -f {} ';' -%if ! %{with cvs} +%if %{without cvs} # Remove git-cvs* and gitcvs* find %{buildroot} Documentation \( -type f -o -type l \) \ \( -name 'git-cvs*' -o -name 'gitcvs*' \) -exec rm -f {} ';' %endif +# endif without cvs -%if ! %{with p4} +%if %{without p4} # Remove git-p4* and mergetools/p4merge find %{buildroot} Documentation -type f -name 'git-p4*' -exec rm -f {} ';' rm -f %{buildroot}%{gitexecdir}/mergetools/p4merge %endif +# endif without p4 -exclude_re="archimport|email|git-(citool|cvs|daemon|gui|p4|subtree|(remote-test)?svn)|gitk|p4merge|instaweb" +# Remove unneeded git-remote-testsvn so git-svn can be noarch +rm -f %{buildroot}%{gitexecdir}/git-remote-testsvn + +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}%{?scl:%{_scl_root}}%{perl_vendorlib} -type f | sed -e s@^%{buildroot}@@) > perl-git-files -(find %{buildroot}%{?scl:%{_scl_root}}%{perl_vendorlib} -mindepth 1 -type d | sed -e 's@^%{buildroot}@%dir @') >> perl-git-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 Git::SVN files grep Git/SVN perl-git-files > perl-git-svn-files sed -i "/Git\/SVN/ d" perl-git-files @@ -656,21 +717,23 @@ sed -i "/Git\/SVN/ d" perl-git-files %else rm -rf %{buildroot}%{_mandir} %endif +# endif with docs mkdir -p %{buildroot}%{_localstatedir}/lib/git %if %{use_systemd} -install -Dp -m 0644 %{SOURCE16} %{buildroot}%{_unitdir}/%{?scl_prefix}git.socket +install -Dp -m 0644 %{SOURCE16} %{buildroot}%{_unitdir}/git.socket perl -p \ -e "s|\@GITEXECDIR\@|%{gitexecdir}|g;" \ -e "s|\@BASE_PATH\@|%{_localstatedir}/lib/git|g;" \ - %{SOURCE15} > %{buildroot}%{_unitdir}/%{?scl_prefix}git@.service + %{SOURCE15} > %{buildroot}%{_unitdir}/git@.service %else mkdir -p %{buildroot}%{_sysconfdir}/xinetd.d perl -p \ -e "s|\@GITEXECDIR\@|%{gitexecdir}|g;" \ -e "s|\@BASE_PATH\@|%{_localstatedir}/lib/git|g;" \ - %{SOURCE11} > %{buildroot}%{_sysconfdir}/xinetd.d/%{?scl_prefix}git + %{SOURCE11} > %{buildroot}%{_sysconfdir}/xinetd.d/git %endif +# endif use_systemd # Setup bash completion install -Dpm 644 contrib/completion/git-completion.bash %{buildroot}%{bashcompdir}/git @@ -697,11 +760,18 @@ install -pm 644 contrib/completion/git-prompt.sh \ %{buildroot}%{_datadir}/git-core/contrib/completion/ # install git-gui .desktop file -desktop-file-install --dir=%{buildroot}%{appdesktopdir} %{?scl:--vendor=%{?scl_name}} %{SOURCE12} +desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE12} + +# symlink git-citool to git-gui if they are identical +pushd %{buildroot}%{gitexecdir} >/dev/null +if cmp -s git-gui git-citool 2>/dev/null; then + ln -svf git-gui git-citool +fi +popd >/dev/null # find translations -%find_lang %{pkg_name} %{pkg_name}.lang -cat %{pkg_name}.lang >> bin-man-doc-files +%find_lang %{name} %{name}.lang +cat %{name}.lang >> bin-man-doc-files # quiet some rpmlint complaints chmod -R g-w %{buildroot} @@ -712,20 +782,21 @@ chmod a-x Documentation/technical/api-index.sh find contrib -type f -print0 | xargs -r0 chmod -x # Split core files -not_core_re="git-(add--interactive|contacts|credential-(libsecret|netrc)|difftool|filter-branch|instaweb|request-pull|send-mail)|gitweb" +not_core_re="git-(add--interactive|contacts|credential-netrc|difftool|filter-branch|instaweb|request-pull|send-mail)|gitweb" grep -vE "$not_core_re|%{_mandir}" bin-man-doc-files > bin-files-core touch man-doc-files-core %if %{with docs} grep -vE "$not_core_re" bin-man-doc-files | grep "%{_mandir}" > man-doc-files-core %endif +# endif with docs grep -E "$not_core_re" bin-man-doc-files > bin-man-doc-git-files ##### DOC # place doc files into %%{_pkgdocdir} and split them into expected packages # contrib -not_core_doc_re="(git-(cvs|gui|citool|daemon|subtree))|p4|svn|email|gitk|gitweb" +not_core_doc_re="(git-(cvs|gui|citool|daemon|instaweb|subtree))|p4|svn|email|gitk|gitweb" mkdir -p %{buildroot}%{_pkgdocdir}/ -cp -pr README.md Documentation/*.txt Documentation/RelNotes contrib %{buildroot}%{_pkgdocdir}/ +cp -pr CODE_OF_CONDUCT.md README.md Documentation/*.txt Documentation/RelNotes contrib %{buildroot}%{_pkgdocdir}/ # Remove contrib/ files/dirs which have nothing useful for documentation rm -rf %{buildroot}%{_pkgdocdir}/contrib/{contacts,credential,svn-fe}/ cp -p gitweb/INSTALL %{buildroot}%{_pkgdocdir}/INSTALL.gitweb @@ -737,6 +808,7 @@ cp -pr Documentation/{howto,technical} %{buildroot}%{_pkgdocdir}/ find %{buildroot}%{_pkgdocdir}/{howto,technical} -type f \ |grep -o "%{_pkgdocdir}.*$" >> man-doc-files-core %endif +# endif with docs { find %{buildroot}%{_pkgdocdir} -type f -maxdepth 1 \ @@ -750,10 +822,17 @@ find %{buildroot}%{_pkgdocdir}/{howto,technical} -type f \ ##### #DOC %check +%if %{without tests} +echo "*** Skipping tests" +exit 0 +%endif +# endif without tests + %if %{with docs} && %{with linkcheck} # Test links in HTML documentation find %{buildroot}%{_pkgdocdir} -name "*.html" -print0 | xargs -r0 linkchecker %endif +# endif with docs && with linkcheck # Tests to skip on all releases and architectures GIT_SKIP_TESTS="" @@ -763,10 +842,11 @@ GIT_SKIP_TESTS="" # # The following 2 tests use run_with_limited_cmdline, which calls ulimit -s 128 # to limit the maximum stack size. -# t5541.33 'push 2000 tags over http' +# t5541.35 'push 2000 tags over http' # t5551.25 'clone the 2,000 tag repo to check OS command line overflow' -GIT_SKIP_TESTS="$GIT_SKIP_TESTS t5541.33 t5551.25" +GIT_SKIP_TESTS="$GIT_SKIP_TESTS t5541.35 t5551.25" %endif +# endif aarch64 %%{arm} %%{power64} %ifarch %{power64} # Skip tests which fail on ppc @@ -777,6 +857,17 @@ GIT_SKIP_TESTS="$GIT_SKIP_TESTS t5541.33 t5551.25" # the build host. It only appears to occur on ppc-arches. GIT_SKIP_TESTS="$GIT_SKIP_TESTS t9115" %endif +# endif %%{power64} + +%ifarch s390x +# Skip tests which fail on s390x +# +# t7812-grep-icase-non-ascii's "PCRE v2: grep non-ASCII from invalid UTF-8 +# data" test fails on big-endian arches. This is known upstream and will +# hopefully be resolved soon (2019/10/24, tmz) +GIT_SKIP_TESTS="$GIT_SKIP_TESTS t7812.11" +%endif +# endif s390x export GIT_SKIP_TESTS @@ -790,47 +881,43 @@ export GIT_TEST_GIT_DAEMON=true export GIT_TEST_HTTPD=true export GIT_TEST_SVNSERVE=true +# Create tmpdir for test output and update GIT_TEST_OPTS +# Also update GIT-BUILD-OPTIONS to keep make from any needless rebuilding +testdir=$(mktemp -d -p /tmp git-t.XXXX) +sed -i "s@^GIT_TEST_OPTS = .*@& --root=$testdir@" config.mak +touch -r GIT-BUILD-OPTIONS ts +sed -i "s@\(GIT_TEST_OPTS='.*\)'@\1 --root=$testdir'@" GIT-BUILD-OPTIONS +touch -r ts GIT-BUILD-OPTIONS + # Run the tests -# check source files with hardcoded content - it's more for reminder -# when new collection will be added in future -%if 0%{?scl:1} - # scl enable is required to use - grep -q "^Exec=/usr/bin/scl enable %{scl}" %{buildroot}%{appdesktopdir}/*git-gui.desktop - %if 0%{?use_systemd} - grep -q "^ExecStart=-/usr/bin/scl enable %{scl}" %{buildroot}%{_unitdir}/%{?scl_prefix}git@.service - %endif - - # and should be used correct paths - check at least that rh-gitXX is in path - grep -q "^Icon.*%{scl}" %{buildroot}%{appdesktopdir}/*git-gui.desktop - grep "%{_localstatedir}/www/git" %{buildroot}%{httpdconfdir}/%{?scl_prefix}%{gitweb_httpd_conf} - %if 0%{?use_systemd} - grep -qe "-- .*%{scl}" %{buildroot}%{_unitdir}/%{?scl_prefix}git@.service - %endif - - # check Name/GenericName that contains rh-GitXX (with current XX, e.g. 29) - grep -qi "^Name=%{scl}" %{buildroot}%{appdesktopdir}/*git-gui.desktop - grep -qi "^GenericName=%{scl}" %{buildroot}%{appdesktopdir}/*git-gui.desktop - -%endif -%{?scl:scl enable %{scl_httpd} - << "EOF"} -make test || ./print-failed-test-output -%{?scl:EOF} +%__make test || ./print-failed-test-output + +# Run contrib/credential/netrc tests +mkdir -p contrib/credential +mv netrc contrib/credential/ +%make_build -C contrib/credential/netrc/ test || \ +%make_build -C contrib/credential/netrc/ testverbose + +# Clean up test dir +rmdir --ignore-fail-on-non-empty "$testdir" %if %{use_systemd} %post daemon -%systemd_post %{?scl_prefix}git@.service +%systemd_post git.socket %preun daemon -%systemd_preun %{?scl_prefix}git@.service +%systemd_preun git.socket %postun daemon -%systemd_postun_with_restart %{?scl_prefix}git@.service +%systemd_postun_with_restart git.socket %endif +# endif use_systemd %files -f bin-man-doc-git-files %if %{emacs_filesystem} %{elispdir} %endif +# endif emacs_filesystem %{_datadir}/git-core/contrib/diff-highlight %{_datadir}/git-core/contrib/hooks/multimail %{_datadir}/git-core/contrib/hooks/update-paranoid @@ -863,8 +950,16 @@ make test || ./print-failed-test-output # .py files are only bytecompiled on EL <= 7 %exclude %{_pkgdocdir}/contrib/*/*.py[co] %endif +# endif rhel <= 7 %{_pkgdocdir}/contrib/hooks +%if %{with libsecret} +%files credential-libsecret +%defattr(-,root,root) +%{gitexecdir}/git-credential-libsecret +%endif +# endif with libsecret + %if %{with cvs} %files cvs %{_pkgdocdir}/*git-cvs*.txt @@ -873,25 +968,28 @@ make test || ./print-failed-test-output %{?with_docs:%{_mandir}/man1/*cvs*.1*} %{?with_docs:%{_pkgdocdir}/*git-cvs*.html} %endif +# endif with cvs %files daemon %{_pkgdocdir}/git-daemon*.txt %if %{use_systemd} -%{_unitdir}/%{?scl_prefix}git.socket -%{_unitdir}/%{?scl_prefix}git@.service +%{_unitdir}/git.socket +%{_unitdir}/git@.service %else -%config(noreplace)%{_sysconfdir}/xinetd.d/%{?scl_prefix}git +%config(noreplace)%{_sysconfdir}/xinetd.d/git %endif +# endif use_systemd %{gitexecdir}/git-daemon %{_localstatedir}/lib/git %{?with_docs:%{_mandir}/man1/git-daemon*.1*} %{?with_docs:%{_pkgdocdir}/git-daemon*.html} %if ! %{emacs_filesystem} -%files -n %{?scl_prefix}emacs-git +%files -n emacs-git %{_pkgdocdir}/contrib/emacs/README %{elispdir} %endif +# endif ! emacs_filesystem %files email %{_pkgdocdir}/*email*.txt @@ -899,25 +997,27 @@ make test || ./print-failed-test-output %{?with_docs:%{_mandir}/man1/*email*.1*} %{?with_docs:%{_pkgdocdir}/*email*.html} -%files -n %{?scl_prefix}gitk +%files -n gitk %{_pkgdocdir}/*gitk*.txt %{_bindir}/*gitk* %{_datadir}/gitk %{?with_docs:%{_mandir}/man1/*gitk*.1*} %{?with_docs:%{_pkgdocdir}/*gitk*.html} -%files -n %{?scl_prefix}gitweb +%files -n gitweb %{_pkgdocdir}/*.gitweb %{_pkgdocdir}/gitweb*.txt +%{?with_docs:%{_mandir}/man1/gitweb.1*} +%{?with_docs:%{_mandir}/man5/gitweb.conf.5*} %{?with_docs:%{_pkgdocdir}/gitweb*.html} -%config(noreplace)%{_sysconfdir}/%{gitweb_httpd_conf} -%config(noreplace)%{httpdconfdir}/%{?scl_prefix}%{gitweb_httpd_conf} +%config(noreplace)%{_sysconfdir}/gitweb.conf +%config(noreplace)%{_sysconfdir}/httpd/conf.d/%{gitweb_httpd_conf} %{_localstatedir}/www/git/ %files gui %{gitexecdir}/git-gui* %{gitexecdir}/git-citool -%{appdesktopdir}/*git-gui.desktop +%{_datadir}/applications/*git-gui.desktop %{_datadir}/git-gui/ %{_pkgdocdir}/git-gui.txt %{_pkgdocdir}/git-citool.txt @@ -926,6 +1026,13 @@ make test || ./print-failed-test-output %{?with_docs:%{_mandir}/man1/git-citool.1*} %{?with_docs:%{_pkgdocdir}/git-citool.html} +%files instaweb +%defattr(-,root,root) +%{gitexecdir}/git-instaweb +%{_pkgdocdir}/git-instaweb.txt +%{?with_docs:%{_mandir}/man1/git-instaweb.1*} +%{?with_docs:%{_pkgdocdir}/git-instaweb.html} + %if %{with p4} %files p4 %{gitexecdir}/*p4* @@ -934,11 +1041,12 @@ make test || ./print-failed-test-output %{?with_docs:%{_mandir}/man1/*p4*.1*} %{?with_docs:%{_pkgdocdir}/*p4*.html} %endif +# endif with p4 -%files -n %{?scl_prefix}perl-Git -f perl-git-files +%files -n perl-Git -f perl-git-files %{?with_docs:%{_mandir}/man3/Git.3pm*} -%files -n %{?scl_prefix}perl-Git-SVN -f perl-git-svn-files +%files -n perl-Git-SVN -f perl-git-svn-files %files subtree %{gitexecdir}/git-subtree @@ -947,20 +1055,35 @@ make test || ./print-failed-test-output %{?with_docs:%{_pkgdocdir}/git-subtree.html} %files svn -%{gitexecdir}/git-remote-testsvn %{gitexecdir}/git-svn %{_pkgdocdir}/git-svn.txt %{?with_docs:%{_mandir}/man1/git-svn.1*} %{?with_docs:%{_pkgdocdir}/git-svn.html} -%files instaweb -%defattr(-,root,root) -%{gitexecdir}/git-instaweb -%{_pkgdocdir}/git-instaweb.txt -%{?with_docs:%{_mandir}/man1/git-instaweb.1*} -%{?with_docs:%{_pkgdocdir}/git-instaweb.html} - %changelog +* Thu Jun 11 2020 Ondrej Pohorelsky - 2.27.0-1 +- Update to release 2.27.0 +- Resolves: rhbz#1825114 + +* Tue May 26 2020 Ondrej Pohorelsky - 2.26.2-1 +- Update to release 2.26.2 +- Resolves: rhbz#1825114 + +* Wed Apr 22 2020 Ondrej Pohorelsky - 2.18.4-1 +- Update to release 2.18.4 +- Resolves: CVE-2020-11008 + +* Thu Apr 9 2020 Ondrej Pohorelsky - 2.18.2-2 +- Crafted URL containing new lines can cause credential leak +- Resolves: CVE-2020-5260 + +* Tue Dec 17 2019 Ondrej Pohorelsky - 2.18.2-1 +- Update to release 2.18.2 +- Remote code execution in recursive clones with nested submodules + Resolves: CVE-2019-1387 +- Fixes CVE-2019-1348, CVE-2019-1349, CVE-2019-1350, CVE-2019-1351, + CVE-2019-1352, CVE-2019-1353, CVE-2019-1354 + * Tue Jun 11 2019 Marcel Plch - 2.18.1-4 - Use HMAC from libcrypto instead of git's implementation - Resolves: rhbz#1619113