archrelease: copy trunk to staging-x86_64
[arch-packages.git] / git / repos / extra-x86_64 / PKGBUILD
blob0d04ef229fd17d3bc13369336b467a41bca91a9f
1 # Maintainer: Christian Hesse <mail@eworm.de>
2 # Maintainer: Dan McGee <dan@archlinux.org>
4 pkgname=git
5 pkgver=2.40.1
6 pkgrel=1
7 pkgdesc='the fast distributed version control system'
8 arch=('x86_64')
9 url='https://git-scm.com/'
10 license=('GPL2')
11 depends=('curl' 'expat' 'perl' 'perl-error' 'perl-mailtools'
12          'openssl' 'pcre2' 'grep' 'shadow' 'zlib')
13 makedepends=('python' 'libgnome-keyring' 'xmlto' 'asciidoc')
14 optdepends=('tk: gitk and git gui'
15             'perl-libwww: git svn'
16             'perl-term-readkey: git svn and interactive.singlekey setting'
17             'perl-io-socket-ssl: git send-email TLS support'
18             'perl-authen-sasl: git send-email TLS support'
19             'perl-mediawiki-api: git mediawiki support'
20             'perl-datetime-format-iso8601: git mediawiki support'
21             'perl-lwp-protocol-https: git mediawiki https support'
22             'perl-cgi: gitweb (web interface) support'
23             'python: git svn & git p4'
24             'subversion: git svn'
25             'org.freedesktop.secrets: keyring credential helper'
26             'libsecret: libsecret credential helper')
27 install=git.install
28 validpgpkeys=('96E07AF25771955980DAD10020D04E5A713660A7') # Junio C Hamano
29 source=("https://www.kernel.org/pub/software/scm/git/git-$pkgver.tar."{xz,sign}
30         'git-daemon@.service'
31         'git-daemon.socket'
32         'git-sysusers.conf')
33 sha256sums=('4893b8b98eefc9fdc4b0e7ca249e340004faa7804a433d17429e311e1fef21d2'
34             'SKIP'
35             '14c0b67cfe116b430645c19d8c4759419657e6809dfa28f438c33a005245ad91'
36             'ac4c90d62c44926e6d30d18d97767efc901076d4e0283ed812a349aece72f203'
37             '7630e8245526ad80f703fac9900a1328588c503ce32b37b9f8811674fcda4a45')
39 _make_paths=(
40   prefix='/usr'
41   gitexecdir='/usr/lib/git-core'
42   perllibdir="$(/usr/bin/perl -MConfig -wle 'print $Config{installvendorlib}')"
45 _make_options=(
46   CFLAGS="$CFLAGS"
47   LDFLAGS="$LDFLAGS"
48   INSTALL_SYMLINKS=1
49   MAN_BOLD_LITERAL=1
50   NO_PERL_CPAN_FALLBACKS=1
51   USE_LIBPCRE2=1
54 build() {
55   cd "$srcdir/$pkgname-$pkgver"
57   make \
58     "${_make_paths[@]}" \
59     "${_make_options[@]}" \
60     all man
62   make -C contrib/credential/gnome-keyring
63   make -C contrib/credential/libsecret
64   make -C contrib/subtree "${_make_paths[@]}" all man
65   make -C contrib/mw-to-git "${_make_paths[@]}" all
66   make -C contrib/diff-highlight "${_make_paths[@]}"
69 check() {
70   cd "$srcdir/$pkgname-$pkgver"
72   local jobs
73   jobs=$(expr "$MAKEFLAGS" : '.*\(-j[0-9]*\).*') || true
74   mkdir -p /dev/shm/git-test
75   # explicitly specify SHELL to avoid a test failure in t/t9903-bash-prompt.sh
76   # which is caused by 'git rebase' trying to use builduser's SHELL inside the
77   # build chroot (i.e.: /usr/bin/nologin)
78   SHELL=/bin/sh \
79   make \
80     "${_make_paths[@]}" \
81     "${_make_options[@]}" \
82     NO_SVN_TESTS=y \
83     DEFAULT_TEST_TARGET=prove \
84     GIT_PROVE_OPTS="$jobs -Q" \
85     GIT_TEST_OPTS="--root=/dev/shm/git-test" \
86     test
89 package() {
90   cd "$srcdir/$pkgname-$pkgver"
91   
92   make \
93     "${_make_paths[@]}" \
94     "${_make_options[@]}" \
95     DESTDIR="$pkgdir" \
96     install install-man
98   # bash completion
99   mkdir -p "$pkgdir"/usr/share/bash-completion/completions/
100   install -m 0644 ./contrib/completion/git-completion.bash "$pkgdir"/usr/share/bash-completion/completions/git
101   # fancy git prompt
102   mkdir -p "$pkgdir"/usr/share/git/
103   install -m 0644 ./contrib/completion/git-prompt.sh "$pkgdir"/usr/share/git/git-prompt.sh
104   # gnome credentials helper (deprecated, but we will keep it as long there is no extra cost)
105   # https://gitlab.gnome.org/GNOME/libgnome-keyring/commit/6a5adea4aec93
106   install -m 0755 contrib/credential/gnome-keyring/git-credential-gnome-keyring \
107       "$pkgdir"/usr/lib/git-core/git-credential-gnome-keyring
108   make -C contrib/credential/gnome-keyring clean
109   # libsecret credentials helper
110   install -m 0755 contrib/credential/libsecret/git-credential-libsecret \
111       "$pkgdir"/usr/lib/git-core/git-credential-libsecret
112   make -C contrib/credential/libsecret clean
113   # subtree installation
114   make -C contrib/subtree "${_make_paths[@]}" DESTDIR="$pkgdir" install install-man
115   # mediawiki installation
116   make -C contrib/mw-to-git "${_make_paths[@]}" DESTDIR="$pkgdir" install
117   # the rest of the contrib stuff
118   find contrib/ -name '.gitignore' -delete
119   cp -a ./contrib/* "$pkgdir"/usr/share/git/
121   # git-daemon via systemd socket activation
122   install -D -m 0644 "$srcdir"/git-daemon@.service "$pkgdir"/usr/lib/systemd/system/git-daemon@.service
123   install -D -m 0644 "$srcdir"/git-daemon.socket "$pkgdir"/usr/lib/systemd/system/git-daemon.socket
125   # sysusers file
126   install -D -m 0644 "$srcdir"/git-sysusers.conf "$pkgdir"/usr/lib/sysusers.d/git.conf