gitolite-gentoo-3.6.4.ebuild 2.7 KB

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