bash-git-prompt.spec 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. %global START_TOKEN ### Generated by %{name} rpm package
  2. %global END_TOKEN ### Generated by %{name} rpm package
  3. Name: bash-git-prompt
  4. Version: 2.7.1
  5. Release: 1%{?dist}
  6. Summary: Informative git prompt for bash and fish
  7. Group: Development/Tools
  8. License: FreeBSD
  9. URL: https://github.com/magicmonty/bash-git-prompt
  10. Source0: https://github.com/magicmonty/%{name}/archive/%{name}-%{version}.tar.gz
  11. Requires: git
  12. BuildArch: noarch
  13. %description
  14. A bash prompt that displays information about the current git repository. In particular the branch name, difference with remote branch, number of files staged, changed, etc.
  15. This package will automatically enable the git prompt for bash after
  16. install. It will disable the prompt accordingly after uninstall.
  17. %prep
  18. %setup -q
  19. %build
  20. # No command are required here
  21. # These comments are here to avoid rpm lint issue
  22. %install
  23. install -dm 755 %{buildroot}%{_datadir}/%{name}
  24. install -pm 755 *.sh %{buildroot}%{_datadir}/%{name}
  25. #install -pm 755 *.py %{buildroot}%{_datadir}/%{name}
  26. install -pm 755 *.fish %{buildroot}%{_datadir}/%{name}
  27. install -pm 644 README.md %{buildroot}%{_datadir}/%{name}
  28. install -dm 755 %{buildroot}%{_datadir}/%{name}/themes
  29. install -pm 644 themes/*.bgptheme %{buildroot}%{_datadir}/%{name}/themes
  30. install -pm 644 themes/*.bgptemplate %{buildroot}%{_datadir}/%{name}/themes
  31. %post
  32. # enable bash-git-prompt
  33. cat << EOF >> /etc/bashrc
  34. %{START_TOKEN}
  35. if [ -f %{_datadir}/%{name}/gitprompt.sh ]; then
  36. # Set config variables first
  37. GIT_PROMPT_ONLY_IN_REPO=1
  38. GIT_PROMPT_THEME=Default
  39. source %{_datadir}/%{name}/gitprompt.sh
  40. fi
  41. %{END_TOKEN}
  42. EOF
  43. %postun
  44. # remove bash-git-prompt setup
  45. sed -i -e '/^%{START_TOKEN}/, /^%{END_TOKEN}/{d}' /etc/bashrc
  46. %files
  47. %defattr(-,root,root,-)
  48. %{_datadir}/%{name}
  49. %doc README.md
  50. %license LICENSE.txt
  51. %changelog
  52. * Tue Jun 28 2016 Koustubh Sinkar <ksinkar@gmail.com>
  53. - Updating the spec file to reflect more recent changes
  54. * Fri Aug 08 2014 Justin Zhang <schnell18@gmail.com - 1.0.1-1
  55. - Initial version of package