install.sh 547 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. set -e
  3. : ${prefix:=/usr/local}
  4. : ${DESTDIR:=}
  5. verbose() { echo "$@" >&2 && "$@"; }
  6. install_v()
  7. {
  8. # Install $1 into $2/ with mode $3
  9. verbose install -d "$2" &&
  10. verbose install -m "$3" "$1" "$2"
  11. }
  12. install_v git-remote-gcrypt "$DESTDIR$prefix/bin" 755
  13. if command -v rst2man >/dev/null
  14. then
  15. trap 'rm -f git-remote-gcrypt.1.gz' EXIT
  16. verbose rst2man ./README.rst | gzip -9 > git-remote-gcrypt.1.gz
  17. install_v git-remote-gcrypt.1.gz "$DESTDIR$prefix/share/man/man1" 644
  18. else
  19. echo "'rst2man' not found, man page not installed" >&2
  20. fi