Commit 09a42935 authored by TomKellyGenetics's avatar TomKellyGenetics
Browse files

set up passing a local directory as prefix

parent 0e6ea119
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -23,23 +23,21 @@ reference:

reference-clean:
	make -C  test/cellranger_reference/cellranger-tiny-ref clean
	echo "removing pre-generated cellranger reference files"
	@echo "removing pre-generated cellranger reference files"
	rm -Rf  test/cellranger_reference/cellranger-tiny-ref/3.0.0
	rm -Rf  test/cellranger_reference/cellranger-tiny-ref/1.2.0

# Copy to manuals (requires root priviledges
manual:
	bash man/INSTALL
	@bash man/INSTALL

manual-clean:
	bash man/REMOVE
	@bash man/REMOVE

install:
	@if [[ -z $(prefix) ]]; then echo "TRUE"; fi
	@echo "installing to: $(prefix)"
	bash inst/INSTALL
	@bash inst/INSTALL prefix=$(prefix)

remove:
	bash inst/REMOVE
	@bash inst/REMOVE

uninstall: remove clean

inst/INSTALL

0 → 100755
+64 −0
Original line number Diff line number Diff line
#! /bin/sh

#default install location (root)
if [[ -z $prefix ]]; then prefix="/"; fi
echo "installing to: $prefix"

if [[ $1 == "--prefix" ]]
     then
     prefix=$2
     if [[ ! -d $prefix ]]
         then
         echo "--prefix $prefix must be a directory"
         exit 1
     fi
    if [[ ! -w $prefix ]]
        then
        echo "--prefix $prefix must be a writeable"
        exit 1
    fi
fi

if [[ ! -w $prefix ]]
    then
    echo "$prefix must be a writeable directory"
    echo "try running:"
    echo "    sudo bash $( cd -P "$( dirname ${BASH_SOURCE[0]})" >/dev/null 2>&1 && pwd )/INSTALL"
    echo "    sudo make install"
    exit 1
fi

echo prefix=$prefix

exit 0
if [[ -f /etc/manpath.config ]]
    then 
fi
## check config for Mac
if [[ -f /etc/manpaths ]]
    then CONFIG="/etc/manpaths"
    MANDIR=`tail -n 1 ${CONFIG}`
fi
if [[ -z $CONFIG ]]
    then
    if [[ ! -z $MANPATH ]]
        then
        SHELL_RC=`echo ~/.${0}rc`
        echo "export MANPATH=/usr/local/man" >> $SHELL_RC
        MANDIR=`echo ${MANPATH} | cut -d: -f1`
    fi
fi
#requires root priviledges
if [[ -w ${MANDIR} ]]
    then
    mkdir -p ${MANDIR}/man1
    cp man/launch_universc.sh man/launch_universc.sh.1
    mv man/launch_universc.sh.1 ${MANDIR}/man1/launch_universc.sh.1
    gzip ${MANDIR}/man1/launch_universc.sh.1
else
    echo "Directory ${MANDIR} not writeable"
    echo "Warning: installing manual requires root priviledges"
    echo "  Try running of the following:"
    echo "      sudo bash $( cd -P "$( dirname ${BASH_SOURCE[0]})" >/dev/null 2>&1 && pwd )/INSTALL"
    echo "      sudo make manual"
fi

inst/REMOVE

0 → 100755
+44 −0
Original line number Diff line number Diff line
#! /bin/sh

# add manual directory to PATH if not already found
## check config for Linux
if [[ -f /etc/manpath.config ]]
    then CONFIG="/etc/manpath.config"
    MANDIR=`grep "^MANDATORY_MANPATH" /etc/manpath.config | tail -n 1 | cut -f4`
fi
## check config for Mac
if [[ -f /etc/manpaths ]]
    then CONFIG="/etc/manpaths"
    MANDIR=`tail -n 1 ${CONFIG}`
fi
if [[ -z $CONFIG ]]
    then
    if [[ ! -z $MANPATH ]]
        then
        SHELL_RC=`echo ~/.${0}rc`
        echo "export MANPATH=/usr/local/man" >> $SHELL_RC
        MANDIR=`echo ${MANPATH} | cut -d: -f1`
    fi
fi
if [[ -f  man/launch_universc.sh.1 ]]
    then
    rm man/launch_universc.sh.1
fi
#requires root priviledges
if [[ -w ${MANDIR} ]]
    then
    if [[ -f ${MANDIR}/man1/launch_universc.sh.1 ]]
    then
        rm ${MANDIR}/man1/launch_universc.sh.1
    fi
    if [[ -f ${MANDIR}/man1/launch_universc.sh.1.gz ]] 
        then
        rm ${MANDIR}/man1/launch_universc.sh.1.gz
    fi
else
    echo "Directory ${MANDIR} not writeable"
    echo "Warning: installing manual requires root priviledges"
    echo "  Try running of the following:"
    echo "      sudo bash $( cd -P "$( dirname ${BASH_SOURCE[0]})" >/dev/null 2>&1 && pwd )/REMOVE"
    echo "      sudo make manual-clean"
fi