archrelease: copy trunk to extra-x86_64
[arch-packages.git] / git / trunk / PKGBUILD
blobfcdbd0ca0f5c1ab78d850960d35a2e806c41d924
1 # Maintainer: Christian Hesse <mail@eworm.de>
2 # Maintainer: Dan McGee <dan@archlinux.org>
4 pkgname=git
5 pkgver=2.38.1
6 pkgrel=2
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 options=('debug')
28 install=git.install
29 validpgpkeys=('96E07AF25771955980DAD10020D04E5A713660A7') # Junio C Hamano
30 source=("https://www.kernel.org/pub/software/scm/git/git-$pkgver.tar."{xz,sign}
31         'git-daemon@.service'
32         'git-daemon.socket'
33         'git-sysusers.conf')
34 sha256sums=('97ddf8ea58a2b9e0fbc2508e245028ca75911bd38d1551616b148c1aa5740ad9'
35             'SKIP'
36             '14c0b67cfe116b430645c19d8c4759419657e6809dfa28f438c33a005245ad91'
37             'ac4c90d62c44926e6d30d18d97767efc901076d4e0283ed812a349aece72f203'
38             '7630e8245526ad80f703fac9900a1328588c503ce32b37b9f8811674fcda4a45')
40 _make_paths=(
41   prefix='/usr'
42   gitexecdir='/usr/lib/git-core'
43   perllibdir="$(/usr/bin/perl -MConfig -wle 'print $Config{installvendorlib}')"
46 _make_options=(
47   CFLAGS="$CFLAGS"
48   LDFLAGS="$LDFLAGS"
49   INSTALL_SYMLINKS=1
50   MAN_BOLD_LITERAL=1
51   NO_PERL_CPAN_FALLBACKS=1
52   USE_LIBPCRE2=1
55 build() {
56   cd "$srcdir/$pkgname-$pkgver"
58   make \
59     "${_make_paths[@]}" \
60     "${_make_options[@]}" \
61     all man
63   make -C contrib/credential/gnome-keyring
64   make -C contrib/credential/libsecret
65   make -C contrib/subtree "${_make_paths[@]}" all man
66   make -C contrib/mw-to-git "${_make_paths[@]}" all
67   make -C contrib/diff-highlight "${_make_paths[@]}"
70 check() {
71   cd "$srcdir/$pkgname-$pkgver"
73   local jobs
74   jobs=$(expr "$MAKEFLAGS" : '.*\(-j[0-9]*\).*') || true
75   mkdir -p /dev/shm/git-test
76   # explicitly specify SHELL to avoid a test failure in t/t9903-bash-prompt.sh
77   # which is caused by 'git rebase' trying to use builduser's SHELL inside the
78   # build chroot (i.e.: /usr/bin/nologin)
79   SHELL=/bin/sh \
80   make \
81     "${_make_paths[@]}" \
82     "${_make_options[@]}" \
83     NO_SVN_TESTS=y \
84     DEFAULT_TEST_TARGET=prove \
85     GIT_PROVE_OPTS="$jobs -Q" \
86     GIT_TEST_OPTS="--root=/dev/shm/git-test" \
87     test
90 package() {
91   cd "$srcdir/$pkgname-$pkgver"
92   
93   make \
94     "${_make_paths[@]}" \
95     "${_make_options[@]}" \
96     DESTDIR="$pkgdir" \
97     install install-man
99   # bash completion
100   mkdir -p "$pkgdir"/usr/share/bash-completion/completions/
101   install -m 0644 ./contrib/completion/git-completion.bash "$pkgdir"/usr/share/bash-completion/completions/git
102   # fancy git prompt
103   mkdir -p "$pkgdir"/usr/share/git/
104   install -m 0644 ./contrib/completion/git-prompt.sh "$pkgdir"/usr/share/git/git-prompt.sh
105   # gnome credentials helper (deprecated, but we will keep it as long there is no extra cost)
106   # https://gitlab.gnome.org/GNOME/libgnome-keyring/commit/6a5adea4aec93
107   install -m 0755 contrib/credential/gnome-keyring/git-credential-gnome-keyring \
108       "$pkgdir"/usr/lib/git-core/git-credential-gnome-keyring
109   make -C contrib/credential/gnome-keyring clean
110   # libsecret credentials helper
111   install -m 0755 contrib/credential/libsecret/git-credential-libsecret \
112       "$pkgdir"/usr/lib/git-core/git-credential-libsecret
113   make -C contrib/credential/libsecret clean
114   # subtree installation
115   make -C contrib/subtree "${_make_paths[@]}" DESTDIR="$pkgdir" install install-man
116   # mediawiki installation
117   make -C contrib/mw-to-git "${_make_paths[@]}" DESTDIR="$pkgdir" install
118   # the rest of the contrib stuff
119   find contrib/ -name '.gitignore' -delete
120   cp -a ./contrib/* "$pkgdir"/usr/share/git/
122   # git-daemon via systemd socket activation
123   install -D -m 0644 "$srcdir"/git-daemon@.service "$pkgdir"/usr/lib/systemd/system/git-daemon@.service
124   install -D -m 0644 "$srcdir"/git-daemon.socket "$pkgdir"/usr/lib/systemd/system/git-daemon.socket
126   # sysusers file
127   install -D -m 0644 "$srcdir"/git-sysusers.conf "$pkgdir"/usr/lib/sysusers.d/git.conf