diff options
author | Galen Guyer <galen@galenguyer.com> | 2022-04-27 13:16:13 -0400 |
---|---|---|
committer | Galen Guyer <galen@galenguyer.com> | 2022-04-27 13:16:13 -0400 |
commit | 73377fdc1fd9ef7080c430fc71587f92bbf0c129 (patch) | |
tree | 82498993d9cf592c830ee30548299e06b020c63a |
v2.36.0
-rw-r--r-- | PKGBUILD | 131 | ||||
-rw-r--r-- | default-branch.patch | 222 | ||||
-rw-r--r-- | git-daemon.socket | 9 | ||||
-rw-r--r-- | git-daemon@.service | 14 | ||||
-rw-r--r-- | git-sysusers.conf | 1 | ||||
-rw-r--r-- | git.install | 14 |
6 files changed, 391 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..ac3e074 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,131 @@ +# Maintainer: Christian Hesse <mail@eworm.de> +# Maintainer: Dan McGee <dan@archlinux.org> + +pkgname=git-mistress +pkgver=2.36.0 +pkgrel=1 +pkgdesc='the fast distributed version control system' +arch=('x86_64') +url='https://git-scm.com/' +license=('GPL2') +depends=('curl' 'expat' 'perl' 'perl-error' 'perl-mailtools' + 'openssl' 'pcre2' 'grep' 'shadow' 'zlib') +makedepends=('python' 'libgnome-keyring' 'xmlto' 'asciidoc' 'patch') +optdepends=('tk: gitk and git gui' + 'perl-libwww: git svn' + 'perl-term-readkey: git svn and interactive.singlekey setting' + 'perl-io-socket-ssl: git send-email TLS support' + 'perl-authen-sasl: git send-email TLS support' + 'perl-mediawiki-api: git mediawiki support' + 'perl-datetime-format-iso8601: git mediawiki support' + 'perl-lwp-protocol-https: git mediawiki https support' + 'perl-cgi: gitweb (web interface) support' + 'python: git svn & git p4' + 'subversion: git svn' + 'org.freedesktop.secrets: keyring credential helper' + 'libsecret: libsecret credential helper') +conflicts=('git') +install=git.install +validpgpkeys=('96E07AF25771955980DAD10020D04E5A713660A7') # Junio C Hamano +source=("https://www.kernel.org/pub/software/scm/git/git-$pkgver.tar."{xz,sign} + 'git-daemon@.service' + 'git-daemon.socket' + 'git-sysusers.conf' + 'default-branch.patch') +sha256sums=('af5ebfc1658464f5d0d45a2bfd884c935fb607a10cc021d95bc80778861cc1d3' + 'SKIP' + '14c0b67cfe116b430645c19d8c4759419657e6809dfa28f438c33a005245ad91' + 'ac4c90d62c44926e6d30d18d97767efc901076d4e0283ed812a349aece72f203' + '7630e8245526ad80f703fac9900a1328588c503ce32b37b9f8811674fcda4a45' + 'acfaf69ed4b383ac9cb4764e391cc9db430a172d06f684b90bfff1cd43b78bfd') + +_make_paths=( + prefix='/usr' + gitexecdir='/usr/lib/git-core' + perllibdir="$(/usr/bin/perl -MConfig -wle 'print $Config{installvendorlib}')" +) + +_make_options=( + CFLAGS="$CFLAGS" + LDFLAGS="$LDFLAGS" + INSTALL_SYMLINKS=1 + MAN_BOLD_LITERAL=1 + NO_PERL_CPAN_FALLBACKS=1 + USE_LIBPCRE2=1 +) + +build() { + cd "$srcdir/git-$pkgver" + patch -p1 < "$srcdir"/default-branch.patch + + make \ + "${_make_paths[@]}" \ + "${_make_options[@]}" \ + all man + + make -C contrib/credential/gnome-keyring + make -C contrib/credential/libsecret + make -C contrib/subtree "${_make_paths[@]}" all man + make -C contrib/mw-to-git "${_make_paths[@]}" all + make -C contrib/diff-highlight "${_make_paths[@]}" +} + +# check() { +# cd "$srcdir/git-$pkgver" + +# local jobs +# jobs=$(expr "$MAKEFLAGS" : '.*\(-j[0-9]*\).*') || true +# mkdir -p /dev/shm/git-test +# # explicitly specify SHELL to avoid a test failure in t/t9903-bash-prompt.sh +# # which is caused by 'git rebase' trying to use builduser's SHELL inside the +# # build chroot (i.e.: /usr/bin/nologin) +# SHELL=/bin/sh \ +# make \ +# "${_make_paths[@]}" \ +# "${_make_options[@]}" \ +# NO_SVN_TESTS=y \ +# DEFAULT_TEST_TARGET=prove \ +# GIT_PROVE_OPTS="$jobs -Q" \ +# GIT_TEST_OPTS="--root=/dev/shm/git-test" \ +# test +# } + +package() { + cd "$srcdir/git-$pkgver" + + make \ + "${_make_paths[@]}" \ + "${_make_options[@]}" \ + DESTDIR="$pkgdir" \ + install install-man + + # bash completion + mkdir -p "$pkgdir"/usr/share/bash-completion/completions/ + install -m 0644 ./contrib/completion/git-completion.bash "$pkgdir"/usr/share/bash-completion/completions/git + # fancy git prompt + mkdir -p "$pkgdir"/usr/share/git/ + install -m 0644 ./contrib/completion/git-prompt.sh "$pkgdir"/usr/share/git/git-prompt.sh + # gnome credentials helper (deprecated, but we will keep it as long there is no extra cost) + # https://gitlab.gnome.org/GNOME/libgnome-keyring/commit/6a5adea4aec93 + install -m 0755 contrib/credential/gnome-keyring/git-credential-gnome-keyring \ + "$pkgdir"/usr/lib/git-core/git-credential-gnome-keyring + make -C contrib/credential/gnome-keyring clean + # libsecret credentials helper + install -m 0755 contrib/credential/libsecret/git-credential-libsecret \ + "$pkgdir"/usr/lib/git-core/git-credential-libsecret + make -C contrib/credential/libsecret clean + # subtree installation + make -C contrib/subtree "${_make_paths[@]}" DESTDIR="$pkgdir" install install-man + # mediawiki installation + make -C contrib/mw-to-git "${_make_paths[@]}" DESTDIR="$pkgdir" install + # the rest of the contrib stuff + find contrib/ -name '.gitignore' -delete + cp -a ./contrib/* "$pkgdir"/usr/share/git/ + + # git-daemon via systemd socket activation + install -D -m 0644 "$srcdir"/git-daemon@.service "$pkgdir"/usr/lib/systemd/system/git-daemon@.service + install -D -m 0644 "$srcdir"/git-daemon.socket "$pkgdir"/usr/lib/systemd/system/git-daemon.socket + + # sysusers file + install -D -m 0644 "$srcdir"/git-sysusers.conf "$pkgdir"/usr/lib/sysusers.d/git.conf +} diff --git a/default-branch.patch b/default-branch.patch new file mode 100644 index 0000000..631591f --- /dev/null +++ b/default-branch.patch @@ -0,0 +1,222 @@ +diff --git a/po/bg.po b/po/bg.po +index 8328531..16570fb 100644 +--- a/po/bg.po ++++ b/po/bg.po +@@ -7364,7 +7364,7 @@ msgid "" + "\n" + "\tgit config --global init.defaultBranch <name>\n" + "\n" +-"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n" ++"Names commonly chosen instead of 'mistress' are 'main', 'trunk' and\n" + "'development'. The just-created branch can be renamed via this command:\n" + "\n" + "\tgit branch -m <name>\n" +diff --git a/po/ca.po b/po/ca.po +index 524330a..4b31f5d 100644 +--- a/po/ca.po ++++ b/po/ca.po +@@ -7381,7 +7381,7 @@ msgid "" + "\n" + "\tgit config --global init.defaultBranch <name>\n" + "\n" +-"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n" ++"Names commonly chosen instead of 'mistress' are 'main', 'trunk' and\n" + "'development'. The just-created branch can be renamed via this command:\n" + "\n" + "\tgit branch -m <name>\n" +diff --git a/po/de.po b/po/de.po +index ef04b54..9f258e5 100644 +--- a/po/de.po ++++ b/po/de.po +@@ -7374,7 +7374,7 @@ msgid "" + "\n" + "\tgit config --global init.defaultBranch <name>\n" + "\n" +-"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n" ++"Names commonly chosen instead of 'mistress' are 'main', 'trunk' and\n" + "'development'. The just-created branch can be renamed via this command:\n" + "\n" + "\tgit branch -m <name>\n" +diff --git a/po/es.po b/po/es.po +index ced2eb6..a6debdc 100644 +--- a/po/es.po ++++ b/po/es.po +@@ -7121,7 +7121,7 @@ msgid "" + "\n" + "\tgit config --global init.defaultBranch <name>\n" + "\n" +-"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n" ++"Names commonly chosen instead of 'mistress' are 'main', 'trunk' and\n" + "'development'. The just-created branch can be renamed via this command:\n" + "\n" + "\tgit branch -m <name>\n" +diff --git a/po/fr.po b/po/fr.po +index 7f3ace8..42badfd 100644 +--- a/po/fr.po ++++ b/po/fr.po +@@ -7432,7 +7432,7 @@ msgid "" + "\n" + "\tgit config --global init.defaultBranch <name>\n" + "\n" +-"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n" ++"Names commonly chosen instead of 'mistress' are 'main', 'trunk' and\n" + "'development'. The just-created branch can be renamed via this command:\n" + "\n" + "\tgit branch -m <name>\n" +diff --git a/po/git.pot b/po/git.pot +index 054cb99..84bd458 100644 +--- a/po/git.pot ++++ b/po/git.pot +@@ -6744,7 +6744,7 @@ msgid "" + "\n" + "\tgit config --global init.defaultBranch <name>\n" + "\n" +-"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n" ++"Names commonly chosen instead of 'mistress' are 'main', 'trunk' and\n" + "'development'. The just-created branch can be renamed via this command:\n" + "\n" + "\tgit branch -m <name>\n" +diff --git a/po/id.po b/po/id.po +index 76284fe..b5fa59d 100644 +--- a/po/id.po ++++ b/po/id.po +@@ -7122,7 +7122,7 @@ msgid "" + "\n" + "\tgit config --global init.defaultBranch <name>\n" + "\n" +-"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n" ++"Names commonly chosen instead of 'mistress' are 'main', 'trunk' and\n" + "'development'. The just-created branch can be renamed via this command:\n" + "\n" + "\tgit branch -m <name>\n" +diff --git a/po/pl.po b/po/pl.po +index 0ec127e..81d9c8c 100644 +--- a/po/pl.po ++++ b/po/pl.po +@@ -7136,7 +7136,7 @@ msgid "" + "\n" + "\tgit config --global init.defaultBranch <name>\n" + "\n" +-"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n" ++"Names commonly chosen instead of 'mistress' are 'main', 'trunk' and\n" + "'development'. The just-created branch can be renamed via this command:\n" + "\n" + "\tgit branch -m <name>\n" +diff --git a/po/pt_PT.po b/po/pt_PT.po +index 3214253..c47201b 100644 +--- a/po/pt_PT.po ++++ b/po/pt_PT.po +@@ -7323,7 +7323,7 @@ msgid "" + "\n" + "\tgit config --global init.defaultBranch <name>\n" + "\n" +-"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n" ++"Names commonly chosen instead of 'mistress' are 'main', 'trunk' and\n" + "'development'. The just-created branch can be renamed via this command:\n" + "\n" + "\tgit branch -m <name>\n" +diff --git a/po/ru.po b/po/ru.po +index 993d106..a0e77b4 100644 +--- a/po/ru.po ++++ b/po/ru.po +@@ -5798,7 +5798,7 @@ msgid "" + "\n" + "\tgit config --global init.defaultBranch <name>\n" + "\n" +-"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n" ++"Names commonly chosen instead of 'mistress' are 'main', 'trunk' and\n" + "'development'. The just-created branch can be renamed via this command:\n" + "\n" + "\tgit branch -m <name>\n" +diff --git a/po/sv.po b/po/sv.po +index 14176ac..b226a5e 100644 +--- a/po/sv.po ++++ b/po/sv.po +@@ -7230,7 +7230,7 @@ msgid "" + "\n" + "\tgit config --global init.defaultBranch <name>\n" + "\n" +-"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n" ++"Names commonly chosen instead of 'mistress' are 'main', 'trunk' and\n" + "'development'. The just-created branch can be renamed via this command:\n" + "\n" + "\tgit branch -m <name>\n" +diff --git a/po/tr.po b/po/tr.po +index 45d66c6..516193f 100644 +--- a/po/tr.po ++++ b/po/tr.po +@@ -7295,7 +7295,7 @@ msgid "" + "\n" + "\tgit config --global init.defaultBranch <name>\n" + "\n" +-"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n" ++"Names commonly chosen instead of 'mistress' are 'main', 'trunk' and\n" + "'development'. The just-created branch can be renamed via this command:\n" + "\n" + "\tgit branch -m <name>\n" +diff --git a/po/vi.po b/po/vi.po +index 69c3b93..11db03c 100644 +--- a/po/vi.po ++++ b/po/vi.po +@@ -7242,7 +7242,7 @@ msgid "" + "\n" + "\tgit config --global init.defaultBranch <name>\n" + "\n" +-"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n" ++"Names commonly chosen instead of 'mistress' are 'main', 'trunk' and\n" + "'development'. The just-created branch can be renamed via this command:\n" + "\n" + "\tgit branch -m <name>\n" +diff --git a/po/zh_CN.po b/po/zh_CN.po +index f0551f2..271e645 100644 +--- a/po/zh_CN.po ++++ b/po/zh_CN.po +@@ -7197,7 +7197,7 @@ msgid "" + "\n" + "\tgit config --global init.defaultBranch <name>\n" + "\n" +-"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n" ++"Names commonly chosen instead of 'mistress' are 'main', 'trunk' and\n" + "'development'. The just-created branch can be renamed via this command:\n" + "\n" + "\tgit branch -m <name>\n" +diff --git a/po/zh_TW.po b/po/zh_TW.po +index caf6057..a81fd01 100644 +--- a/po/zh_TW.po ++++ b/po/zh_TW.po +@@ -7057,7 +7057,7 @@ msgid "" + "\n" + "\tgit config --global init.defaultBranch <name>\n" + "\n" +-"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n" ++"Names commonly chosen instead of 'mistress' are 'main', 'trunk' and\n" + "'development'. The just-created branch can be renamed via this command:\n" + "\n" + "\tgit branch -m <name>\n" +diff --git a/refs.c b/refs.c +index 9db66e9..027a45d 100644 +--- a/refs.c ++++ b/refs.c +@@ -564,7 +564,7 @@ static const char default_branch_name_advice[] = N_( + "\n" + "\tgit config --global init.defaultBranch <name>\n" + "\n" +-"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n" ++"Names commonly chosen instead of 'mistress' are 'main', 'trunk' and\n" + "'development'. The just-created branch can be renamed via this command:\n" + "\n" + "\tgit branch -m <name>\n" +@@ -583,9 +583,10 @@ char *repo_default_branch_name(struct repository *r, int quiet) + die(_("could not retrieve `%s`"), config_display_key); + + if (!ret) { +- ret = xstrdup("master"); +- if (!quiet) +- advise(_(default_branch_name_advice), ret); ++ ret = xstrdup("mistress"); ++ // there's no need to advise this - the point is we're setting it manually ++ //if (!quiet) ++ //advise(_(default_branch_name_advice), ret); + } + + full_ref = xstrfmt("refs/heads/%s", ret); diff --git a/git-daemon.socket b/git-daemon.socket new file mode 100644 index 0000000..58ed2f1 --- /dev/null +++ b/git-daemon.socket @@ -0,0 +1,9 @@ +[Unit] +Description=Git Daemon Socket + +[Socket] +ListenStream=9418 +Accept=true + +[Install] +WantedBy=sockets.target diff --git a/git-daemon@.service b/git-daemon@.service new file mode 100644 index 0000000..70e0dca --- /dev/null +++ b/git-daemon@.service @@ -0,0 +1,14 @@ +[Unit] +Description=Git Daemon Instance + +[Service] +User=git +# The '-' is to ignore non-zero exit statuses +ExecStart=-/usr/lib/git-core/git-daemon --inetd --export-all --base-path=/srv/git +StandardInput=socket +StandardOutput=inherit +StandardError=journal +ProtectSystem=full +ProtectHome=on +PrivateDevices=on +NoNewPrivileges=on diff --git a/git-sysusers.conf b/git-sysusers.conf new file mode 100644 index 0000000..8189065 --- /dev/null +++ b/git-sysusers.conf @@ -0,0 +1 @@ +u git - "git daemon user" / /usr/bin/git-shell diff --git a/git.install b/git.install new file mode 100644 index 0000000..453050d --- /dev/null +++ b/git.install @@ -0,0 +1,14 @@ +#!/bin/sh + +post_install() { + # make git-shell a valid shell + if ! grep -qe '^/usr/bin/git-shell$' etc/shells; then + echo '/usr/bin/git-shell' >> etc/shells + fi +} + +# do not modify user settings (shell) in post-upgrade function! + +post_remove() { + sed -i -r '/^\/usr\/bin\/git-shell$/d' etc/shells +} |