abinfo "Installing scripts and byte codes..."
mkdir -pv "$PKGDIR"/usr/lib/python"$ABPY3VER"/site-package/throttled 
install -Dvm755 "$SRCDIR"/throttled.py \
    "$PKGDIR"/usr/lib/python"$ABPY3VER"/site-package/throttled/throttled.py
install -Dvm755 "$SRCDIR"/mmio.py \
    "$PKGDIR"/usr/lib/python"$ABPY3VER"/site-package/throttled/mmio.py
install -Dvm644 "$SRCDIR"/etc/throttled.conf \
    "$PKGDIR"/etc/throttled.conf
install -Dvm644 "$SRCDIR"/systemd/throttled.service \
    "$PKGDIR"/usr/lib/systemd/system/throttled.service
cp -va "$SRCDIR"/__pycache__ \
    "$PKGDIR"/usr/lib/python"$ABPY3VER"/site-package/throttled/

mkdir -pv "$PKGDIR"/usr/bin/
ln -vs /usr/lib/python"$ABPY3VER"/site-package/throttled/throttled.py \
    "$PKGDIR"/usr/bin/throttled 

abinfo "Installing README ..."
install -Dvm644 "$SRCDIR"/README.md \
    "$PKGDIR"/usr/share/doc/"$PKGNAME"/README.md

abinfo "Creating symbolic link for possible compability..."
# As the project name is changed to `throttled` from the legacy name `lenovo_fix` 
# in commit 392f3f8, for compability reasons, the config file is named to 
# `throttled.conf` and the legacy config file `lenovo_fix.conf` will be a 
# symbolic link to `throttled.conf`
ln -vs throttled.conf \
    "$PKGDIR"/etc/lenovo_fix.conf
ln -vs throttled.py \
    "$PKGDIR"/usr/lib/python"$ABPY3VER"/site-package/throttled/lenovo_fix.py
