36 lines
717 B
Bash
36 lines
717 B
Bash
#!/usr/bin/env bash
|
|
|
|
# exit when any command fails
|
|
set -e
|
|
|
|
# build the driver
|
|
BUILD_PATH=build
|
|
if [ ! -d "$BUILD_PATH" ]; then
|
|
mkdir $BUILD_PATH
|
|
fi
|
|
|
|
pushd $BUILD_PATH
|
|
cmake ..
|
|
make
|
|
|
|
# create package
|
|
PACKAGE_DIR=driver_air_glasses
|
|
if [ ! -d "$PACKAGE_DIR" ]; then
|
|
mkdir $PACKAGE_DIR
|
|
fi
|
|
|
|
# move and rename the compiled driver to the driver directory
|
|
mv xrealAirLinuxDriver $PACKAGE_DIR
|
|
|
|
# copy setup and user-relevant scripts
|
|
cp ../bin/setup $PACKAGE_DIR
|
|
cp ../bin/xreal_driver_config $PACKAGE_DIR
|
|
cp ../bin/xreal_driver_uninstall $PACKAGE_DIR
|
|
|
|
# copy the systemd files needed to run our service
|
|
cp -r ../systemd $PACKAGE_DIR
|
|
|
|
# bundle up the driver directory
|
|
tar -zcvf xrealAirLinuxDriver.tar.gz $PACKAGE_DIR
|
|
|
|
popd |