abinfo "Renaming all legacy name \"lenovo_fix\" to \"throttled\" ..."
if [ -a "$SRCDIR"/etc/lenovo_fix.conf ] 
then
    mv -v "$SRCDIR"/etc/lenovo_fix.conf \
        "$SRCDIR"/etc/throttled.conf
fi

if [ -a "$SRCDIR"/systemd/lenovo_fix.service ] 
then
    mv -v "$SRCDIR"/systemd/lenovo_fix.service \
        "$SRCDIR"/systemd/throttled.service
fi

if [ -a "$SRCDIR"/lenovo_fix.py ] 
then
    mv -v "$SRCDIR"/lenovo_fix.py \
        "$SRCDIR"/throttled.py
fi

abinfo "Modifying systemd service file..."
sed -i "s|ExecStart=.*|ExecStart=/bin/python3 /usr/lib/python$ABPY3VER/site-package/throttled.py|" \
    "$SRCDIR"/systemd/throttled.service
# Keep possible backward compability when the change of project name applies
echo "Alias=lenovo_fix.service" >> "$SRCDIR"/systemd/throttled.service

abinfo "Pre-compiling all python scripts ..."
python3 -m compileall *.py
