forked from github-starred/nwg-displays
improve install script
This commit is contained in:
40
install.sh
40
install.sh
@@ -1,7 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
python3 setup.py install --optimize=1
|
||||
cp nwg-displays.svg /usr/share/pixmaps/
|
||||
cp nwg-displays.desktop /usr/share/applications/
|
||||
install -Dm 644 -t "/usr/share/licenses/nwg-displays" LICENSE
|
||||
install -Dm 644 -t "/usr/share/doc/nwg-displays" README.md
|
||||
# Before running this script, make sure you have python-build, python-installer,
|
||||
# python-wheel and python-setuptools installed.
|
||||
|
||||
PROGRAM_NAME="nwg-displays"
|
||||
MODULE_NAME="nwg_displays"
|
||||
SITE_PACKAGES="$(python3 -c "import sysconfig; print(sysconfig.get_paths()['purelib'])")"
|
||||
PATTERN="$SITE_PACKAGES/$MODULE_NAME*"
|
||||
|
||||
# Remove from site_packages
|
||||
for path in $PATTERN; do
|
||||
if [ -e "$path" ]; then
|
||||
echo "Removing $path"
|
||||
rm -r "$path"
|
||||
fi
|
||||
done
|
||||
|
||||
[ -d "./dist" ] && rm -rf ./dist
|
||||
|
||||
# Remove launcher scripts
|
||||
filenames=("/usr/bin/nwg-displays")
|
||||
|
||||
for filename in "${filenames[@]}"; do
|
||||
rm -f "$filename"
|
||||
echo "Removing -f $filename"
|
||||
done
|
||||
|
||||
python -m build --wheel --no-isolation
|
||||
|
||||
python -m installer dist/*.whl
|
||||
|
||||
install -Dm 644 -t "/usr/share/applications" "$PROGRAM_NAME.desktop"
|
||||
install -Dm 644 -t "/usr/share/pixmaps" "$PROGRAM_NAME.svg"
|
||||
|
||||
install -Dm 644 -t "/usr/share/licenses/$PROGRAM_NAME" LICENSE
|
||||
install -Dm 644 -t "/usr/share/doc/$PROGRAM_NAME" README.md
|
||||
|
||||
Reference in New Issue
Block a user