From ad181f63bc252303d52dc413433890f14d21b915 Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Tue, 8 Dec 2015 01:10:08 -0300 Subject: Add a simple installation script and xsession file --- dotwm.desktop | 6 +++++ install.sh | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 dotwm.desktop create mode 100755 install.sh diff --git a/dotwm.desktop b/dotwm.desktop new file mode 100644 index 0000000..4b3a832 --- /dev/null +++ b/dotwm.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=DotWM +Comment=Stacking window manager +Exec=/usr/local/bin/dotwm +Type=XSession diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..4c16960 --- /dev/null +++ b/install.sh @@ -0,0 +1,78 @@ +#!/bin/bash + +PREFIX=/usr/local +BINDIR=${PREFIX}/bin +DATADIR=${PREFIX}/share +MANDIR=${DATADIR}/man +MAN1DIR=${MANDIR}/man1 +DOCDIR=${DATADIR}/doc/dotwm +EXAMPLEDIR=${DOCDIR}/examples +SYSCONFDIR=/etc +CONFIGDIR=${SYSCONFDIR}/xdg/dotwm +XSESSIONDIR=${DATADIR}/share/xsessions + +fail_dependencies() { + cat < /dev/null > /dev/null + then + fail_dependencies + fi + + if ! which cargo 2> /dev/null > /dev/null + then + fail_dependencies + fi + + cargo build --release +} + +_install() { + echo $@ + if [[ x"$1" = "x--prefix" ]] + then + PREFIX=$2 + fi + echo "Base dir for installation: ${PREFIX}" + install -m 755 target/release/dotwm $BINDIR + install -m 644 dotwm.1 ${MAN1DIR} + mkdir -p ${DOCDIR} + mkdir -p ${EXAMPLEDIR} + install -m 755 autostart ${EXAMPLEDIR} + install -m 644 LICENSE ${DOCDIR} + install -m 644 README.md ${DOCDIR} + install -m 644 dotwm.desktop ${XSESSIONDIR} +} + +_uninstall() { + rm $BINDIR/dotwm + rm ${EXAMPLEDIR}/autostart + rm ${MAN1DIR}/dotwm.1 + rm -r ${DOCDIR} + rm ${XSESSIONDIR}/dotwm.desktop +} + +base=$1 +shift +case $base in + build) + _build + ;; + install) + _install $@ + ;; + uninstall) + _uninstall $@ + ;; + *) + _build + _install $@ + ;; +esac + -- cgit v1.2.3-70-g09d2