#!/usr/bin/env bash files="$@" function create_bin_file { cat << EOF > "$bindir/backshift" #!/usr/bin/env bash if [ "\$#" = 0 ] then "$which_python" "$prefix"/lib/backshift/backshift else "$which_python" "$prefix"/lib/backshift/backshift "\$@" fi EOF } if [ -d install-variables ] then prefix=$(cat 'install-variables'/prefix-file) bindir=$(cat 'install-variables'/bindir-file) which_python=$(cat 'install-variables'/python-file) use_cython=$(cat 'install-variables'/use-cython-file) mkdir -p "$bindir" mkdir -p "$prefix"/lib/backshift # Install the pure python modules cp $files "$prefix"/lib/backshift/. # Optionally install the Cython if [ "$use_cython" = "True" ] then ./build-one-rcm --use-installation-python cp rolling_checksum_pyx_mod.so "$prefix"/lib/backshift/. # This comes in through argv - we don't want it since we're doing the cython version rm "$prefix"/lib/backshift/rolling_checksum_py_mod.py fi # Install some ancillary scripts cp \ 'just-one' \ 'randomize' \ 'most-recent' \ 'find-backup' \ 'backshift-one' \ 'backshift-while' \ "$bindir"/. # Finally, create the frontend bash script and make it executable create_bin_file chmod 755 "$bindir/backshift" else echo "$0: You must run ./configure before 'make install'" 1>&2 exit 1 fi