-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Ubuntu/Debian package build script
- Loading branch information
Showing
6 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
runwhenidle | ||
package-build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Package: runwhenidle | ||
Version: $VERSION | ||
Architecture: amd64 | ||
Depends: libc6 (>= 2.34), libx11-6, libxss1 | ||
Maintainer: Konstantin Pereiaslov <perk11@perk11.info> | ||
Description: runwhenidle runs a computationally or IO-intensive program when user is not in front of the computer, pausing it once the user is back, resuming once the user left, often without requiring adaptation from the program being ran. | ||
runwhenidle runs a command given to it, pauses it if the user is active by sending SIGTSTP to the command, | ||
when the user activity stops, runwhenidle resumes the command by sending it SIGCONT signal. | ||
It then checks once per second if user activity has resumed, and once it is, pauses the command again. | ||
runwhenidle uses XScreenSaverQueryInfo() to check when last user activity happened therefore a running X server is required. | ||
Wayland is not currently supported. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM ubuntu:22.04 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
ARG HOST_UID | ||
|
||
|
||
RUN set -ex \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
fakeroot \ | ||
dpkg-dev \ | ||
libxss-dev \ | ||
git \ | ||
&& apt-get clean \ | ||
&& rm -rf /tmp/* /var/tmp/* | ||
|
||
RUN useradd build -u $HOST_UID \ | ||
&& mkdir -p /home/build \ | ||
&& chown build:build /home/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |