gitolite-gentoo-3.6.1.ebuild 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit perl-module user versionator
  5. DESCRIPTION="Highly flexible server for git directory version tracker, Gentoo fork"
  6. HOMEPAGE="https://cgit.gentoo.org/proj/gitolite-gentoo.git"
  7. SRC_URI="mirror://gentoo/${P}.tar.bz2"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE="tools vim-syntax"
  12. DEPEND="dev-lang/perl
  13. virtual/perl-File-Path
  14. virtual/perl-File-Temp
  15. >=dev-vcs/git-1.6.6"
  16. RDEPEND="${DEPEND}
  17. !dev-vcs/gitolite
  18. dev-perl/Net-SSH-AuthorizedKeysFile
  19. vim-syntax? ( app-vim/gitolite-syntax )"
  20. pkg_setup() {
  21. enewgroup git
  22. enewuser git -1 /bin/sh /var/lib/gitolite git
  23. }
  24. src_prepare() {
  25. echo "${PF}-gentoo" > src/VERSION
  26. }
  27. src_install() {
  28. local uexec=/usr/libexec/${PN}
  29. rm -rf src/lib/Gitolite/Test{,.pm}
  30. insinto $VENDOR_LIB
  31. doins -r src/lib/Gitolite
  32. dodoc README.txt CHANGELOG
  33. insopts -m0755
  34. insinto $uexec
  35. doins -r src/{commands,syntactic-sugar,triggers,VREF}/
  36. insopts -m0644
  37. doins src/VERSION
  38. exeinto $uexec
  39. doexe src/gitolite{,-shell}
  40. dodir /usr/bin
  41. for bin in gitolite{,-shell}; do
  42. dosym /usr/libexec/${PN}/${bin} /usr/bin/${bin}
  43. done
  44. if use tools; then
  45. dobin check-g2-compat convert-gitosis-conf
  46. fi
  47. keepdir /var/lib/gitolite
  48. fowners git:git /var/lib/gitolite
  49. fperms 750 /var/lib/gitolite
  50. fperms 0644 ${uexec}/VREF/MERGE-CHECK # It's meant as example only
  51. }
  52. pkg_postinst() {
  53. if [ "$(get_major_version $REPLACING_VERSIONS)" = "2" ]; then
  54. ewarn
  55. elog "***NOTE*** This is a major upgrade and will likely break your existing gitolite-2.x setup!"
  56. elog "Please read http://gitolite.com/gitolite/migr.html first!"
  57. ewarn
  58. elog "***NOTE*** If you're using the \"umask\" feature of ${PN}-2.x:"
  59. elog "You'll have to replace each \"umask = ...\" option by \"option umask = ...\""
  60. elog "And you'll also have to enable the \"RepoUmask\" module in your .gitolite.rc"
  61. ewarn
  62. fi
  63. # bug 352291
  64. gitolite_home=$(awk -F: '$1 == "git" { print $6 }' /etc/passwd)
  65. if [ -n "${gitolite_home}" -a "${gitolite_home}" != "/var/lib/gitolite" ]; then
  66. ewarn
  67. elog "Please make sure that your 'git' user has the correct homedir (/var/lib/gitolite)."
  68. elog "Especially if you're migrating from gitosis."
  69. ewarn
  70. fi
  71. }