diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2018-02-08 15:24:12 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2018-02-08 15:24:12 +0100 |
commit | 811c32346ed295b86715c9641e95721a1b9f2abc (patch) | |
tree | ba4b6a053a9046cd1304eed1a748af104819d21a /main/git | |
parent | 7df982db1c7b9cd438d78e595c01074c07780d16 (diff) | |
download | aports-811c32346ed295b86715c9641e95721a1b9f2abc.tar.bz2 aports-811c32346ed295b86715c9641e95721a1b9f2abc.tar.xz |
main/git: improve abuild
Diffstat (limited to 'main/git')
-rw-r--r-- | main/git/APKBUILD | 81 |
1 files changed, 46 insertions, 35 deletions
diff --git a/main/git/APKBUILD b/main/git/APKBUILD index 6634172146..4cab296deb 100644 --- a/main/git/APKBUILD +++ b/main/git/APKBUILD @@ -1,5 +1,9 @@ # Contributor: Ćukasz Jendrysik <scadu@yandex.com> # Maintainer: Natanael Copa <ncopa@alpinelinux.org> +# +# secfixes: +# 2.14.1: +# - CVE-2017-1000117 pkgname=git pkgver=2.16.1 pkgrel=0 @@ -7,13 +11,11 @@ pkgdesc="A distributed version control system" url="https://www.git-scm.com/" arch="all" license="GPL-2.0-or-later" -depends= +depends="" +# we need tcl and tk to be built before git due to git-gui and gitk +makedepends="zlib-dev libressl-dev curl-dev expat-dev perl-dev python2-dev + pcre2-dev asciidoc xmlto perl-error tcl tk" replaces="git-perl" - -# secfixes: -# 2.14.1: -# - CVE-2017-1000117 - # note that order matters subpackages="$pkgname-doc $pkgname-bash-completion:completion:noarch @@ -33,20 +35,18 @@ subpackages="$pkgname-doc $pkgname-gitk::noarch $pkgname-diff-highlight:diff_highlight:noarch " -# we need tcl and tk to be built before git due to git-gui and gitk -makedepends="zlib-dev libressl-dev curl-dev expat-dev perl-dev python2-dev - pcre2-dev asciidoc xmlto perl-error tcl tk" source="https://www.kernel.org/pub/software/scm/git/git-$pkgver.tar.xz bb-tar.patch git-daemon.initd git-daemon.confd " +builddir="$srcdir/$pkgname-$pkgver" _gitcoredir=/usr/libexec/git-core -builddir="$srcdir"/$pkgname-$pkgver prepare() { default_prepare + cat >> config.mak <<-EOF NO_GETTEXT=YesPlease NO_SVN_TESTS=YesPlease @@ -60,30 +60,30 @@ prepare() { build() { cd "$builddir" + make -j1 prefix=/usr DESTDIR="$pkgdir" perl/perl.mak make prefix=/usr DESTDIR="$pkgdir" } package() { cd "$builddir" - make -j1 prefix=/usr \ - DESTDIR="$pkgdir" \ - INSTALLDIRS=vendor \ - install - mkdir -p "$pkgdir"/var/git - install -Dm755 "$srcdir"/git-daemon.initd \ - "$pkgdir"/etc/init.d/git-daemon - install -Dm644 "$srcdir"/git-daemon.confd \ - "$pkgdir"/etc/conf.d/git-daemon + make -j1 prefix=/usr DESTDIR="$pkgdir" INSTALLDIRS=vendor install make prefix=/usr DESTDIR="$pkgdir" install-man + + mkdir -p "$pkgdir"/var/git + install -Dm755 "$srcdir"/git-daemon.initd "$pkgdir"/etc/init.d/git-daemon + install -Dm644 "$srcdir"/git-daemon.confd "$pkgdir"/etc/conf.d/git-daemon } _perl_git_svn() { pkgdesc="Perl interface to Git::SVN" depends="git=$pkgver-r$pkgrel" replaces="git-perl" - eval local `perl -V:vendorlib` + local vendorlib + + vendorlib=$(_perl_config vendorlib) + mkdir -p "$subpkgdir"/$vendorlib/Git mv "$pkgdir"/$vendorlib/Git/SVN* "$subpkgdir"/$vendorlib/Git/ } @@ -92,28 +92,28 @@ _perl_git() { pkgdesc="Perl interface to Git" depends="git=$pkgver-r$pkgrel perl-error" replaces="git-perl" - eval local `perl -V:vendorlib` - eval local `perl -V:vendorarch` - for i in $vendorlib $vendorarch; do + + local i + for i in "$(_perl_config vendorlib)" "$(_perl_config vendorarch)"; do mkdir -p "$subpkgdir"/${i%/*} mv "$pkgdir"/$i "$subpkgdir"/$i done } email() { - depends="perl perl-git=$pkgver-r$pkgrel perl-net-smtp-ssl - perl-authen-sasl" pkgdesc="Git tools for sending email" + depends="perl perl-git=$pkgver-r$pkgrel perl-net-smtp-ssl perl-authen-sasl" replaces="git" + mkdir -p "$subpkgdir"/$_gitcoredir mv "$pkgdir"/$_gitcoredir/*email* "$pkgdir"/$_gitcoredir/*imap* \ "$subpkgdir"/$_gitcoredir } svn() { + pkgdesc="Subversion support for git" depends="perl perl-git-svn=$pkgver-r$pkgrel perl-subversion perl-term-readkey" - pkgdesc="Subversion support for git" replaces="" mkdir -p "$subpkgdir"/$_gitcoredir @@ -126,15 +126,16 @@ cvs() { pkgdesc="Git tools for importing CVS repositories" depends="perl perl-git=$pkgver-r$pkgrel cvs perl-dbd-sqlite" replaces="git-perl" + mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/$_gitcoredir mv "$pkgdir"/usr/bin/git-cvs* "$subpkgdir"/usr/bin/ - mv "$pkgdir"/$_gitcoredir/*cvs* "$subpkgdir"/$_gitcoredir \ - + mv "$pkgdir"/$_gitcoredir/*cvs* "$subpkgdir"/$_gitcoredir } _fast_import() { pkgdesc="Git backend for fast Git data importers" depends="git=$pkgver-r$pkgrel" + mkdir -p "$subpkgdir"/$_gitcoredir mv "$pkgdir"/$_gitcoredir/git-fast-import "$subpkgdir"/$_gitcoredir/ } @@ -143,6 +144,7 @@ p4() { pkgdesc="Git tools for working with Perforce depots" depends="git=$pkgver-r$pkgrel git-fast-import=$pkgver-r$pkgrel" replaces="git" + mkdir -p "$subpkgdir"/$_gitcoredir/mergetools mv "$pkgdir"/$_gitcoredir/*p4* "$subpkgdir"/$_gitcoredir/ mv "$pkgdir"/$_gitcoredir/mergetools/*p4* \ @@ -153,11 +155,12 @@ daemon() { pkgdesc="Git protocol daemon" depends="git=$pkgver-r$pkgrel" replaces="git" + mkdir -p "$subpkgdir"/$_gitcoredir mv "$pkgdir"/$_gitcoredir/git-daemon \ "$pkgdir"/$_gitcoredir/git-http-backend \ "$pkgdir"/$_gitcoredir/git-shell \ - "$subpkgdir"/$_gitcoredir + "$subpkgdir"/$_gitcoredir/ mv "$pkgdir"/etc "$subpkgdir"/ } @@ -166,9 +169,10 @@ gitweb() { pkgdesc="Simple web interface to git repositories" depends="git=$pkgver-r$pkgrel perl" replaces="git" + mkdir -p "$subpkgdir"/usr/share "$subpkgdir"$_gitcoredir mv "$pkgdir"/usr/share/gitweb "$subpkgdir"/usr/share/ - mv "$pkgdir"/$_gitcoredir/git-instaweb "$subpkgdir"$_gitcoredir + mv "$pkgdir"/$_gitcoredir/git-instaweb "$subpkgdir"$_gitcoredir/ } completion() { @@ -192,8 +196,8 @@ subtree() { } subtree_doc() { - depends="" pkgdesc="Split git repository into subtrees (documentation)" + depends="" replaces="" cd "$builddir"/contrib/subtree @@ -202,8 +206,8 @@ subtree_doc() { } gui() { - depends="git=$pkgver-r$pkgrel tcl tk" pkgdesc="GUI interface for git" + depends="git=$pkgver-r$pkgrel tcl tk" replaces="" mkdir -p "$subpkgdir"/usr/share "$subpkgdir"/usr/libexec/git-core @@ -215,8 +219,8 @@ gui() { } gitk() { - depends="git=$pkgver-r$pkgrel tcl tk" pkgdesc="Gitk interface for git" + depends="git=$pkgver-r$pkgrel tcl tk" replaces="" mkdir -p "$subpkgdir"/usr/share "$subpkgdir"/usr/bin @@ -225,24 +229,27 @@ gitk() { } diff_highlight() { - depends="git=$pkgver-r$pkgrel perl" pkgdesc="diff highlight for git" + depends="git=$pkgver-r$pkgrel perl" replaces="" cd "$builddir"/contrib/diff-highlight + make prefix=/usr DESTDIR="$subpkgdir" + mkdir -p "$subpkgdir"/usr/bin install -Dm755 diff-highlight "$subpkgdir"/usr/bin/ } # catch-the-rest of stuff that needs perl _git_perl() { - depends="git=$pkgver-r$pkgrel perl-git=$pkgver-r$pkgrel perl" pkgdesc="Additional Git commands that requires perl" + depends="git=$pkgver-r$pkgrel perl-git=$pkgver-r$pkgrel perl" replaces="" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/perl* "$subpkgdir"/usr/lib/ + cd "$pkgdir" find -type f | xargs file --mime-type | grep perl | cut -d: -f1| while read f; do mkdir -p "$subpkgdir"/${f%/*} @@ -251,6 +258,10 @@ _git_perl() { find "$subpkgdir" -name perllocal.pod -delete } +# Prints values of the Config.pm variable $1. +_perl_config() { + perl -e "use Config; print \$Config{$1};" +} sha512sums="09e30ada7bcf41f78f15784908062c10162d58d2fd7a68ad27e42fd49dc37eb0e82c19ad21db31034a189a8cdd009013a29f943e1ae5d5ab5688c913d2a4d42a git-2.16.1.tar.xz 85767b5e03137008d6a96199e769e3979f75d83603ac8cb13a3481a915005637409a4fd94e0720da2ec6cd1124f35eba7cf20109a94816c4b4898a81fbc46bd2 bb-tar.patch |