summaryrefslogtreecommitdiffstats
path: root/distro-packages/ubuntu22.04/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'distro-packages/ubuntu22.04/build.sh')
-rwxr-xr-xdistro-packages/ubuntu22.04/build.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/distro-packages/ubuntu22.04/build.sh b/distro-packages/ubuntu22.04/build.sh
new file mode 100755
index 0000000..754461e
--- /dev/null
+++ b/distro-packages/ubuntu22.04/build.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+set -e
+
+cd /opt/src/runwhenidle
+VERSION=`git describe --tags 2>/dev/null || (echo -n "0.0-dev-" && git rev-parse HEAD)`
+ARCH=`dpkg --print-architecture`
+BUILD_DIR="package-build/runwhenidle_${VERSION}_${ARCH}"
+TARGET_DIRECTORY='/usr/bin'
+
+make clean release
+rm -r $BUILD_DIR 2>/dev/null || true
+mkdir -p $BUILD_DIR/$TARGET_DIRECTORY
+cp runwhenidle $BUILD_DIR/$TARGET_DIRECTORY/
+cp -r distro-packages/ubuntu22.04/DEBIAN $BUILD_DIR/
+
+sed -i "s/\$VERSION/$VERSION/g" $BUILD_DIR/DEBIAN/control
+dpkg-deb --build --root-owner-group $BUILD_DIR \ No newline at end of file