]> Nutra Git (v1) - gamesguru/git-remote-gcrypt.git/commitdiff
Add ./install.sh to install git-remote-gcrypt and its man page
authorroot <root@localhost>
Thu, 14 Feb 2013 00:00:00 +0000 (00:00 +0000)
committerroot <root@localhost>
Thu, 14 Feb 2013 00:00:00 +0000 (00:00 +0000)
README.rst
install.sh [new file with mode: 0755]

index 80d01cb3cef0c31faac8cf1ecedcdc5ade3a14c6..d0329acd9eca735f40bf9f2427f2d07f820ddbac 100644 (file)
@@ -27,15 +27,15 @@ bridged over arbitrary git transport.
 Quickstart
 ..........
 
-Install as `git-remote-gcrypt` in `$PATH`.
+* Install `git-remote-gcrypt` by running the supplied `install.sh` script.
 
-Configure the list of participant gpg keys:
+Configure the list of participant gpg keys:
 
     ::
 
         git config --global gcrypt.participants YOURKEYID
 
-Create an encrypted remote by pushing to it:
+Create an encrypted remote by pushing to it:
 
     ::
 
@@ -49,7 +49,7 @@ Create an encrypted remote by pushing to it:
         > To gcrypt::[...]
         > * [new branch]      master -> master
 
-Share the updated Repository URL with all participants.
+Share the updated Repository URL with all participants.
 
 (The generated Repository ID is not secret, it only exists to ensure
 that two repositories signed by the same user can not be maliciously
diff --git a/install.sh b/install.sh
new file mode 100755 (executable)
index 0000000..d84f31e
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+: ${prefix:=/usr/local}
+: ${DESTDIR:=}
+
+verbose() { echo "$@" >&2 && "$@"; }
+install_v()
+{
+       # Install $1 into $2/ with mode $3
+       verbose install -d "$2" &&
+       verbose install -m "$3" "$1" "$2"
+}
+
+install_v git-remote-gcrypt "$DESTDIR$prefix/bin" 755
+
+if command -v rst2man >/dev/null
+then
+       trap 'rm -f git-remote-gcrypt.1.gz' EXIT
+       verbose rst2man ./README.rst | gzip -9 > git-remote-gcrypt.1.gz
+       install_v git-remote-gcrypt.1.gz "$DESTDIR$prefix/share/man/man1" 644
+else
+       echo "'rst2man' not found, man page not installed" >&2
+fi