gitolite-gentoo-3.6.2.2.ebuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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="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. dev-perl/Net-SSH-AuthorizedKeysFile
  28. dev-perl/JSON"
  29. pkg_setup() {
  30. enewgroup git
  31. enewuser git -1 /bin/sh /var/lib/gitolite git
  32. }
  33. src_prepare() {
  34. echo "${PF}-gentoo" > src/VERSION
  35. }
  36. src_install() {
  37. local uexec=/usr/libexec/${PN}
  38. rm -rf src/lib/Gitolite/Test{,.pm}
  39. insinto $VENDOR_LIB
  40. doins -r src/lib/Gitolite
  41. dodoc README.markdown CHANGELOG
  42. # These are meant by upstream as examples, you are strongly recommended to
  43. # customize them for your needs.
  44. dodoc contrib/utils/ipa_groups.pl contrib/utils/ldap_groups.sh
  45. insopts -m0755
  46. insinto $uexec
  47. doins -r src/{commands,syntactic-sugar,triggers,VREF}/
  48. doins -r contrib/{commands,triggers}
  49. insopts -m0644
  50. doins src/VERSION
  51. exeinto $uexec
  52. doexe src/gitolite{,-shell}
  53. dodir /usr/bin
  54. for bin in gitolite{,-shell}; do
  55. dosym /usr/libexec/${PN}/${bin} /usr/bin/${bin}
  56. done
  57. if use tools; then
  58. dobin check-g2-compat convert-gitosis-conf
  59. dobin contrib/utils/rc-format-v3.4
  60. fi
  61. keepdir /var/lib/gitolite
  62. fowners git:git /var/lib/gitolite
  63. fperms 750 /var/lib/gitolite
  64. fperms 0644 ${uexec}/VREF/MERGE-CHECK # It's meant as example only
  65. }
  66. pkg_postinst() {
  67. if [[ "$(get_major_version $REPLACING_VERSIONS)" == "2" ]]; then
  68. ewarn
  69. elog "***NOTE*** This is a major upgrade and will likely break your existing gitolite-2.x setup!"
  70. elog "Please read http://gitolite.com/gitolite/migr.html first!"
  71. ewarn
  72. elog "***NOTE*** If you're using the \"umask\" feature of ${PN}-2.x:"
  73. elog "You'll have to replace each \"umask = ...\" option by \"option umask = ...\""
  74. elog "And you'll also have to enable the \"RepoUmask\" module in your .gitolite.rc"
  75. ewarn
  76. fi
  77. # bug 352291
  78. gitolite_home=$(awk -F: '$1 == "git" { print $6 }' /etc/passwd)
  79. if [ -n "${gitolite_home}" -a "${gitolite_home}" != "/var/lib/gitolite" ]; then
  80. ewarn
  81. elog "Please make sure that your 'git' user has the correct homedir (/var/lib/gitolite)."
  82. elog "Especially if you're migrating from gitosis."
  83. ewarn
  84. fi
  85. }