From bd3e48256fe66809ba8cde0ad5a751d996ba0f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Wed, 3 Mar 2021 18:54:12 +0100 Subject: [PATCH] Install and uninstall scripts. --- install | 16 ++++++++++++++++ uninstall | 6 ++++++ 2 files changed, 22 insertions(+) create mode 100755 install create mode 100755 uninstall diff --git a/install b/install new file mode 100755 index 0000000..9213ac5 --- /dev/null +++ b/install @@ -0,0 +1,16 @@ +#!/bin/sh +if ! [ -f target/release/indivisible ] +then + echo "ERROR: you have to compile a release build of indivisible first." + echo "Please run 'cargo build --release'" + exit 1 +fi + +PREFIX="/usr/local" + +echo "Installing ./target/release/indivisible to $PREFIX/bin/" +install -m 755 ./target/release/indivisible $PREFIX/bin/ +gzip -c indivisible.1 > indivisible.1.gz +echo "Installing manpage to $PREFIX/share/man/man1/" +install -m 644 indivisible.1.gz $PREFIX/share/man/man1/ +rm indivisible.1.gz diff --git a/uninstall b/uninstall new file mode 100755 index 0000000..f1114cf --- /dev/null +++ b/uninstall @@ -0,0 +1,6 @@ +#!/bin/sh +PREFIX="/usr/local" +echo "Remove $PREFIX/bin/indivisible" +rm -f $PREFIX/bin/indivisible +echo "Remove $PREFIX/local/man/man1/indivisible.1.gz" +rm -f $PREFIX/local/man/man1/indivisible.1.gz