makedepends=(openssh)
run=(openssh)

description="Distributed version control system designed to handle small to very large projects."
url="http://git-scm.com/"

packager="Grat-OS Team"
maintainer="Grat-OS Team"

name=git
version=2.47.1
release=1

source=(https://www.kernel.org/pub/software/scm/$name/$name{,-manpages,-htmldocs}-$version.tar.xz)

build() {
  cd $name-$version

  ./configure --prefix=/usr \
              --libexecdir=/usr/lib \
              --with-gitconfig=/etc/gitconfig \
              --with-python=python3

  make
  make DESTDIR=$PKG install

  mkdir -p $PKG/usr/share/{man,doc/git-$version}

  cd $SRC
  for i in *.txt *.html howto RelNotes technical
  do
    cp -a $i \
      $PKG/usr/share/doc/git-$version
  done

  mv man* $PKG/usr/share/man

  chown -R root:root $PKG/usr/share/{man,doc}

  find $PKG/usr/share/doc/git-$version -type d -exec chmod 755 {} \;
  find $PKG/usr/share/doc/git-$version -type f -exec chmod 644 {} \;
}
