-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·25 lines (18 loc) · 828 Bytes
/
build.sh
File metadata and controls
executable file
·25 lines (18 loc) · 828 Bytes
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
#! /bin/bash
script_dir=$(dirname "$(realpath "$0")")
pkgname="imageforge"
version=$(dpkg-parsechangelog --show-field Version)
#Build package
cd "$script_dir/"
python3 setup.py build
#Install package to script_dir/src/
python3 setup.py install --root="$script_dir/build/" --optimize=1 --skip-build
rm -rf "$script_dir/src/"
mkdir -p "$script_dir/src/usr/lib/python3/dist-packages/"
find "$script_dir/build/" -name __pycache__ -type d -exec rm -rf {} \;
find "$script_dir/build/" -name "$pkgname" -type d -exec cp -r {} "$script_dir/src/usr/lib/python3/dist-packages/" \;
find "$script_dir/build/" -name "$pkgname-$version.egg-info" -type d -exec cp -r {} "$script_dir/src/usr/lib/python3/dist-packages/" \;
# cleanup
rm -rf "$script_dir/build/"
rm -rf "$script_dir/v$version.tar.gz"
rm -rf "$script_dir/$pkgname-$version"