#!/bin/bash if [ "$EUID" -ne 0 ] then echo "Please run as root" exit fi export MYNAME=`id 1000 | awk '{print $1}' | sed 's/.*(\(.*\))/\1/'` runuser $MYNAME --preserve-environment -c '/bin/bash << EOF export PATH=/home/$MYNAME/.cargo/bin:$PATH export HOME=/home/$MYNAME if ! command -v rustup &> /dev/null then echo -e "Rustup could not be found, it can be installed by running the following command: curl --proto \047=https\047 --tlsv1.2 -sSf https://sh.rustup.rs | sh" exit fi cd /home/$MYNAME/src git clone https://salsa.debian.org/Kazan-team/power-instruction-analyzer.git pia cd pia maturin build --cargo-extra-args=--features=python-extension EOF' cd /home/$MYNAME/src/pia python3 -m pip install target/wheels/*.whl