-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·31 lines (25 loc) · 942 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
# Before running this script, make sure you have python-build, python-installer,
# python-wheel and python-setuptools installed.
PROGRAM_NAME="nwg-clipman"
MODULE_NAME="nwg_clipman"
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
# Remove launcher script
if [ -f "/usr/bin/$PROGRAM_NAME" ]; then
echo "Removing /usr/bin/$PROGRAM_NAME"
rm "/usr/bin/nwg-clipman"
fi
python -m build --wheel --no-isolation
python -m installer dist/*.whl
install -Dm 644 -t "/usr/share/pixmaps" "$PROGRAM_NAME.svg"
install -Dm 644 -t "/usr/share/applications" "$PROGRAM_NAME.desktop"
install -Dm 644 -t "/usr/share/licenses/$PROGRAM_NAME" LICENSE
install -Dm 644 -t "/usr/share/doc/$PROGRAM_NAME" README.md