aboutsummaryrefslogtreecommitdiffstats
path: root/images/make_zip.sh
blob: b2e9645ef4393e1648475d2ac2ebd00280763d0a (plain)
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
#!/bin/sh
# Automatically run the make-zip-file process
# Check we're in the right directory and all is set:
if [ ! -e 'make_zip.sh' ]; then
    echo '[ERROR] Are you running this from the images/ directory?'
    exit 1
fi
if [ ! -e 'images' ]; then
    echo 'images subdirectory does not exist. Please create it and put all the images you want to package in there.'
    exit 1
fi

# Remove cruft before proceeding:
if [ -e 'build' ]; then
    echo 'Please remove build subdirectory before proceeding.'
    exit 1
fi
if [ -e "images/LICENSE" ]; then
	rm images/LICENSE
fi
TAGFILES=`ls images/*.tag 2>/dev/null`
if [ -n "$TAGFILES" ]; then
	rm $TAGFILES
fi

# Run the CPack process:
mkdir build
cd build
cmake .. -DCPACK_GENERATOR=ZIP -DUHD_RELEASE_MODE="$1" ..
make package
mv uhd-images*.zip ..
cmake .. -DCPACK_GENERATOR=TGZ -DUHD_RELEASE_MODE="$1" ..
make package

# Move images to here and clean up after us:
mv uhd-images*.tar.gz ..
cd ..
rm -r build
rm images/*.tag