-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·49 lines (27 loc) · 890 Bytes
/
build.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
if [ ! $version ]; then
echo "An environment variable 'version' is not set"
exit 2
fi
VERSION="$version" # fix for a build environment
TMP_DIR=azimuth3imager_$VERSION-1_all
USR_DIR=/usr/local/bin
APP_DIR=/usr/share/applications
ICONS_DIR=/usr/share/icons/hicolor/scalable/apps
echo "Building C++ scripts"
./compile.sh
echo "Creating temporary directory and copying files"
mkdir -p "$TMP_DIR$USR_DIR"
mkdir -p "$TMP_DIR$APP_DIR"
mkdir -p "$TMP_DIR$ICONS_DIR"
cp -rp build/* "$TMP_DIR$USR_DIR"
cp -rp azimuth3imager "$TMP_DIR$USR_DIR"
cp -rp assets/azimuth3imager.desktop "$TMP_DIR$APP_DIR"
cp -rp assets/tbdd-a3i.svg "$TMP_DIR$ICONS_DIR"
cp -rp DEBIAN $TMP_DIR
echo "Adding version to DEBIAN/control"
echo "Version: $VERSION" >> $TMP_DIR/DEBIAN/control
echo "Creating package"
fakeroot dpkg-deb --build $TMP_DIR
echo "Removing $TMP_DIR"
rm -rf $TMP_DIR